Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/yacs.git] / src / SALOMEDS / SALOMEDS_AttributeUserID.cxx
1 //  File   : SALOMEDS_AttributeUserID.cxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5 #include "SALOMEDS_AttributeUserID.hxx"
6
7 #include <string>
8 #include <TCollection_AsciiString.hxx> 
9 #include <TCollection_ExtendedString.hxx>
10 #include <Standard_GUID.hxx>
11
12 SALOMEDS_AttributeUserID::SALOMEDS_AttributeUserID(const Handle(SALOMEDSImpl_AttributeUserID)& theAttr)
13 :SALOMEDS_GenericAttribute(theAttr)
14 {}
15
16 SALOMEDS_AttributeUserID::SALOMEDS_AttributeUserID(SALOMEDS::AttributeUserID_ptr theAttr)
17 :SALOMEDS_GenericAttribute(theAttr)
18 {}
19
20 SALOMEDS_AttributeUserID::~SALOMEDS_AttributeUserID()
21 {}
22
23 std::string SALOMEDS_AttributeUserID::Value()
24 {
25   std::string aValue;
26   if(_isLocal) {
27     char guid[40];
28     Handle(SALOMEDSImpl_AttributeUserID)::DownCast(_local_impl)->Value().ToCString(guid);
29     aValue = std::string(guid);
30   }
31   else aValue = SALOMEDS::AttributeUserID::_narrow(_corba_impl)->Value();
32   return aValue;
33 }
34  
35 void SALOMEDS_AttributeUserID::SetValue(const std::string& value)
36 {
37   CheckLocked();
38   if(_isLocal) Handle(SALOMEDSImpl_AttributeUserID)::DownCast(_local_impl)->SetValue(Standard_GUID((char*)value.c_str()));
39   else SALOMEDS::AttributeUserID::_narrow(_corba_impl)->SetValue(value.c_str());
40 }