Back to index

salome-kernel  6.5.0
SALOMEDSImpl_SObject.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : SALOMEDSImpl_SObject.hxx
00024 //  Author : Sergey RUIN
00025 //  Module : SALOME
00026 //
00027 #ifndef __SALOMEDSIMPL_SOBJECT_H__
00028 #define __SALOMEDSIMPL_SOBJECT_H__
00029 
00030 #include "SALOMEDSImpl_Defines.hxx"
00031 
00032 #include "DF_Label.hxx"
00033 #include "DF_Attribute.hxx"
00034 #include <string>
00035 #include <vector>
00036 
00037 class SALOMEDSImpl_SComponent;
00038 class SALOMEDSImpl_Study;
00039 
00040 class SALOMEDSIMPL_EXPORT SALOMEDSImpl_SObject
00041 {
00042 protected:
00043   DF_Label     _lab;
00044   std::string  _name;  
00045   std::string  _value;
00046   std::string  _type;
00047 
00048 public:
00049 
00050   SALOMEDSImpl_SObject();
00051   SALOMEDSImpl_SObject(const DF_Label& theLabel);
00052   SALOMEDSImpl_SObject(const SALOMEDSImpl_SObject& theSObject);
00053   virtual ~SALOMEDSImpl_SObject();
00054 
00055   virtual std::string GetID() const;
00056   virtual SALOMEDSImpl_SComponent GetFatherComponent() const;
00057   virtual SALOMEDSImpl_SObject GetFather() const ;
00058   virtual bool FindAttribute(DF_Attribute*& theAttribute, const std::string& theTypeOfAttribute) const;
00059   virtual bool ReferencedObject(SALOMEDSImpl_SObject& theObject) const ;
00060   virtual bool FindSubObject(int theTag, SALOMEDSImpl_SObject& theObject);
00061 
00062   virtual SALOMEDSImpl_Study*  GetStudy() const;
00063   virtual std::string Name() const { return _name; }
00064   virtual void Name(const std::string& theName) { _name = theName; }
00065   virtual std::vector<DF_Attribute*> GetAllAttributes() const; 
00066 
00067   virtual std::string GetName() const ;
00068   virtual std::string GetComment() const;
00069   virtual std::string GetIOR() const;
00070   virtual void SetAttrString(const std::string& name,const std::string& value);
00071 
00072   virtual int Tag() const { return _lab.Tag(); }
00073   virtual int Depth() const { return _lab.Depth(); }
00074 
00075   virtual DF_Label GetLabel() const { return _lab; }   
00076 
00077   bool IsNull() const { return _lab.IsNull(); }
00078 
00079   bool IsComponent() const;
00080 
00081   operator SALOMEDSImpl_SComponent() const; 
00082 
00083   operator bool () const { return !IsNull(); }
00084 
00085   SALOMEDSImpl_SObject* GetPersistentCopy() const;
00086 
00087   static std::string GetGUID(const std::string& theTypeOfAttribute);
00088 
00089 
00090 };
00091 #endif