]> SALOME platform Git repositories - modules/yacs.git/blob - src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx
Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/yacs.git] / src / SALOMEDSImpl / SALOMEDSImpl_Attributes.hxx
1 //  File   : SALOMEDSImpl_Attributes.hxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5 #ifndef __SALOMEDSIMPL_ATTRIBUTES__H__
6 #define __SALOMEDSIMPL_ATTRIBUTES__H__
7
8 #include <iostream>
9 class LockProtection
10 {
11 public :
12   LockProtection(const char *message) {
13     std::cerr << message << std::endl;
14   }
15 }; 
16
17 #include "SALOMEDSImpl_GenericAttribute.hxx"
18 #include "SALOMEDSImpl_AttributeName.hxx"
19 #include "SALOMEDSImpl_AttributeComment.hxx"
20 #include "SALOMEDSImpl_AttributeInteger.hxx"
21 #include "SALOMEDSImpl_AttributeReal.hxx"
22 #include "SALOMEDSImpl_AttributeTreeNode.hxx"
23 #include "SALOMEDSImpl_AttributeUserID.hxx"
24 #include "SALOMEDSImpl_AttributeReference.hxx"
25 #include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
26 #include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx" 
27 #include "SALOMEDSImpl_AttributeIOR.hxx"
28 #include "SALOMEDSImpl_AttributePersistentRef.hxx" 
29 #include "SALOMEDSImpl_AttributeDrawable.hxx"
30 #include "SALOMEDSImpl_AttributeSelectable.hxx"
31 #include "SALOMEDSImpl_AttributeExpandable.hxx"
32 #include "SALOMEDSImpl_AttributeOpened.hxx"
33 #include "SALOMEDSImpl_AttributeTextColor.hxx"
34 #include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
35 #include "SALOMEDSImpl_AttributePixMap.hxx"
36 #include "SALOMEDSImpl_AttributeLocalID.hxx"
37 #include "SALOMEDSImpl_AttributeTarget.hxx"
38 #include "SALOMEDSImpl_AttributeTableOfInteger.hxx"
39 #include "SALOMEDSImpl_AttributeTableOfReal.hxx"
40 #include "SALOMEDSImpl_AttributeTableOfString.hxx"
41 #include "SALOMEDSImpl_AttributeStudyProperties.hxx"
42 #include "SALOMEDSImpl_AttributePythonObject.hxx"
43 #include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
44 #include "SALOMEDSImpl_AttributeFileType.hxx"
45 #include "SALOMEDSImpl_AttributeFlags.hxx"
46 #include "SALOMEDSImpl_AttributeGraphic.hxx"
47
48
49 #define __AttributeTypeToGUIDForSObject \
50         if(theType == "AttributeReal") return SALOMEDSImpl_AttributeReal::GetID(); \
51         if(theType == "AttributeInteger") return SALOMEDSImpl_AttributeInteger::GetID(); \
52         if(theType == "AttributeSequenceOfReal") return SALOMEDSImpl_AttributeSequenceOfReal::GetID(); \
53         if(theType == "AttributeSequenceOfInteger") return SALOMEDSImpl_AttributeSequenceOfInteger::GetID(); \
54         if(theType == "AttributeName") return SALOMEDSImpl_AttributeName::GetID(); \
55         if(theType == "AttributeComment") return SALOMEDSImpl_AttributeComment::GetID(); \
56         if(theType == "AttributeIOR") return SALOMEDSImpl_AttributeIOR::GetID(); \
57         if(theType == "AttributePersistentRef") return SALOMEDSImpl_AttributePersistentRef::GetID(); \
58         if(theType == "AttributeDrawable") return SALOMEDSImpl_AttributeDrawable::GetID(); \
59         if(theType == "AttributeSelectable") return SALOMEDSImpl_AttributeSelectable::GetID(); \
60         if(theType == "AttributeExpandable") return SALOMEDSImpl_AttributeExpandable::GetID(); \
61         if(theType == "AttributeOpened") return SALOMEDSImpl_AttributeOpened::GetID(); \
62         if(theType == "AttributeTextColor") return SALOMEDSImpl_AttributeTextColor::GetID(); \
63         if(theType == "AttributeTextHighlightColor") return SALOMEDSImpl_AttributeTextHighlightColor::GetID(); \
64         if(theType == "AttributePixMap") return SALOMEDSImpl_AttributePixMap::GetID(); \
65         if(theType == "AttributeLocalID") return SALOMEDSImpl_AttributeLocalID::GetID(); \
66         if(theType == "AttributeTarget") return SALOMEDSImpl_AttributeTarget::GetID(); \
67         if(theType == "AttributeTableOfInteger") return SALOMEDSImpl_AttributeTableOfInteger::GetID(); \
68         if(theType == "AttributeTableOfReal") return SALOMEDSImpl_AttributeTableOfReal::GetID();  \
69         if(theType == "AttributeTableOfString") return SALOMEDSImpl_AttributeTableOfString::GetID(); \
70         if(theType == "AttributeStudyProperties") return SALOMEDSImpl_AttributeStudyProperties::GetID(); \
71         if(theType == "AttributePythonObject") return SALOMEDSImpl_AttributePythonObject::GetID(); \
72         if(theType == "AttributeUserID") return Standard_GUID("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); \
73         if(theType == "AttributeExternalFileDef") return SALOMEDSImpl_AttributeExternalFileDef::GetID(); \
74         if(theType == "AttributeFileType") return SALOMEDSImpl_AttributeFileType::GetID(); \
75         if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \
76         if(theType == "AttributeGraphic") return SALOMEDSImpl_AttributeGraphic::GetID(); \
77         if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID();
78
79
80 #define __FindOrCreateAttributeLocked(ClassName) if (strcmp(aTypeOfAttribute.ToCString(), #ClassName) == 0) { \
81     Handle(SALOMEDSImpl_##ClassName) anAttr; \
82     if (!Lab.FindAttribute(SALOMEDSImpl_##ClassName::GetID(), anAttr)) { \
83       CheckLocked(); \
84       anAttr = new SALOMEDSImpl_##ClassName; \
85       Lab.AddAttribute(anAttr); \
86     } \
87     return anAttr; \
88   }   
89
90 #define __FindOrCreateAttribute(ClassName) if (strcmp(aTypeOfAttribute.ToCString(), #ClassName) == 0) { \
91     Handle(SALOMEDSImpl_##ClassName) anAttr; \
92     if (!Lab.FindAttribute(SALOMEDSImpl_##ClassName::GetID(), anAttr)) { \
93       anAttr = new SALOMEDSImpl_##ClassName; \
94       Lab.AddAttribute(anAttr); \
95     } \
96     return anAttr; \
97   }      
98
99 #define __FindOrCreateAttributeForBuilder \
100 __FindOrCreateAttributeLocked(AttributeReal) \
101 __FindOrCreateAttributeLocked(AttributeInteger) \
102 __FindOrCreateAttributeLocked(AttributeSequenceOfReal) \
103 __FindOrCreateAttributeLocked(AttributeSequenceOfInteger) \
104 __FindOrCreateAttributeLocked(AttributeName) \
105 __FindOrCreateAttributeLocked(AttributeComment) \
106 __FindOrCreateAttributeLocked(AttributeIOR) \
107 __FindOrCreateAttributeLocked(AttributePixMap) \
108 __FindOrCreateAttributeLocked(AttributeLocalID) \
109 __FindOrCreateAttributeLocked(AttributeTableOfInteger) \
110 __FindOrCreateAttributeLocked(AttributeTableOfReal) \
111 __FindOrCreateAttributeLocked(AttributeTableOfString) \
112 __FindOrCreateAttributeLocked(AttributePythonObject) \
113 __FindOrCreateAttribute(AttributePersistentRef) \
114 __FindOrCreateAttribute(AttributeDrawable) \
115 __FindOrCreateAttribute(AttributeSelectable) \
116 __FindOrCreateAttribute(AttributeExpandable) \
117 __FindOrCreateAttribute(AttributeOpened) \
118 __FindOrCreateAttribute(AttributeTextColor) \
119 __FindOrCreateAttribute(AttributeTextHighlightColor) \
120 __FindOrCreateAttribute(AttributeTarget) \
121 __FindOrCreateAttribute(AttributeStudyProperties) \
122 __FindOrCreateAttribute(AttributeExternalFileDef) \
123 __FindOrCreateAttribute(AttributeFileType) \
124 __FindOrCreateAttribute(AttributeFlags) \
125 __FindOrCreateAttribute(AttributeGraphic)
126
127
128 #endif