VR-Vantage API Documentation
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 
62  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 
102  void setType(ParameterType t)
103  {
104  myType = t;
105  }
106 
107  ParameterType type() const
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 


Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)