diag_attrlabelset.cpp
Go to the documentation of this file.
1/** @file diag_attrlabelset.cpp
2Implements the label representation for state estimates.
3*/
4
5#include "diag_attrlabelset.h"
6
7using namespace std;
8
9
10namespace faudes {
11
12 // my statics
18
19// faudes type std
20FAUDES_TYPE_IMPLEMENTATION(Void,DiagLabelSet,AttributeFlags)
21
22
23// construct
25 // set my static table
26 mDiagLabels.SymbolTablep(&msLabelSymbolTable);
27 FD_DC("DiagLabelSet("<<this<<")::DiagLabelSet() with LabelSymbolTable "<< mDiagLabels.SymbolTablep());
28 // configure unregistered type
29 mDiagLabels.Name("DiagLabels");
30 mDiagLabels.TypeName("DiagLabels");
31 mDiagLabels.ElementTag("Label");
32}
33
34// construct and set symbol table
36 // set specified table
38 FD_DC("DiagLabelSet("<<this<<")::DiagLabelSet() with LabelSymbolTable "<< mDiagLabels.SymbolTablep());
39 // configure unregistered type
40 mDiagLabels.Name("DiagLabels");
41 mDiagLabels.TypeName("DiagLabels");
42 mDiagLabels.ElementTag("Label");
43}
44
45
46// copy my members
47void DiagLabelSet::DoAssign(const DiagLabelSet& rSrcAttr) {
48 AttributeFlags::DoAssign(rSrcAttr);
49 mDiagLabels=rSrcAttr.mDiagLabels;
50}
51
52// equality
53bool DiagLabelSet::DoEqual(const DiagLabelSet& rOtherSet) const {
54 // call base
55 if(!AttributeFlags::DoEqual(rOtherSet)) return false;
56 // test my members
57 if(mDiagLabels != rOtherSet.mDiagLabels) return false;
58 // pass
59 return true;
60}
61
62
63// IsDefault()
64bool DiagLabelSet::IsDefault(void) const {
65 return mDiagLabels.Empty();
66}
67
68// StaticLabelSymbolTablep()
72
73// LabelSymbolTablep()
77
78// Empty()
79bool DiagLabelSet::Empty(void) const {
80 return mDiagLabels.Empty();
81}
82
83// Size()
85 return mDiagLabels.Size();
86}
87
88// Exists()
89bool DiagLabelSet::Exists(Idx index) const {
90 return mDiagLabels.Exists(index);
91}
92
93// Insert()
95 return mDiagLabels.Insert(index);
96}
97
98// InsertSet()
102
103// Erase()
105 return mDiagLabels.Erase(index);
106}
107
108// Clear()
110 return mDiagLabels.Clear();
111}
112
113// IndexOfLabelN()
115 return msLabelN;
116}
117
118// IndexOfLabelA()
120 return msLabelA;
121}
122
123// IndexOfLabelRelN()
127
128// IndexOfLabelRelN()
132
133// Symbol()
135 return msLabelSymbolTable.Symbol(index);
136}
137
138// PrettyPrintLabelSet()
139string DiagLabelSet::Str(void) const {
140 string str;
141 NameSet::Iterator it;
142 for (it = mDiagLabels.Begin(); it != mDiagLabels.End(); it++) {
143 str += mDiagLabels.SymbolicName(*it);
144 }
145 return str;
146}
147
148// DoWrite()
149void DiagLabelSet::DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
150 if(IsDefault()) return;
151 mDiagLabels.Write(rTw, "DiagLabels", pContext);
152}
153
154// DoWrite()
155void DiagLabelSet::DoXWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
156 if(IsDefault()) return;
157 mDiagLabels.XWrite(rTw, "DiagLabels", pContext);
158}
159
160// DoRead()
161void DiagLabelSet::DoRead(TokenReader &rTr, const std::string &rLabel, const Type *pContext) {
162 mDiagLabels.Read(rTr, "DiagLabels", pContext);
163}
164
165// operator *
167 FD_DC("DiagLabelSet(" << this << ")::operator * (" << &rOtherSet << ")");
168 DiagLabelSet res;
169 res.mDiagLabels = mDiagLabels * rOtherSet.mDiagLabels;
170 return res;
171}
172
173// operator +
175 FD_DC("DiagLabelSet(" << this << ")::operator + (" << &rOtherSet << ")");
176 DiagLabelSet res;
177 res.mDiagLabels = mDiagLabels + rOtherSet.mDiagLabels;
178 return res;
179}
180
181// operator -
183 FD_DC("DiagLabelSet(" << this << ")::operator - (" << &rOtherSet << ")");
184 DiagLabelSet res;
185 res.mDiagLabels = mDiagLabels - rOtherSet.mDiagLabels;
186 return res;
187}
188
189
190// operator <=
191bool DiagLabelSet::operator <= (const DiagLabelSet& rOtherSet) const {
192 return mDiagLabels.operator <= (rOtherSet.mDiagLabels);
193}
194
195// operator >=
196bool DiagLabelSet::operator >= (const DiagLabelSet& rOtherSet) const {
197 return mDiagLabels.operator >= (rOtherSet.mDiagLabels);
198}
199
200
201} // namespace faudes
#define FD_DC(message)
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)
Definition cfl_types.h:958
bool DoEqual(const AttributeFlags &rOther) const
void DoAssign(const AttributeFlags &rSrcAttr)
DiagLabelSet operator-(const DiagLabelSet &rOtherSet) const
std::string Str(void) const
void DoAssign(const DiagLabelSet &rSrcAttr)
static Idx IndexOfLabelSpecViolated(void)
void DoXWrite(TokenWriter &rTw, const std::string &rLabel, const Type *pContext) const
static Idx IndexOfLabelN(void)
bool operator>=(const DiagLabelSet &rOtherSet) const
DiagLabelSet operator+(const DiagLabelSet &rOtherSet) const
static std::string Symbol(Idx index)
void InsertSet(const DiagLabelSet &rSet)
void LabelSymbolTablep(SymbolTable *pSymTab)
bool operator<=(const DiagLabelSet &rOtherSet) const
DiagLabelSet operator*(const DiagLabelSet &rOtherSet) const
bool DoEqual(const DiagLabelSet &rOther) const
static Idx IndexOfLabelA(void)
static SymbolTable * StaticLabelSymbolTablep(void)
void DoWrite(TokenWriter &rTw, const std::string &rLabel, const Type *pContext) const
static Idx IndexOfLabelRelN(void)
bool IsDefault(void) const
static SymbolTable msLabelSymbolTable
bool Exists(Idx index) const
void DoRead(TokenReader &rTr, const std::string &rLabel, const Type *pContext)
virtual const std::string & ElementTag(void) const
const std::string & Name(void) const
virtual const std::string & TypeName(void) const
bool Exists(const Idx &rIndex) const
void SymbolicName(Idx index, const std::string &rName)
virtual void InsertSet(const NameSet &rOtherSet)
SymbolTable * SymbolTablep(void) const
bool Insert(const Idx &rIndex)
virtual bool Erase(const Idx &rIndex)
std::string Symbol(Idx index) const
Idx InsEntry(Idx index, const std::string &rName)
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
virtual void XWrite(const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
void Write(const Type *pContext=0) const
bool Empty(void) const
virtual void Clear(void)
Iterator End(void) const
Iterator Begin(void) const
Idx Size(void) const
uint32_t Idx

libFAUDES 2.33k --- 2025.09.16 --- c++ api documentaion by doxygen