1 // File : SALOMEDS_SComponent_i.cxx
2 // Author : Sergey RUIN
6 #include "SALOMEDS_SComponent_i.hxx"
7 #include "SALOMEDS.hxx"
13 SALOMEDS::SComponent_ptr SALOMEDS_SComponent_i::New(const Handle(SALOMEDSImpl_SComponent)& theImpl, CORBA::ORB_ptr theORB)
16 static std::map<SALOMEDSImpl_SComponent*, SALOMEDS_SComponent_i*> _mapOfSCO;
17 SALOMEDS::SComponent_var sco;
18 SALOMEDS_SComponent_i* sco_servant = NULL;
20 if(_mapOfSCO.find(theImpl.operator->()) != _mapOfSCO.end()) {
21 sco_servant = _mapOfSCO[theImpl.operator->()];
24 sco_servant = new SALOMEDS_SComponent_i(theImpl, theORB);
25 _mapOfSCO[theImpl.operator->()] = sco_servant;
28 sco = SALOMEDS::SComponent::_narrow(sco_servant->SComponent::_this());
30 SALOMEDS_SComponent_i* sco_servant = new SALOMEDS_SComponent_i(theImpl, theORB);
31 SALOMEDS::SComponent_var sco = SALOMEDS::SComponent::_narrow(sco_servant->SComponent::_this());
36 //============================================================================
37 /*! Function : constructor
40 //============================================================================
41 SALOMEDS_SComponent_i::SALOMEDS_SComponent_i(const Handle(SALOMEDSImpl_SComponent)& theImpl, CORBA::ORB_ptr orb)
42 :SALOMEDS_SObject_i(theImpl, orb)
45 //============================================================================
46 /*! Function : destructor
49 //============================================================================
50 SALOMEDS_SComponent_i::~SALOMEDS_SComponent_i()
53 //============================================================================
54 /*! Function : ComponentDataType
57 //============================================================================
58 char* SALOMEDS_SComponent_i::ComponentDataType()
60 SALOMEDS::Locker lock;
61 TCollection_AsciiString aType = Handle(SALOMEDSImpl_SComponent)::DownCast(_impl)->ComponentDataType();
62 return CORBA::string_dup(aType.ToCString());
66 //============================================================================
67 /*! Function : ComponentIOR
70 //============================================================================
71 CORBA::Boolean SALOMEDS_SComponent_i::ComponentIOR(CORBA::String_out IOR)
73 SALOMEDS::Locker lock;
74 TCollection_AsciiString ior;
75 if(!Handle(SALOMEDSImpl_SComponent)::DownCast(_impl)->ComponentIOR(ior)) {
76 IOR = CORBA::string_dup("");
79 IOR = CORBA::string_dup(ior.ToCString());