Salome HOME
Merge from branch CCRT_Port_V220.
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_SObject_i.hxx
index d7562acf75dc68096bb94f1798d8cfdca2be1c55..c5f534180e85248607f5567ac8327b86f723266b 100644 (file)
 #include <TDocStd_Document.hxx>
 #include <Standard_GUID.hxx>
 
+#include "SALOMEDS_Study_i.hxx"
+
 // IDL headers
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOMEDS)
 
-class SALOMEDS_Study_i;
 class SALOMEDS_GenericAttribute_i;
 
 
@@ -60,8 +61,20 @@ class SALOMEDS_SObject_i: public virtual POA_SALOMEDS::SObject,
                          public virtual PortableServer::RefCountServantBase 
 {
 public:
-  static SALOMEDS_SObject_i* New(SALOMEDS_Study_i* theStudy,
-                                const TDF_Label& theLabel);
+  static 
+  SALOMEDS_Study_i::TSObjectHolder 
+  New(SALOMEDS_Study_i* theStudy,
+      const TDF_Label& theLabel);
+
+  static 
+  SALOMEDS_SObject_i* 
+  NewPtr(SALOMEDS_Study_i* theStudy,
+        const TDF_Label& theLabel);
+
+  static 
+  SALOMEDS::SObject_var 
+  NewRef(SALOMEDS_Study_i* theStudy,
+        const TDF_Label& theLabel);
 
   virtual SALOMEDS::SObject_ptr GetFather() ;
   virtual SALOMEDS::SComponent_ptr GetFatherComponent();
@@ -92,9 +105,14 @@ public:
   FindOrCreateAttribute(const char* theTypeOfAttribute);
 
   void RemoveAttribute(const char* theTypeOfAttribute);
+  void OnRemove();
 
   SALOMEDS_Study_i* GetStudyServant(){ return _study;}
 
+  TDF_Label GetLabel(){ return _lab;}
+  TDF_Label GetFatherLabel(){ return _lab.Father();}
+  TDF_Label GetFatherComponentLabel();
+
   CORBA::ORB_var GetORB() const;
 
   PortableServer::POA_var GetPOA() const;
@@ -102,19 +120,21 @@ public:
 protected:
   friend class SALOMEDS_GenericAttribute_i;
 
-  SALOMEDS_GenericAttribute_i* 
+  typedef std::string TAttributeID;
+  typedef std::pair<SALOMEDS_GenericAttribute_i*,SALOMEDS::GenericAttribute_var> TAttrHolder;
+  typedef std::map<TAttributeID,TAttrHolder> TAttrMap;
+  TAttrMap myAttrMap;
+
+  TAttrHolder 
   _FindGenAttribute(const Handle(TDF_Attribute)& theAttr);
 
-  SALOMEDS_GenericAttribute_i* 
+  TAttrHolder 
   _CreateGenAttribute(const Handle(TDF_Attribute)& theAttr,
                      const char* theTypeOfAttribute);
 
-  SALOMEDS_GenericAttribute_i* 
+  TAttrHolder 
   _FindGenAttribute(const char* theTypeOfAttribute);
 
-  SALOMEDS::GenericAttribute_ptr 
-  _FindCORBAAttribute(const char* theTypeOfAttribute);
-
   Handle(TDF_Attribute) 
     _AddAttribute(const char* theTypeOfAttribute);
 
@@ -122,11 +142,6 @@ protected:
   std::string _name;
   TDF_Label _lab;
 
-  typedef std::string TAttributeID;
-  typedef SALOMEDS_GenericAttribute_i* TAttrHolder;
-  typedef std::map<TAttributeID,TAttrHolder> TAttrMap;
-  TAttrMap myAttrMap;
-
   SALOMEDS_SObject_i(SALOMEDS_Study_i* theStudy, 
                     const TDF_Label& theLabel);