Detailed Description

Implements the label representation for state estimates.

This class has its own static SymbolTable and label names are stored in mDiagLabels.

Definition at line 19 of file diag_attrlabelset.h.

#include <diag_attrlabelset.h>

Public Types

typedef NameSet::Iterator Iterator
 Convenience definition of NameSet::Iterator. More...
 

Public Member Functions

 DiagLabelSet (void)
 Constructor for DiagLabelSet with static LabelSymbolTable. More...
 
 DiagLabelSet (SymbolTable *pSymTab)
 Constructor for DiagLabelSet with specified SymbolTable. More...
 
 DiagLabelSet (const std::string &rFilename, const std::string &rLabel="DiagLabels")
 Constructor for DiagLabelSet with static LabelSymbolTable. More...
 
bool IsDefault (void) const
 Test for default value. More...
 
void LabelSymbolTablep (SymbolTable *pSymTab)
 Reset pointer mpSymbolTable. More...
 
bool Empty (void) const
 Check if mDiagLabels is empty. More...
 
Idx Size (void) const
 Get size of mDiagLabels. More...
 
bool Exists (Idx index) const
 Test existence of index. More...
 
bool Insert (Idx index)
 Add an element by index. More...
 
void InsertSet (const DiagLabelSet &rSet)
 Insert elements of rSet. More...
 
bool Erase (Idx index)
 Delete element by index. More...
 
void Clear (void)
 Clear mDiagLabels. More...
 
std::string Str (void) const
 Prints mDiagLabels to a string. More...
 
DiagLabelSet operator* (const DiagLabelSet &rOtherSet) const
 Set intersection operator. More...
 
DiagLabelSet operator+ (const DiagLabelSet &rOtherSet) const
 Set union operator. More...
 
DiagLabelSet operator- (const DiagLabelSet &rOtherSet) const
 Set difference operator. More...
 
bool operator<= (const DiagLabelSet &rOtherSet) const
 Test for subset. More...
 
bool operator>= (const DiagLabelSet &rOtherSet) const
 Test for superset. More...
 
- Public Member Functions inherited from faudes::AttributeFlags
 AttributeFlags (void)
 Default constructor. More...
 
 AttributeFlags (const AttributeFlags &rOther)
 Copy constructor. More...
 
virtual ~AttributeFlags (void)
 Destructor. More...
 
bool Test (fType mask) const
 Test a flag. More...
 
bool TestAll (fType mask) const
 Test multible flags, combine by "and". More...
 
bool TestSome (fType mask) const
 Test multible flags, combine by "or". More...
 
bool TestNone (fType mask) const
 Test multible flags, combine by "not or". More...
 
void Set (fType mask)
 Set multiple flags. More...
 
void Clr (fType mask)
 Clear multiple flags. More...
 
- Public Member Functions inherited from faudes::AttributeVoid
 AttributeVoid (void)
 Constructor. More...
 
 AttributeVoid (const AttributeVoid &rSrcAttr)
 Copy Constructor. More...
 
virtual ~AttributeVoid (void)
 Destructor. More...
 
virtual void SetDefault (void)
 Set to default value. More...
 
- Public Member Functions inherited from faudes::Type
 Type (void)
 Constructor. More...
 
 Type (const Type &rType)
 Copy constructor. More...
 
virtual ~Type (void)
 Destructor. More...
 
virtual TypeNew (void) const
 Construct on heap. More...
 
virtual TypeCopy (void) const
 Construct on heap. More...
 
virtual const TypeCast (const Type *pOther) const
 Cast other object to this type. More...
 
virtual TypeAssign (const Type &rSrc)
 Assign configuration data from other object. More...
 
virtual Typeoperator= (const Type &rSrc)
 Assign configurationdata from other object. More...
 
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual bool operator== (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual bool operator!= (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual void Name (const std::string &rName)
 Set the objects's name. More...
 
virtual const std::string & Name (void) const
 Get objects's name. More...
 
virtual const std::string & TypeName (void) const
 Get objects's type name. More...
 
void Write (const Type *pContext=0) const
 Write configuration data to console. More...
 
void Write (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 Write configuration data to a file. More...
 
void Write (const std::string &pFileName, std::ios::openmode openmode) const
 Write configuration data to a file. More...
 
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to TokenWriter. More...
 
virtual void XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to an XML file. More...
 
void XWrite (const Type *pContext=0) const
 Write configuration data in XML format to concole Note: this write function uses the virtual function DoXWrite(), to be reimplemented by derived classes. More...
 
void XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in XML format to TokenWriter. More...
 
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a string. More...
 
std::string ToText (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a formated string. More...
 
void DWrite (const Type *pContext=0) const
 Write configuration data to console, debugging format. More...
 
void DWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 Write configuration data to a file, debugging format. More...
 
void DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in debug format to TokenWriter. More...
 
void SWrite (TokenWriter &rTw) const
 Write statistics comment to TokenWriter. More...
 
void SWrite (void) const
 Write statistics comment to console. More...
 
std::string ToSText (void) const
 Write statistics to a string. More...
 
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from file with label specified. More...
 
void FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from a string. More...
 
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from TokenReader with label sepcified. More...
 

Static Public Member Functions

static SymbolTableStaticLabelSymbolTablep (void)
 Get pointer to static LabelSymbolTable. More...
 
static Idx IndexOfLabelN (void)
 Return index label "normal". More...
 
static Idx IndexOfLabelA (void)
 Return index label "ambiguous". More...
 
static Idx IndexOfLabelRelN (void)
 Return index label "relatively normal". More...
 
static Idx IndexOfLabelSpecViolated (void)
 Return index label "specification violated". More...
 
static std::string Symbol (Idx index)
 Symbolic name lookup of element in SymbolTable. More...
 
- Static Public Member Functions inherited from faudes::AttributeVoid
static void Skip (TokenReader &rTr)
 Skip attribute tokens. More...
 

Public Attributes

NameSet mDiagLabels
 Set of diagnoser label names. More...
 
- Public Attributes inherited from faudes::AttributeFlags
fType mFlags
 Flags (public access for convenience)
More...
 

Protected Member Functions

void DoWrite (TokenWriter &rTw, const std::string &rLabel, const Type *pContext) const
 Write mDiagLabels to TokenWriter. More...
 
void DoXWrite (TokenWriter &rTw, const std::string &rLabel, const Type *pContext) const
 Write mDiagLabels to TokenWriter. More...
 
void DoRead (TokenReader &rTr, const std::string &rLabel, const Type *pContext)
 Read mDiagLabels from TokenReader. More...
 
void DoAssign (const DiagLabelSet &rSrcAttr)
 Copy attribute members. More...
 
bool DoEqual (const DiagLabelSet &rOther) const
 Test equality. More...
 
- Protected Member Functions inherited from faudes::AttributeFlags
void DoAssign (const AttributeFlags &rSrcAttr)
 Assignment method. More...
 
bool DoEqual (const AttributeFlags &rOther) const
 Test equality of configuration data. More...
 
- Protected Member Functions inherited from faudes::AttributeVoid
void DoAssign (const AttributeVoid &rSrcAttr)
 Assign attribute members. More...
 
bool DoEqual (const AttributeVoid &rOther) const
 Test equality of configuration data. More...
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Actual write method to write the attribute to a TokenWriter. More...
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 Assign configuration data from other object. More...
 
bool DoEqual (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual void DoSWrite (TokenWriter &rTw) const
 Write statistical data as a comment to TokenWriter. More...
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 Get objects's type definition. More...
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Static Private Attributes

static SymbolTable msLabelSymbolTable
 Static global symbol table for possible labels of the diagnoser attribute, e.g., N, A, and specific failure labels. More...
 
static Idx msLabelN = DiagLabelSet::msLabelSymbolTable.InsEntry("N")
 Static index of label "normal". More...
 
static Idx msLabelA = DiagLabelSet::msLabelSymbolTable.InsEntry("A")
 Static index of label "ambiguous". More...
 
static Idx msLabelRelN = DiagLabelSet::msLabelSymbolTable.InsEntry("relN")
 Static index of label "relatively normal" (only for diagnoser building purpose). More...
 
static Idx msLabelSpecViolated = DiagLabelSet::msLabelSymbolTable.InsEntry("F")
 Static index of label "specification violated". More...
 

Additional Inherited Members

- Static Public Attributes inherited from faudes::AttributeFlags
static const fType mDefFlags =0x0
 

Member Typedef Documentation

◆ Iterator

typedef NameSet::Iterator faudes::DiagLabelSet::Iterator

Convenience definition of NameSet::Iterator.

Definition at line 43 of file diag_attrlabelset.h.

Constructor & Destructor Documentation

◆ DiagLabelSet() [1/3]

faudes::DiagLabelSet::DiagLabelSet ( void  )

Constructor for DiagLabelSet with static LabelSymbolTable.

Definition at line 24 of file diag_attrlabelset.cpp.

◆ DiagLabelSet() [2/3]

faudes::DiagLabelSet::DiagLabelSet ( SymbolTable pSymTab)

Constructor for DiagLabelSet with specified SymbolTable.

Definition at line 35 of file diag_attrlabelset.cpp.

◆ DiagLabelSet() [3/3]

faudes::DiagLabelSet::DiagLabelSet ( const std::string &  rFilename,
const std::string &  rLabel = "DiagLabels" 
)
inline

Constructor for DiagLabelSet with static LabelSymbolTable.

This version reads a file with given label to find the labels inside the file.

Parameters
rFilenameFilename
rLabelToken label for the labels in the file; default value "DiagLabels"

Definition at line 60 of file diag_attrlabelset.h.

Member Function Documentation

◆ Clear()

void faudes::DiagLabelSet::Clear ( void  )
virtual

Clear mDiagLabels.

Reimplemented from faudes::AttributeVoid.

Definition at line 109 of file diag_attrlabelset.cpp.

◆ DoAssign()

void faudes::DiagLabelSet::DoAssign ( const DiagLabelSet rSrcAttr)
protected

Copy attribute members.

Parameters
rSrcAttrSource to copy from

Definition at line 47 of file diag_attrlabelset.cpp.

◆ DoEqual()

bool faudes::DiagLabelSet::DoEqual ( const DiagLabelSet rOther) const
protected

Test equality.

Parameters
rOtherAttribute to compare with

Definition at line 53 of file diag_attrlabelset.cpp.

◆ DoRead()

void faudes::DiagLabelSet::DoRead ( TokenReader rTr,
const std::string &  rLabel,
const Type pContext 
)
protectedvirtual

Read mDiagLabels from TokenReader.

Parameters
rTrReference to TokenReader
rLabelIs ignored. Label of the section is "DiagLabels".
pContextWrite context to provide contextual information

Reimplemented from faudes::AttributeFlags.

Definition at line 161 of file diag_attrlabelset.cpp.

◆ DoWrite()

void faudes::DiagLabelSet::DoWrite ( TokenWriter rTw,
const std::string &  rLabel,
const Type pContext 
) const
protectedvirtual

Write mDiagLabels to TokenWriter.

Parameters
rTwReference to TokenWriter
rLabelIs ignored. Label of the section is "DiagLabels".
pContextWrite context to provide contextual information

Reimplemented from faudes::AttributeFlags.

Definition at line 149 of file diag_attrlabelset.cpp.

◆ DoXWrite()

void faudes::DiagLabelSet::DoXWrite ( TokenWriter rTw,
const std::string &  rLabel,
const Type pContext 
) const
protectedvirtual

Write mDiagLabels to TokenWriter.

Parameters
rTwReference to TokenWriter
rLabelIs ignored. Label of the section is "DiagLabels".
pContextWrite context to provide contextual information

Reimplemented from faudes::AttributeFlags.

Definition at line 155 of file diag_attrlabelset.cpp.

◆ Empty()

bool faudes::DiagLabelSet::Empty ( void  ) const

Check if mDiagLabels is empty.

Returns
true if empty

Definition at line 79 of file diag_attrlabelset.cpp.

◆ Erase()

bool faudes::DiagLabelSet::Erase ( Idx  index)

Delete element by index.

The symbolic name is not removed from the SymbolTable.

Parameters
indexIndex to delete.
Returns
True if element did exist.

Definition at line 104 of file diag_attrlabelset.cpp.

◆ Exists()

bool faudes::DiagLabelSet::Exists ( Idx  index) const

Test existence of index.

Parameters
indexIndex to test
Returns
True if index is in this set

Definition at line 89 of file diag_attrlabelset.cpp.

◆ IndexOfLabelA()

Idx faudes::DiagLabelSet::IndexOfLabelA ( void  )
static

Return index label "ambiguous".

Returns
Index of static msLabelA.

Definition at line 119 of file diag_attrlabelset.cpp.

◆ IndexOfLabelN()

Idx faudes::DiagLabelSet::IndexOfLabelN ( void  )
static

Return index label "normal".

Returns
Index of static msLabelN.

Definition at line 114 of file diag_attrlabelset.cpp.

◆ IndexOfLabelRelN()

Idx faudes::DiagLabelSet::IndexOfLabelRelN ( void  )
static

Return index label "relatively normal".

Returns
Index of static msLabelRelN.

Definition at line 124 of file diag_attrlabelset.cpp.

◆ IndexOfLabelSpecViolated()

Idx faudes::DiagLabelSet::IndexOfLabelSpecViolated ( void  )
static

Return index label "specification violated".

Returns
Index of static msLabelSpecViolated.

Definition at line 129 of file diag_attrlabelset.cpp.

◆ Insert()

bool faudes::DiagLabelSet::Insert ( Idx  index)

Add an element by index.

Index must be already known to the global SymbolTable.

Parameters
indexIndex to add
Returns
True, if element was new to set

Definition at line 94 of file diag_attrlabelset.cpp.

◆ InsertSet()

void faudes::DiagLabelSet::InsertSet ( const DiagLabelSet rSet)

Insert elements of rSet.

Parameters
rSetIndices of elements to add

Definition at line 99 of file diag_attrlabelset.cpp.

◆ IsDefault()

bool faudes::DiagLabelSet::IsDefault ( void  ) const
virtual

Test for default value.

Returns
True for default value

Reimplemented from faudes::AttributeFlags.

Definition at line 64 of file diag_attrlabelset.cpp.

◆ LabelSymbolTablep()

void faudes::DiagLabelSet::LabelSymbolTablep ( SymbolTable pSymTab)

Reset pointer mpSymbolTable.

Parameters
pSymTabPointer to new symbol table

Definition at line 74 of file diag_attrlabelset.cpp.

◆ operator*()

DiagLabelSet faudes::DiagLabelSet::operator* ( const DiagLabelSet rOtherSet) const

Set intersection operator.

Returns
Intersection DiagLabelSet

Definition at line 166 of file diag_attrlabelset.cpp.

◆ operator+()

DiagLabelSet faudes::DiagLabelSet::operator+ ( const DiagLabelSet rOtherSet) const

Set union operator.

Returns
Union DiagLabelSet

Definition at line 174 of file diag_attrlabelset.cpp.

◆ operator-()

DiagLabelSet faudes::DiagLabelSet::operator- ( const DiagLabelSet rOtherSet) const

Set difference operator.

Returns
Difference DiagLabelSet

Definition at line 182 of file diag_attrlabelset.cpp.

◆ operator<=()

bool faudes::DiagLabelSet::operator<= ( const DiagLabelSet rOtherSet) const

Test for subset.

Definition at line 191 of file diag_attrlabelset.cpp.

◆ operator>=()

bool faudes::DiagLabelSet::operator>= ( const DiagLabelSet rOtherSet) const

Test for superset.

Definition at line 196 of file diag_attrlabelset.cpp.

◆ Size()

Idx faudes::DiagLabelSet::Size ( void  ) const

Get size of mDiagLabels.

Returns
Number of indices in mDiagLabels.

Definition at line 84 of file diag_attrlabelset.cpp.

◆ StaticLabelSymbolTablep()

SymbolTable * faudes::DiagLabelSet::StaticLabelSymbolTablep ( void  )
static

Get pointer to static LabelSymbolTable.

Returns
Pointer to static LabelSymbolTable

Definition at line 69 of file diag_attrlabelset.cpp.

◆ Str()

string faudes::DiagLabelSet::Str ( void  ) const

Prints mDiagLabels to a string.

Returns
String representation of mDiagLabels.

Definition at line 139 of file diag_attrlabelset.cpp.

◆ Symbol()

string faudes::DiagLabelSet::Symbol ( Idx  index)
static

Symbolic name lookup of element in SymbolTable.

Parameters
indexIndex to look up.
Returns
Symbolic name of index, or empty string "" for non-existent index.

Definition at line 134 of file diag_attrlabelset.cpp.

Member Data Documentation

◆ mDiagLabels

NameSet faudes::DiagLabelSet::mDiagLabels

Set of diagnoser label names.

Definition at line 38 of file diag_attrlabelset.h.

◆ msLabelA

Idx faudes::DiagLabelSet::msLabelA = DiagLabelSet::msLabelSymbolTable.InsEntry("A")
staticprivate

Static index of label "ambiguous".

Definition at line 30 of file diag_attrlabelset.h.

◆ msLabelN

Idx faudes::DiagLabelSet::msLabelN = DiagLabelSet::msLabelSymbolTable.InsEntry("N")
staticprivate

Static index of label "normal".

Definition at line 28 of file diag_attrlabelset.h.

◆ msLabelRelN

Idx faudes::DiagLabelSet::msLabelRelN = DiagLabelSet::msLabelSymbolTable.InsEntry("relN")
staticprivate

Static index of label "relatively normal" (only for diagnoser building purpose).


Definition at line 32 of file diag_attrlabelset.h.

◆ msLabelSpecViolated

Idx faudes::DiagLabelSet::msLabelSpecViolated = DiagLabelSet::msLabelSymbolTable.InsEntry("F")
staticprivate

Static index of label "specification violated".

Definition at line 34 of file diag_attrlabelset.h.

◆ msLabelSymbolTable

SymbolTable faudes::DiagLabelSet::msLabelSymbolTable
staticprivate

Static global symbol table for possible labels of the diagnoser attribute, e.g., N, A, and specific failure labels.

Definition at line 26 of file diag_attrlabelset.h.


The documentation for this class was generated from the following files:

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen