1 // SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOMEDS_SObject_i.hxx
25 // Author : Yves FRICAUD
29 #ifndef __SALOMEDS_SOBJECT_I_H__
30 #define __SALOMEDS_SOBJECT_I_H__
36 #include <TDF_Label.hxx>
37 #include <TDocStd_Document.hxx>
38 #include <Standard_GUID.hxx>
40 #include "SALOMEDS_Study_i.hxx"
43 #include <SALOMEconfig.h>
44 #include CORBA_SERVER_HEADER(SALOMEDS)
46 class SALOMEDS_GenericAttribute_i;
51 const char* Str(const TCollection_ExtendedString& theString);
53 std::string GetType(const Handle(TDF_Attribute)& theAttr);
55 Standard_GUID GetGUID(const char* theType);
60 class SALOMEDS_SObject_i: public virtual POA_SALOMEDS::SObject,
61 public virtual PortableServer::RefCountServantBase
65 SALOMEDS_Study_i::TSObjectHolder
66 New(SALOMEDS_Study_i* theStudy,
67 const TDF_Label& theLabel);
71 NewPtr(SALOMEDS_Study_i* theStudy,
72 const TDF_Label& theLabel);
76 NewRef(SALOMEDS_Study_i* theStudy,
77 const TDF_Label& theLabel);
79 virtual SALOMEDS::SObject_ptr GetFather() ;
80 virtual SALOMEDS::SComponent_ptr GetFatherComponent();
81 virtual CORBA::Boolean ReferencedObject(SALOMEDS::SObject_out theSObject);
82 virtual CORBA::Boolean FindSubObject(CORBA::Long theTag, SALOMEDS::SObject_out theSObject);
84 virtual SALOMEDS::Study_ptr GetStudy();
85 virtual SALOMEDS::ListOfAttributes* GetAllAttributes();
87 virtual CORBA::Object_ptr GetObject();
89 virtual char* GetID();
90 virtual CORBA::Short Tag();
91 virtual CORBA::Short Depth();
94 virtual void Name(const char* theName);
96 virtual char* GetName();
97 virtual char* GetComment();
98 virtual char* GetIOR();
101 FindAttribute(SALOMEDS::GenericAttribute_out theAttribute,
102 const char* theTypeOfAttribute);
104 SALOMEDS::GenericAttribute_ptr
105 FindOrCreateAttribute(const char* theTypeOfAttribute);
107 void RemoveAttribute(const char* theTypeOfAttribute);
109 SALOMEDS_Study_i* GetStudyServant(){ return _study;}
111 CORBA::ORB_var GetORB() const;
113 PortableServer::POA_var GetPOA() const;
116 friend class SALOMEDS_GenericAttribute_i;
118 SALOMEDS_GenericAttribute_i*
119 _FindGenAttribute(const Handle(TDF_Attribute)& theAttr);
121 SALOMEDS_GenericAttribute_i*
122 _CreateGenAttribute(const Handle(TDF_Attribute)& theAttr,
123 const char* theTypeOfAttribute);
125 SALOMEDS_GenericAttribute_i*
126 _FindGenAttribute(const char* theTypeOfAttribute);
128 SALOMEDS::GenericAttribute_ptr
129 _FindCORBAAttribute(const char* theTypeOfAttribute);
131 Handle(TDF_Attribute)
132 _AddAttribute(const char* theTypeOfAttribute);
134 SALOMEDS_Study_i* _study;
138 typedef std::string TAttributeID;
139 typedef SALOMEDS_GenericAttribute_i* TAttrHolder;
140 typedef std::map<TAttributeID,TAttrHolder> TAttrMap;
143 SALOMEDS_SObject_i(SALOMEDS_Study_i* theStudy,
144 const TDF_Label& theLabel);
146 ~SALOMEDS_SObject_i();
149 SALOMEDS_SObject_i(); // Not implemented
150 void operator=(const SALOMEDS_SObject_i&); // Not implemented