Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeExpandable.hxx
1 //  File   : SALOMEDSImpl_AttributeExpandable.hxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5 #ifndef _SALOMEDSImpl_AttributeExpandable_HeaderFile
6 #define _SALOMEDSImpl_AttributeExpandable_HeaderFile
7
8 #include <Standard_DefineHandle.hxx>
9 #include <TDF_Attribute.hxx>
10 #include <TDF_Label.hxx>       
11 #include <TCollection_AsciiString.hxx> 
12 #include <Standard_GUID.hxx>
13 #include "SALOMEDSImpl_GenericAttribute.hxx"
14
15 class Handle(TDF_Attribute);
16 class Handle(TDF_RelocationTable);
17
18
19 DEFINE_STANDARD_HANDLE( SALOMEDSImpl_AttributeExpandable, SALOMEDSImpl_GenericAttribute )
20
21
22 class SALOMEDSImpl_AttributeExpandable : public SALOMEDSImpl_GenericAttribute 
23 {
24 private:
25 Standard_Integer myValue;
26
27 public:
28
29 Standard_EXPORT virtual TCollection_AsciiString Save() { return (myValue == 0)?(char*)"0":(char*)"1"; }
30 Standard_EXPORT virtual void Load(const TCollection_AsciiString& theValue) { (theValue == "0")?myValue=0:myValue=1; } 
31
32 Standard_EXPORT static const Standard_GUID& GetID() ;
33 Standard_EXPORT static  Handle_SALOMEDSImpl_AttributeExpandable Set(const TDF_Label& label,const Standard_Integer value) ;
34 Standard_EXPORT SALOMEDSImpl_AttributeExpandable();
35 Standard_EXPORT void SetExpandable(const Standard_Integer value); 
36 Standard_EXPORT int IsExpandable() const { return myValue; }
37 Standard_EXPORT  const Standard_GUID& ID() const;
38 Standard_EXPORT   void Restore(const Handle(TDF_Attribute)& with) ;
39 Standard_EXPORT   Handle_TDF_Attribute NewEmpty() const;
40 Standard_EXPORT   void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const;
41 Standard_EXPORT ~SALOMEDSImpl_AttributeExpandable() {}
42
43 public:
44   DEFINE_STANDARD_RTTI( SALOMEDSImpl_AttributeExpandable )
45 };
46
47 #endif