Back to index

salome-kernel  6.5.0
SALOMEDSImpl_Attributes.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : SALOMEDSImpl_Attributes.hxx
00024 //  Author : Sergey RUIN
00025 //  Module : SALOME
00026 //
00027 #ifndef __SALOMEDSIMPL_ATTRIBUTES__H__
00028 #define __SALOMEDSIMPL_ATTRIBUTES__H__
00029 
00030 #include "SALOMEDSImpl_Defines.hxx"
00031 
00032 #include <iostream>
00033 class SALOMEDSIMPL_EXPORT LockProtection
00034 {
00035 public :
00036   LockProtection(const char *message) {
00037     std::cerr << message << std::endl;
00038   }
00039 }; 
00040 
00041 #include "SALOMEDSImpl_GenericAttribute.hxx"
00042 #include "SALOMEDSImpl_AttributeName.hxx"
00043 #include "SALOMEDSImpl_AttributeComment.hxx"
00044 #include "SALOMEDSImpl_AttributeInteger.hxx"
00045 #include "SALOMEDSImpl_AttributeReal.hxx"
00046 #include "SALOMEDSImpl_AttributeTreeNode.hxx"
00047 #include "SALOMEDSImpl_AttributeUserID.hxx"
00048 #include "SALOMEDSImpl_AttributeReference.hxx"
00049 #include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
00050 #include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx" 
00051 #include "SALOMEDSImpl_AttributeIOR.hxx"
00052 #include "SALOMEDSImpl_AttributePersistentRef.hxx" 
00053 #include "SALOMEDSImpl_AttributeDrawable.hxx"
00054 #include "SALOMEDSImpl_AttributeSelectable.hxx"
00055 #include "SALOMEDSImpl_AttributeExpandable.hxx"
00056 #include "SALOMEDSImpl_AttributeOpened.hxx"
00057 #include "SALOMEDSImpl_AttributeTextColor.hxx"
00058 #include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
00059 #include "SALOMEDSImpl_AttributePixMap.hxx"
00060 #include "SALOMEDSImpl_AttributeLocalID.hxx"
00061 #include "SALOMEDSImpl_AttributeTarget.hxx"
00062 #include "SALOMEDSImpl_AttributeTableOfInteger.hxx"
00063 #include "SALOMEDSImpl_AttributeTableOfReal.hxx"
00064 #include "SALOMEDSImpl_AttributeTableOfString.hxx"
00065 #include "SALOMEDSImpl_AttributeStudyProperties.hxx"
00066 #include "SALOMEDSImpl_AttributePythonObject.hxx"
00067 #include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
00068 #include "SALOMEDSImpl_AttributeFileType.hxx"
00069 #include "SALOMEDSImpl_AttributeFlags.hxx"
00070 #include "SALOMEDSImpl_AttributeGraphic.hxx"
00071 #include "SALOMEDSImpl_AttributeParameter.hxx"
00072 #include "SALOMEDSImpl_AttributeString.hxx"
00073 
00074 
00075 #define __AttributeTypeToGUIDForSObject \
00076         if(theType == "AttributeReal") return SALOMEDSImpl_AttributeReal::GetID(); \
00077         if(theType == "AttributeInteger") return SALOMEDSImpl_AttributeInteger::GetID(); \
00078         if(theType == "AttributeSequenceOfReal") return SALOMEDSImpl_AttributeSequenceOfReal::GetID(); \
00079         if(theType == "AttributeSequenceOfInteger") return SALOMEDSImpl_AttributeSequenceOfInteger::GetID(); \
00080         if(theType == "AttributeName") return SALOMEDSImpl_AttributeName::GetID(); \
00081         if(theType == "AttributeComment") return SALOMEDSImpl_AttributeComment::GetID(); \
00082         if(theType == "AttributeIOR") return SALOMEDSImpl_AttributeIOR::GetID(); \
00083         if(theType == "AttributePersistentRef") return SALOMEDSImpl_AttributePersistentRef::GetID(); \
00084         if(theType == "AttributeDrawable") return SALOMEDSImpl_AttributeDrawable::GetID(); \
00085         if(theType == "AttributeSelectable") return SALOMEDSImpl_AttributeSelectable::GetID(); \
00086         if(theType == "AttributeExpandable") return SALOMEDSImpl_AttributeExpandable::GetID(); \
00087         if(theType == "AttributeOpened") return SALOMEDSImpl_AttributeOpened::GetID(); \
00088         if(theType == "AttributeTextColor") return SALOMEDSImpl_AttributeTextColor::GetID(); \
00089         if(theType == "AttributeTextHighlightColor") return SALOMEDSImpl_AttributeTextHighlightColor::GetID(); \
00090         if(theType == "AttributePixMap") return SALOMEDSImpl_AttributePixMap::GetID(); \
00091         if(theType == "AttributeLocalID") return SALOMEDSImpl_AttributeLocalID::GetID(); \
00092         if(theType == "AttributeTarget") return SALOMEDSImpl_AttributeTarget::GetID(); \
00093         if(theType == "AttributeTableOfInteger") return SALOMEDSImpl_AttributeTableOfInteger::GetID(); \
00094         if(theType == "AttributeTableOfReal") return SALOMEDSImpl_AttributeTableOfReal::GetID();  \
00095         if(theType == "AttributeTableOfString") return SALOMEDSImpl_AttributeTableOfString::GetID(); \
00096         if(theType == "AttributeStudyProperties") return SALOMEDSImpl_AttributeStudyProperties::GetID(); \
00097         if(theType == "AttributePythonObject") return SALOMEDSImpl_AttributePythonObject::GetID(); \
00098         if(theType == "AttributeUserID") return std::string("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); \
00099         if(theType == "AttributeExternalFileDef") return SALOMEDSImpl_AttributeExternalFileDef::GetID(); \
00100         if(theType == "AttributeFileType") return SALOMEDSImpl_AttributeFileType::GetID(); \
00101         if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \
00102         if(theType == "AttributeGraphic") return SALOMEDSImpl_AttributeGraphic::GetID(); \
00103         if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); \
00104         if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID(); \
00105         if(theType == "AttributeString") return SALOMEDSImpl_AttributeString::GetID();
00106 
00107 
00108 #define __FindOrCreateAttributeLocked(ClassName) if (strcmp(aTypeOfAttribute.c_str(), #ClassName) == 0) { \
00109     SALOMEDSImpl_##ClassName* anAttr; \
00110     if (!(anAttr=(SALOMEDSImpl_##ClassName*)Lab.FindAttribute(SALOMEDSImpl_##ClassName::GetID()))) { \
00111       CheckLocked(); \
00112       anAttr = new SALOMEDSImpl_##ClassName; \
00113       Lab.AddAttribute(anAttr); \
00114     } \
00115     return anAttr; \
00116   }   
00117 
00118 #define __FindOrCreateAttribute(ClassName) if (strcmp(aTypeOfAttribute.c_str(), #ClassName) == 0) { \
00119     SALOMEDSImpl_##ClassName* anAttr; \
00120     if (!(anAttr=(SALOMEDSImpl_##ClassName*)Lab.FindAttribute(SALOMEDSImpl_##ClassName::GetID()))) { \
00121       anAttr = new SALOMEDSImpl_##ClassName; \
00122       Lab.AddAttribute(anAttr); \
00123     } \
00124     return anAttr; \
00125   }      
00126 
00127 #define __FindOrCreateAttributeForBuilder \
00128 __FindOrCreateAttributeLocked(AttributeReal) \
00129 __FindOrCreateAttributeLocked(AttributeInteger) \
00130 __FindOrCreateAttributeLocked(AttributeSequenceOfReal) \
00131 __FindOrCreateAttributeLocked(AttributeSequenceOfInteger) \
00132 __FindOrCreateAttributeLocked(AttributeName) \
00133 __FindOrCreateAttributeLocked(AttributeComment) \
00134 __FindOrCreateAttributeLocked(AttributeIOR) \
00135 __FindOrCreateAttributeLocked(AttributePixMap) \
00136 __FindOrCreateAttributeLocked(AttributeLocalID) \
00137 __FindOrCreateAttributeLocked(AttributeTableOfInteger) \
00138 __FindOrCreateAttributeLocked(AttributeTableOfReal) \
00139 __FindOrCreateAttributeLocked(AttributeTableOfString) \
00140 __FindOrCreateAttributeLocked(AttributePythonObject) \
00141 __FindOrCreateAttributeLocked(AttributeParameter) \
00142 __FindOrCreateAttributeLocked(AttributeString) \
00143 __FindOrCreateAttribute(AttributePersistentRef) \
00144 __FindOrCreateAttribute(AttributeDrawable) \
00145 __FindOrCreateAttribute(AttributeSelectable) \
00146 __FindOrCreateAttribute(AttributeExpandable) \
00147 __FindOrCreateAttribute(AttributeOpened) \
00148 __FindOrCreateAttribute(AttributeTextColor) \
00149 __FindOrCreateAttribute(AttributeTextHighlightColor) \
00150 __FindOrCreateAttribute(AttributeTarget) \
00151 __FindOrCreateAttribute(AttributeStudyProperties) \
00152 __FindOrCreateAttribute(AttributeExternalFileDef) \
00153 __FindOrCreateAttribute(AttributeFileType) \
00154 __FindOrCreateAttribute(AttributeFlags) \
00155 __FindOrCreateAttribute(AttributeGraphic)
00156 
00157 
00158 #endif