![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2009 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtSchemaParameter.h,v $ $Revision: 1.10 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00010 00011 #ifndef DtSchemaParameter_H_ 00012 #define DtSchemaParameter_H_ 00013 00014 #include <makArchives/makArchives.h> 00015 00016 #include <string> 00017 #include <vector> 00018 00019 namespace makArchives 00020 { 00024 class DT_DLL_MAKARCHIVES DtSchemaParameter 00025 { 00026 public: 00027 00030 enum ParameterType 00031 { 00032 Enumeration = 0, //The string value must be one of a list of possible values. 00033 FileName = 1, //The string must be a filename. 00034 FloatingPoint = 2, //The string must be a floating point number. 00035 Integer = 3, //The string must be an integer. 00036 Any = 4, //Any string is allowed. 00037 StringVector = 5, //A comma delimited list of strings 00038 String = 6,//Item is a string 00039 Boolean = 7, //Boolean 00040 Vector = 8, //x, y, z 00041 Double = 9, 00042 Color = 10, //r, g, b, a where each component is 0-1 00043 FontGlyph = 11, // A Glyph 00044 SymbolSelector = 12, // A mapping between an integer and a model definition 00045 }; 00046 00048 DtSchemaParameter(); 00049 00051 DtSchemaParameter(const DtSchemaParameter&); 00052 00054 virtual ~DtSchemaParameter(); 00055 00057 virtual DtSchemaParameter& operator=(const DtSchemaParameter&); 00058 00059 public: 00061 00062 void setName(const std::string& name) 00063 { 00064 myName = name; 00065 } 00066 00067 const std::string& name() const 00068 { 00069 return myName; 00070 } 00071 00072 void setRequired(bool b) 00073 { 00074 myRequiredFlag = b; 00075 } 00076 00077 bool required() const 00078 { 00079 return myRequiredFlag; 00080 } 00081 00082 void setEnumerationValues(const std::vector<std::string>& val) 00083 { 00084 myEnumerationValues = val; 00085 } 00086 00087 const std::vector<std::string>& enumerationValues() const 00088 { 00089 return myEnumerationValues; 00090 } 00091 00092 void setDescription(const std::string& d) 00093 { 00094 myDescription = d; 00095 } 00096 00097 const std::string& description() const 00098 { 00099 return myDescription; 00100 } 00101 00102 void setType(ParameterType t) 00103 { 00104 myType = t; 00105 } 00106 00107 ParameterType type() const 00108 { 00109 return myType; 00110 } 00112 00113 protected: 00114 00115 friend class boost::serialization::access; 00116 00120 00121 template <typename Archive> 00122 void serialize(Archive& ar,unsigned int version) 00123 { 00124 ar & BOOST_SERIALIZATION_NVP(myName); 00125 ar & BOOST_SERIALIZATION_NVP(myType); 00126 ar & BOOST_SERIALIZATION_NVP(myRequiredFlag); 00127 ar & BOOST_SERIALIZATION_NVP(myEnumerationValues); 00128 00129 if (version >= 2) 00130 { 00131 ar & BOOST_SERIALIZATION_NVP(myDescription); 00132 } 00133 } 00134 00135 protected: 00136 std::string myName; 00137 ParameterType myType; 00138 bool myRequiredFlag; 00139 std::vector<std::string> myEnumerationValues; 00140 std::string myDescription; 00141 }; 00142 }; 00143 00144 BOOST_CLASS_VERSION(makArchives::DtSchemaParameter, 2) 00145 00146 #endif 00147