ADTF  3.18.2
ddlenum.h
Go to the documentation of this file.
1 
7 #ifndef _DDLCONSTANT_H_INCLUDED_
8 #define _DDLCONSTANT_H_INCLUDED_
9 
10 namespace adtf_ddl
11 {
15  typedef std::vector<std::pair<A_UTILS_NS::cString, A_UTILS_NS::cString> > tEnumNameValueVec;
19  class cDDLEnum : public IDDLDataType
20  {
21  public:
26 
35  const A_UTILS_NS::cString& strName,
36  const tEnumNameValueVec& vecNameValues,
37  IDDLUnit* poUnit = NULL);
38 
48  const A_UTILS_NS::cString& strName,
49  const tEnumNameValueVec& vecNameValues,
50  IDDLUnit* poUnit = NULL,
51  int nCreationLevel = 1);
52 
57  cDDLEnum(cDDLEnum &oEnum);
58 
62  virtual ~cDDLEnum();
63 
64  tResult Accept(IDDLVisitor *poVisitor);
65 
66  bool IsPredefined() const;
67  bool IsOverwriteable() const;
68 
69  const A_UTILS_NS::cString& GetName() const;
70 
77  void SetName(const A_UTILS_NS::cString& strName);
78 
84  const tEnumNameValueVec& GetValues() const;
85 
93  void SetValues(const tEnumNameValueVec& vecValues);
94 
103  tResult GetValue(const A_UTILS_NS::cString& strElement, A_UTILS_NS::cString& strValue) const;
104 
113  tResult SetValue(const A_UTILS_NS::cString& strElement, const A_UTILS_NS::cString& strValue);
114 
124 
125 
130  const A_UTILS_NS::cString& GetType() const;
131 
139  void SetType(IDDLDataType* const pType);
140 
146 
147  int GetCreationLevel() const;
148 
149  bool IsInitialized() const;
150 
161  const A_UTILS_NS::cString& strName,
162  const tEnumNameValueVec& vecNameValues,
163  IDDLUnit* poUnit = NULL);
164 
176  const A_UTILS_NS::cString& strName,
177  const tEnumNameValueVec& vecNameValues,
178  IDDLUnit* poUnit = NULL,
179  int nCreationLevel = 1);
180 
181 
182 
189  void SetUnit(IDDLUnit* poUnit);
190 
196 
202 
210 
211  private:
212  A_UTILS_NS::cString m_strName;
213  tEnumNameValueVec m_vecNameValues;
214  IDDLUnit *m_poUnit;
215  IDDLDataType * m_poType;
216 
217 
218  bool m_bInitFlag;
219  int m_nLevel;
220 
221  };
222 
223 } // namespace adtf_ddl
224 
225 #endif // _DDLCONSTANT_H_INCLUDED_
Common interface for DDL datatypes.
Interface for unit classes of the object representation for DDL descriptions.
Definition: ddlunit_intf.h:17
Abstract base class/interface for Visitor design-pattern.
Representation for an enum inside a DDL description.
Definition: ddlenum.h:20
const A_UTILS_NS::cString & GetName() const
Getter for the name of the representation object.
cDDLEnum(cDDLEnum &oEnum)
Copy CTOR.
A_UTILS_NS::cString GetUnit() const
Getter for the unit name.
const tEnumNameValueVec & GetValues() const
Getter for the Container type of DDL enum elements.
void SetValues(const tEnumNameValueVec &vecValues)
Setter for the DDL enum elements.
void SetUnit(IDDLUnit *poUnit)
Setter for the unit.
bool IsInitialized() const
Getter for the initialization flag.
virtual ~cDDLEnum()
DTOR.
tResult RemoveElement(const A_UTILS_NS::cString &strElement)
Remove the element with the provided name.
int GetCreationLevel() const
Getter for the creation level.
void SetType(IDDLDataType *const pType)
Setter for the data-type object.
tResult Create(IDDLDataType *poType, const A_UTILS_NS::cString &strName, const tEnumNameValueVec &vecNameValues, IDDLUnit *poUnit=NULL)
Creation method to fill the object with data.
IDDLUnit * GetUnitObject() const
Getter for the unit object.
bool IsPredefined() const
Getter for the predefinition flag.
tResult SetValue(const A_UTILS_NS::cString &strElement, const A_UTILS_NS::cString &strValue)
Setter for the value of the element.
cDDLEnum(IDDLDataType *poType, const A_UTILS_NS::cString &strName, const tEnumNameValueVec &vecNameValues, IDDLUnit *poUnit=NULL, int nCreationLevel=1)
CTOR.
IDDLDataType * GetTypeObject() const
Getter for the data-type object.
tResult Accept(IDDLVisitor *poVisitor)
Acceptance method for Visitor design-pattern.
cDDLEnum(IDDLDataType *poType, const A_UTILS_NS::cString &strName, const tEnumNameValueVec &vecNameValues, IDDLUnit *poUnit=NULL)
CTOR.
void SetName(const A_UTILS_NS::cString &strName)
Setter for the name of the element.
const A_UTILS_NS::cString & GetType() const
Getter for the data-type name.
bool IsOverwriteable() const
Getter for the predefinition flag.
cDDLEnum()
Default CTOR.
tResult GetValue(const A_UTILS_NS::cString &strElement, A_UTILS_NS::cString &strValue) const
Getter for the value of the element.
tResult GetNameForValue(const A_UTILS_NS::cString &strValue, A_UTILS_NS::cString &strElement)
Getter for the name of the element.
tResult Create(IDDLDataType *poType, const A_UTILS_NS::cString &strName, const tEnumNameValueVec &vecNameValues, IDDLUnit *poUnit=NULL, int nCreationLevel=1)
Creation method to fill the object with data.
Namespace for the mainpage_pkg_ddl.
std::vector< std::pair< A_UTILS_NS::cString, A_UTILS_NS::cString > > tEnumNameValueVec
Container type of DDL enum elements.
Definition: ddlenum.h:15