Salome HOME
Copyrights update
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_SObject.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/
19 //
20 //  File   : SALOMEDS_SObject.hxx
21 //  Author : Sergey RUIN
22 //  Module : SALOME
23
24 #ifndef __SALOMEDS_SOBJECT_H__
25 #define __SALOMEDS_SOBJECT_H__
26
27 // std C++ headers
28 #include <vector>
29
30 #include <SALOMEDSClient.hxx>
31
32 // IDL headers
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SALOMEDS)
35
36 #include "SALOMEDS_SObject_i.hxx"
37 #include "SALOMEDSImpl_SObject.hxx"
38
39 class Standard_EXPORT SALOMEDS_SObject: public virtual SALOMEDSClient_SObject
40 {
41 protected:
42
43   bool                         _isLocal;
44   Handle(SALOMEDSImpl_SObject) _local_impl;
45   SALOMEDS::SObject_var        _corba_impl;
46   CORBA::ORB_var               _orb;
47
48 public:
49   
50   SALOMEDS_SObject(SALOMEDS::SObject_ptr theSObject);
51   SALOMEDS_SObject(const Handle(SALOMEDSImpl_SObject)& theSObject);       
52   virtual ~SALOMEDS_SObject();
53
54   virtual std::string GetID();
55   virtual _PTR(SComponent) GetFatherComponent();
56   virtual _PTR(SObject)    GetFather();
57   virtual bool FindAttribute(_PTR(GenericAttribute)& anAttribute, const std::string& aTypeOfAttribute);
58   virtual bool ReferencedObject(_PTR(SObject)& theObject);
59   virtual bool FindSubObject(int theTag, _PTR(SObject)& theObject);
60   virtual _PTR(Study) GetStudy();
61   virtual std::string Name();
62   virtual void  Name(const std::string& theName);
63   virtual vector<_PTR(GenericAttribute)> GetAllAttributes();
64   virtual std::string GetName();
65   virtual std::string GetComment();
66   virtual std::string GetIOR();
67   virtual int   Tag();
68   virtual int   Depth();
69
70   CORBA::Object_ptr GetObject();
71   SALOMEDS::SObject_ptr GetSObject();
72
73   SALOMEDS::SObject_ptr        GetCORBAImpl() { return SALOMEDS::SObject::_duplicate(_corba_impl); }
74   Handle(SALOMEDSImpl_SObject) GetLocalImpl() { return _local_impl; } 
75
76 private:
77   void init_orb();
78 };
79
80 #endif