ADTF  3.18.2
ddlunit.h
Go to the documentation of this file.
1 
7 #ifndef _UNIT_H_INCLUDED_
8 #define _UNIT_H_INCLUDED_
9 
10 namespace adtf_ddl
11 {
12 
13  class cDDLRefUnit;
14 
18  typedef std::vector<cDDLRefUnit*> tDDLRefUnitVec;
22  typedef tDDLRefUnitVec::iterator tDDLRefUnitIt;
23 
27  class cDDLUnit : public IDDLUnit
28  {
29  public:
34 
44  cDDLUnit(const A_UTILS_NS::cString& strName,
45  const A_UTILS_NS::cString& strNumerator,
46  const A_UTILS_NS::cString& strDenominator,
47  double const fOffset,
48  tDDLRefUnitVec vecDDLRefUnits = tDDLRefUnitVec(),
49  int const nCreationLevel = 1);
50 
55  cDDLUnit(cDDLUnit &oUnit);
56 
60  virtual ~cDDLUnit();
61 
62  tResult Accept(IDDLVisitor *poVisitor);
63 
64  bool IsInitialized() const;
65 
66  bool IsPredefined() const;
67  bool IsOverwriteable() const;
68 
69  int GetCreationLevel() const;
70 
82  const A_UTILS_NS::cString& strNumerator,
83  const A_UTILS_NS::cString& strDenominator,
84  double const fOffset,
85  tDDLRefUnitVec vecDDLRefUnits = tDDLRefUnitVec(),
86  int const nCreationLevel = 4);
87 
92  const A_UTILS_NS::cString& GetName() const;
93 
97  void SetName(const A_UTILS_NS::cString& strName);
98 
99 
105 
109  void SetNumerator(const A_UTILS_NS::cString& strNumerator);
110 
116 
120  void SetDenominator(const A_UTILS_NS::cString& strDenominator);
121 
126  double GetOffset() const;
127 
131  void SetOffset(double const fOffset);
132 
138 
143  const tDDLRefUnitVec& GetRefUnits() const;
144 
152  void AddRefUnit(cDDLRefUnit* poRefUnit, int nPos = -1);
153 
160 
167  void CloneRefUnits(tDDLRefUnitVec vecDDLRefUnits);
168 
175  void RefRefUnits(tDDLRefUnitVec vecDDLRefUnits);
176 
177  private:
178  A_UTILS_NS::cString m_strName;
179  A_UTILS_NS::cString m_strNumerator;
180  A_UTILS_NS::cString m_strDenominator;
181  double m_fOffset;
182  tDDLRefUnitVec m_vecDDLRefUnits;
183 
184  bool m_bInitFlag;
185  int m_nLevel;
186  };
187 
188 } // namespace adtf_ddl
189 
190 #endif // _UNIT_H_INCLUDED
Interface for unit classes of the object representation for DDL descriptions.
Definition: ddlunit_intf.h:17
Abstract base class/interface for Visitor design-pattern.
Decorator class for IDDLUnit objects to be used inside other cDDLUnit objects.
Definition: ddlrefunit.h:18
Representation object of a unit.
Definition: ddlunit.h:28
void SetOffset(double const fOffset)
Setter for the offset.
const A_UTILS_NS::cString & GetName() const
Getter for the name.
const tDDLRefUnitVec & GetRefUnits() const
Getter for the reference unit.
bool IsInitialized() const
Getter for the initialization flag.
virtual ~cDDLUnit()
DTOR.
int GetCreationLevel() const
Getter for the creation level.
tResult RemoveRefUnit(const A_UTILS_NS::cString &strRefUnit)
Remover for a reference unit.
void SetDenominator(const A_UTILS_NS::cString &strDenominator)
Setter for the Denominator.
void CloneRefUnits(tDDLRefUnitVec vecDDLRefUnits)
Setter for the reference units.
cDDLUnit(const A_UTILS_NS::cString &strName, const A_UTILS_NS::cString &strNumerator, const A_UTILS_NS::cString &strDenominator, double const fOffset, tDDLRefUnitVec vecDDLRefUnits=tDDLRefUnitVec(), int const nCreationLevel=1)
CTOR.
cDDLUnit()
Default CTOR.
tResult Create(const A_UTILS_NS::cString &strName, const A_UTILS_NS::cString &strNumerator, const A_UTILS_NS::cString &strDenominator, double const fOffset, tDDLRefUnitVec vecDDLRefUnits=tDDLRefUnitVec(), int const nCreationLevel=4)
Creation method to fill the object with data.
A_UTILS_NS::cString GetNumerator() const
Getter for the numerator.
double GetOffset() const
Getter for the offset.
bool IsPredefined() const
Getter for the predefinition flag.
tDDLRefUnitVec & GetRefUnits()
Getter for the reference unit.
A_UTILS_NS::cString GetDenominator() const
Getter for the denominator.
void RefRefUnits(tDDLRefUnitVec vecDDLRefUnits)
Setter for the reference units.
tResult Accept(IDDLVisitor *poVisitor)
Acceptance method for Visitor design-pattern.
void SetName(const A_UTILS_NS::cString &strName)
Setter for the Name.
bool IsOverwriteable() const
Getter for the predefinition flag.
void SetNumerator(const A_UTILS_NS::cString &strNumerator)
Setter for the Denominator.
cDDLUnit(cDDLUnit &oUnit)
Copy CTOR.
void AddRefUnit(cDDLRefUnit *poRefUnit, int nPos=-1)
Adder for a reference unit.
Namespace for the mainpage_pkg_ddl.
std::vector< cDDLRefUnit * > tDDLRefUnitVec
Container type of cDDLRefUnit objects.
Definition: ddlunit.h:13
tDDLRefUnitVec::iterator tDDLRefUnitIt
Iterator type for tDDLRefUnitVec.
Definition: ddlunit.h:22