13 SymbolTable DiagLabelSet::msLabelSymbolTable;
14 Idx DiagLabelSet::msLabelN = DiagLabelSet::msLabelSymbolTable.InsEntry(
"N");
15 Idx DiagLabelSet::msLabelA = DiagLabelSet::msLabelSymbolTable.InsEntry(
"A");
16 Idx DiagLabelSet::msLabelRelN = DiagLabelSet::msLabelSymbolTable.InsEntry(
"relN");
17 Idx DiagLabelSet::msLabelSpecViolated = DiagLabelSet::msLabelSymbolTable.InsEntry(
"F");
26 mDiagLabels.SymbolTablep(&msLabelSymbolTable);
27 FD_DC(
"DiagLabelSet("<<
this<<
")::DiagLabelSet() with LabelSymbolTable "<< mDiagLabels.SymbolTablep());
29 mDiagLabels.Name(
"DiagLabels");
30 mDiagLabels.TypeName(
"DiagLabels");
31 mDiagLabels.XElementTag(
"Label");
37 mDiagLabels.SymbolTablep(pSymTab);
38 FD_DC(
"DiagLabelSet("<<
this<<
")::DiagLabelSet() with LabelSymbolTable "<< mDiagLabels.SymbolTablep());
40 mDiagLabels.Name(
"DiagLabels");
41 mDiagLabels.TypeName(
"DiagLabels");
42 mDiagLabels.XElementTag(
"Label");
48 AttributeFlags::DoAssign(rSrcAttr);
55 if(!AttributeFlags::DoEqual(rOtherSet))
return false;
57 if(mDiagLabels != rOtherSet.
mDiagLabels)
return false;
64 bool DiagLabelSet::IsDefault(
void)
const {
65 return mDiagLabels.
Empty();
70 return &msLabelSymbolTable;
75 mDiagLabels.SymbolTablep(pSymTab);
79 bool DiagLabelSet::Empty(
void)
const {
80 return mDiagLabels.Empty();
84 Idx DiagLabelSet::Size(
void)
const {
85 return mDiagLabels.
Size();
89 bool DiagLabelSet::Exists(
Idx index)
const {
90 return mDiagLabels.Exists(index);
94 bool DiagLabelSet::Insert(
Idx index) {
95 return mDiagLabels.Insert(index);
104 bool DiagLabelSet::Erase(
Idx index) {
105 return mDiagLabels.Erase(index);
109 void DiagLabelSet::Clear(
void) {
110 return mDiagLabels.Clear();
114 Idx DiagLabelSet::IndexOfLabelN(
void) {
119 Idx DiagLabelSet::IndexOfLabelA(
void) {
124 Idx DiagLabelSet::IndexOfLabelRelN(
void) {
129 Idx DiagLabelSet::IndexOfLabelSpecViolated(
void) {
130 return msLabelSpecViolated;
134 string DiagLabelSet::Symbol(
Idx index) {
135 return msLabelSymbolTable.Symbol(index);
139 string DiagLabelSet::Str(
void)
const {
141 NameSet::Iterator it;
142 for (it = mDiagLabels.Begin(); it != mDiagLabels.End(); it++) {
143 str += mDiagLabels.SymbolicName(*it);
149 void DiagLabelSet::DoWrite(
TokenWriter& rTw,
const std::string& rLabel,
const Type* pContext)
const {
150 if(IsDefault())
return;
151 mDiagLabels.Write(rTw,
"DiagLabels", pContext);
155 void DiagLabelSet::DoXWrite(
TokenWriter& rTw,
const std::string& rLabel,
const Type* pContext)
const {
156 if(IsDefault())
return;
157 mDiagLabels.XWrite(rTw,
"DiagLabels", pContext);
161 void DiagLabelSet::DoRead(
TokenReader &rTr,
const std::string &rLabel,
const Type *pContext) {
162 mDiagLabels.Read(rTr,
"DiagLabels", pContext);
167 FD_DC(
"DiagLabelSet(" <<
this <<
")::operator * (" << &rOtherSet <<
")");
175 FD_DC(
"DiagLabelSet(" <<
this <<
")::operator + (" << &rOtherSet <<
")");
183 FD_DC(
"DiagLabelSet(" <<
this <<
")::operator - (" << &rOtherSet <<
")");
192 return mDiagLabels.operator <= (rOtherSet.
mDiagLabels);
197 return mDiagLabels.operator >= (rOtherSet.
mDiagLabels);
#define FD_DC(message)
Debug: optional report on container operations.
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)
faudes type implementation macros, overall
Implements the label representation for state estimates.
NameSet mDiagLabels
Set of diagnoser label names.
A SymbolTable associates sybolic names with indices.
Idx Size(void) const
Size of symboltabel.
A TokenReader reads sequential tokens from a file or string.
A TokenWriter writes sequential tokens to a file, a string or stdout.
Base class of all libFAUDES objects that participate in the run-time interface.
Label representation for state estimates.
bool Empty(void) const
Test whether if the TBaseSet is Empty.
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)