VR-Forces 4.8 Class Documentation
 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 /******************************************************************************
6 ** $RCSfile: DtSchemaParameter.h,v $ $Revision: 1.10 $ $State: Exp $
7 ******************************************************************************/
8 
10 
11 #ifndef DtSchemaParameter_H_
12 #define DtSchemaParameter_H_
13 
15 
16 #include <string>
17 #include <vector>
18 
19 namespace makArchives
20 {
25  {
26  public:
27 
31  {
32  Enumeration = 0, //The string value must be one of a list of possible values.
33  FileName = 1, //The string must be a filename.
34  FloatingPoint = 2, //The string must be a floating point number.
35  Integer = 3, //The string must be an integer.
36  Any = 4, //Any string is allowed.
37  StringVector = 5, //A comma delimited list of strings
38  String = 6,//Item is a string
39  Boolean = 7, //Boolean
40  Vector = 8, //x, y, z
41  Double = 9,
42  Color = 10, //r, g, b, a where each component is 0-1
43  FontGlyph = 11, // A Glyph
44  SymbolSelector = 12, // A mapping between an integer and a model definition
45  };
46 
49 
52 
54  virtual ~DtSchemaParameter();
55 
57  virtual DtSchemaParameter& operator=(const DtSchemaParameter&);
58 
59  public:
61  void setName(const std::string& name)
63  {
64  myName = name;
65  }
66 
67  const std::string& name() const
68  {
69  return myName;
70  }
71 
72  void setRequired(bool b)
73  {
74  myRequiredFlag = b;
75  }
76 
77  bool required() const
78  {
79  return myRequiredFlag;
80  }
81 
82  void setEnumerationValues(const std::vector<std::string>& val)
83  {
84  myEnumerationValues = val;
85  }
86 
87  const std::vector<std::string>& enumerationValues() const
88  {
89  return myEnumerationValues;
90  }
91 
92  void setDescription(const std::string& d)
93  {
94  myDescription = d;
95  }
96 
97  const std::string& description() const
98  {
99  return myDescription;
100  }
101 
103  {
104  myType = t;
105  }
106 
108  {
109  return myType;
110  }
112 
113  protected:
114 
115  friend class boost::serialization::access;
116 
120 
121  template <typename Archive>
122  void serialize(Archive& ar,unsigned int version)
123  {
124  ar & BOOST_SERIALIZATION_NVP(myName);
125  ar & BOOST_SERIALIZATION_NVP(myType);
126  ar & BOOST_SERIALIZATION_NVP(myRequiredFlag);
127  ar & BOOST_SERIALIZATION_NVP(myEnumerationValues);
128 
129  if (version >= 2)
130  {
131  ar & BOOST_SERIALIZATION_NVP(myDescription);
132  }
133  }
134 
135  protected:
136  std::string myName;
139  std::vector<std::string> myEnumerationValues;
140  std::string myDescription;
141  };
142 };
143 
145 
146 #endif
147 
void setDescription(const std::string &d)
Definition: DtSchemaParameter.h:92
void setRequired(bool b)
Definition: DtSchemaParameter.h:72
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:122
const std::vector< std::string > & enumerationValues() const
Definition: DtSchemaParameter.h:87
Contains DLL export macros.
BOOST_CLASS_VERSION(makArchives::DtDiGuySettingsRecord, 2)
ParameterType myType
Definition: DtSchemaParameter.h:137
The makArchives::DtSchemaParameter contains a parameter that will be used as part of a schema entry d...
Definition: DtSchemaParameter.h:24
void setEnumerationValues(const std::vector< std::string > &val)
Definition: DtSchemaParameter.h:82
std::vector< std::string > myEnumerationValues
Definition: DtSchemaParameter.h:139
std::string myDescription
Definition: DtSchemaParameter.h:140
std::vector< std::string > StringVector
Definition: DtCommonTypes.h:18
ParameterType type() const
Definition: DtSchemaParameter.h:107
void setType(ParameterType t)
Definition: DtSchemaParameter.h:102
ParameterType
Enumeration of possible parameter types This type is used to encode/decode as strings.
Definition: DtSchemaParameter.h:30
const std::string & name() const
Definition: DtSchemaParameter.h:67
std::string myName
Definition: DtSchemaParameter.h:136
bool myRequiredFlag
Definition: DtSchemaParameter.h:138
bool required() const
Definition: DtSchemaParameter.h:77
#define DT_DLL_MAKARCHIVES
Definition: makArchives.h:31
const std::string & description() const
Definition: DtSchemaParameter.h:97

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)