VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSchemaParameter.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
7 
8 #ifndef DtSchemaParameter_H_
9 #define DtSchemaParameter_H_
10 
12 
13 #include <string>
14 #include <vector>
15 
16 namespace makArchives
17 {
22  {
23  public:
24 
28  {
29  Enumeration = 0, //The string value must be one of a list of possible values.
30  FileName = 1, //The string must be a filename.
31  FloatingPoint = 2, //The string must be a floating point number.
32  Integer = 3, //The string must be an integer.
33  Any = 4, //Any string is allowed.
34  StringVector = 5, //A comma delimited list of strings
35  String = 6,//Item is a string
36  Boolean = 7, //Boolean
37  Vector = 8, //x, y, z
38  Double = 9,
39  Color = 10, //r, g, b, a where each component is 0-1
40  FontGlyph = 11, // A Glyph
41  SymbolSelector = 12, // A mapping between an integer and a model definition
42  };
43 
46 
49 
51  virtual ~DtSchemaParameter();
52 
54  virtual DtSchemaParameter& operator=(const DtSchemaParameter&);
55 
56  public:
58  void setName(const std::string& name)
60  {
61  myName = name;
62  }
63 
64  const std::string& name() const
65  {
66  return myName;
67  }
68 
69  void setRequired(bool b)
70  {
71  myRequiredFlag = b;
72  }
73 
74  bool required() const
75  {
76  return myRequiredFlag;
77  }
78 
79  void setEnumerationValues(const std::vector<std::string>& val)
80  {
81  myEnumerationValues = val;
82  }
83 
84  const std::vector<std::string>& enumerationValues() const
85  {
86  return myEnumerationValues;
87  }
88 
89  void setDescription(const std::string& d)
90  {
91  myDescription = d;
92  }
93 
94  const std::string& description() const
95  {
96  return myDescription;
97  }
98 
100  {
101  myType = t;
102  }
103 
105  {
106  return myType;
107  }
109 
110  protected:
111 
112  friend class boost::serialization::access;
113 
117 
118  template <typename Archive>
119  void serialize(Archive& ar,unsigned int version)
120  {
121  ar & BOOST_SERIALIZATION_NVP(myName);
122  ar & BOOST_SERIALIZATION_NVP(myType);
123  ar & BOOST_SERIALIZATION_NVP(myRequiredFlag);
124  ar & BOOST_SERIALIZATION_NVP(myEnumerationValues);
125 
126  if (version >= 2)
127  {
128  ar & BOOST_SERIALIZATION_NVP(myDescription);
129  }
130  }
131 
132  protected:
133  std::string myName;
136  std::vector<std::string> myEnumerationValues;
137  std::string myDescription;
138  };
139 };
140 
142 
143 #endif
144 
void setDescription(const std::string &d)
Accessors.
Definition: DtSchemaParameter.h:89
void setRequired(bool b)
Accessors.
Definition: DtSchemaParameter.h:69
BOOST_CLASS_VERSION(makArchives::DtDiGuySettingsRecord, 3)
void serialize(Archive &ar, unsigned int version)
When the class Archive corresponds to an output archive, the &amp; operator is defined similar to &lt;&lt;...
Definition: DtSchemaParameter.h:119
const std::vector< std::string > & enumerationValues() const
Accessors.
Definition: DtSchemaParameter.h:84
Contains DLL export macros.
ParameterType myType
Definition: DtSchemaParameter.h:134
The makArchives::DtSchemaParameter contains a parameter that will be used as part of a schema entry d...
Definition: DtSchemaParameter.h:21
void setEnumerationValues(const std::vector< std::string > &val)
Accessors.
Definition: DtSchemaParameter.h:79
std::vector< std::string > myEnumerationValues
Definition: DtSchemaParameter.h:136
std::string myDescription
Definition: DtSchemaParameter.h:137
std::vector< std::string > StringVector
Definition: DtCommonTypes.h:18
ParameterType type() const
Accessors.
Definition: DtSchemaParameter.h:104
void setType(ParameterType t)
Accessors.
Definition: DtSchemaParameter.h:99
ParameterType
Enumeration of possible parameter types This type is used to encode/decode as strings.
Definition: DtSchemaParameter.h:27
const std::string & name() const
Accessors.
Definition: DtSchemaParameter.h:64
std::string myName
Definition: DtSchemaParameter.h:133
bool myRequiredFlag
Definition: DtSchemaParameter.h:135
bool required() const
Accessors.
Definition: DtSchemaParameter.h:74
#define DT_DLL_MAKARCHIVES
Definition: makArchives.h:31
const std::string & description() const
Accessors.
Definition: DtSchemaParameter.h:94

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)