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// copy construct
47 DoCopy(rSrcAttr);
48}
49
50
51// copy my members
52void DiagLabelSet::DoCopy(const DiagLabelSet& rSrcAttr) {
53 AttributeFlags::DoCopy(rSrcAttr);
54 mDiagLabels=rSrcAttr.mDiagLabels;
55}
56
57// copy my members
59 AttributeFlags::DoCopy(rSrcAttr);
60 mDiagLabels.Move(rSrcAttr.mDiagLabels);
61}
62
63// equality
64bool DiagLabelSet::DoEqual(const DiagLabelSet& rOtherSet) const {
65 // call base
66 if(!AttributeFlags::DoEqual(rOtherSet)) return false;
67 // test my members
68 if(mDiagLabels != rOtherSet.mDiagLabels) return false;
69 // pass
70 return true;
71}
72
73
74// IsDefault()
75bool DiagLabelSet::IsDefault(void) const {
76 return mDiagLabels.Empty();
77}
78
79// StaticLabelSymbolTablep()
83
84// LabelSymbolTablep()
88
89// Empty()
90bool DiagLabelSet::Empty(void) const {
91 return mDiagLabels.Empty();
92}
93
94// Size()
96 return mDiagLabels.Size();
97}
98
99// Exists()
100bool DiagLabelSet::Exists(Idx index) const {
101 return mDiagLabels.Exists(index);
102}
103
104// Insert()
106 return mDiagLabels.Insert(index);
107}
108
109// InsertSet()
113
114// Erase()
116 return mDiagLabels.Erase(index);
117}
118
119// Clear()
121 return mDiagLabels.Clear();
122}
123
124// IndexOfLabelN()
126 return msLabelN;
127}
128
129// IndexOfLabelA()
131 return msLabelA;
132}
133
134// IndexOfLabelRelN()
138
139// IndexOfLabelRelN()
143
144// Symbol()
146 return msLabelSymbolTable.Symbol(index);
147}
148
149// PrettyPrintLabelSet()
150string DiagLabelSet::Str(void) const {
151 string str;
152 NameSet::Iterator it;
153 for (it = mDiagLabels.Begin(); it != mDiagLabels.End(); it++) {
154 str += mDiagLabels.SymbolicName(*it);
155 }
156 return str;
157}
158
159// DoWrite()
160void DiagLabelSet::DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
161 if(IsDefault()) return;
162 mDiagLabels.Write(rTw, "DiagLabels", pContext);
163}
164
165// DoWrite()
166void DiagLabelSet::DoXWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
167 if(IsDefault()) return;
168 mDiagLabels.XWrite(rTw, "DiagLabels", pContext);
169}
170
171// DoRead()
172void DiagLabelSet::DoRead(TokenReader &rTr, const std::string &rLabel, const Type *pContext) {
173 mDiagLabels.Read(rTr, "DiagLabels", pContext);
174}
175
176// operator *
178 FD_DC("DiagLabelSet(" << this << ")::operator * (" << &rOtherSet << ")");
179 DiagLabelSet res;
180 res.mDiagLabels = mDiagLabels * rOtherSet.mDiagLabels;
181 return res;
182}
183
184// operator +
186 FD_DC("DiagLabelSet(" << this << ")::operator + (" << &rOtherSet << ")");
187 DiagLabelSet res;
188 res.mDiagLabels = mDiagLabels + rOtherSet.mDiagLabels;
189 return res;
190}
191
192// operator -
194 FD_DC("DiagLabelSet(" << this << ")::operator - (" << &rOtherSet << ")");
195 DiagLabelSet res;
196 res.mDiagLabels = mDiagLabels - rOtherSet.mDiagLabels;
197 return res;
198}
199
200
201// operator <=
202bool DiagLabelSet::operator <= (const DiagLabelSet& rOtherSet) const {
203 return mDiagLabels.operator <= (rOtherSet.mDiagLabels);
204}
205
206// operator >=
207bool DiagLabelSet::operator >= (const DiagLabelSet& rOtherSet) const {
208 return mDiagLabels.operator >= (rOtherSet.mDiagLabels);
209}
210
211
212} // namespace faudes
#define FD_DC(message)
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)
Definition cfl_types.h:1017
bool DoEqual(const AttributeFlags &rOther) const
void DoCopy(const AttributeFlags &rSrcAttr)
DiagLabelSet operator-(const DiagLabelSet &rOtherSet) const
std::string Str(void) const
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)
void DoCopy(const DiagLabelSet &rSrcAttr)
void DoMove(DiagLabelSet &rSrcAttr)
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
virtual Type & Move(Type &rSrc)
Definition cfl_types.cpp:89
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.34e --- 2026.03.16 --- c++ api documentaion by doxygen