faudes::DiagLabelSet Class Reference
[Fault Diagnosis Plug-In]

Implements the label representation for state estimates. More...

#include <diag_attrlabelset.h>

List of all members.

Public Types

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

Public Member Functions

 DiagLabelSet (void)
 Constructor for DiagLabelSet with static LabelSymbolTable.
 DiagLabelSet (SymbolTable *pSymTab)
 Constructor for DiagLabelSet with specified SymbolTable.
 DiagLabelSet (const std::string &rFilename, const std::string &rLabel="DiagLabels")
 Constructor for DiagLabelSet with static LabelSymbolTable.
bool IsDefault (void) const
 Test for default value.
void LabelSymbolTablep (SymbolTable *pSymTab)
 Reset pointer mpSymbolTable.
bool Empty (void) const
 Check if mDiagLabels is empty.
Idx Size (void) const
 Get size of mDiagLabels.
bool Exists (Idx index) const
 Test existence of index.
bool Insert (Idx index)
 Add an element by index.
void InsertSet (const DiagLabelSet &rSet)
 Insert elements of rSet.
bool Erase (Idx index)
 Delete element by index.
void Clear (void)
 Clear mDiagLabels.
std::string Str (void) const
 Prints mDiagLabels to a string.
DiagLabelSet operator* (const DiagLabelSet &rOtherSet) const
 Set intersection operator.
DiagLabelSet operator+ (const DiagLabelSet &rOtherSet) const
 Set union operator.
DiagLabelSet operator- (const DiagLabelSet &rOtherSet) const
 Set difference operator.
bool operator<= (const DiagLabelSet &rOtherSet) const
 Test for subset.
bool operator>= (const DiagLabelSet &rOtherSet) const
 Test for superset.

Static Public Member Functions

static SymbolTableStaticLabelSymbolTablep (void)
 Get pointer to static LabelSymbolTable.
static Idx IndexOfLabelN (void)
 Return index label "normal".
static Idx IndexOfLabelA (void)
 Return index label "ambiguous".
static Idx IndexOfLabelRelN (void)
 Return index label "relatively normal".
static Idx IndexOfLabelSpecViolated (void)
 Return index label "specification violated".
static std::string Symbol (Idx index)
 Symbolic name lookup of element in SymbolTable.

Public Attributes

NameSet mDiagLabels
 Set of diagnoser label names.

Protected Member Functions

void DoWrite (TokenWriter &rTw, const std::string &rLabel, const Type *pContext) const
 Write mDiagLabels to TokenWriter.
void DoXWrite (TokenWriter &rTw, const std::string &rLabel, const Type *pContext) const
 Write mDiagLabels to TokenWriter.
void DoRead (TokenReader &rTr, const std::string &rLabel, const Type *pContext)
 Read mDiagLabels from TokenReader.
void DoAssign (const DiagLabelSet &rSrcAttr)
 Copy attribute members.
bool DoEqual (const DiagLabelSet &rOther) const
 Test equality.

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.
static Idx msLabelN = DiagLabelSet::msLabelSymbolTable.InsEntry("N")
 Static index of label "normal".
static Idx msLabelA = DiagLabelSet::msLabelSymbolTable.InsEntry("A")
 Static index of label "ambiguous".
static Idx msLabelRelN = DiagLabelSet::msLabelSymbolTable.InsEntry("relN")
 Static index of label "relatively normal" (only for diagnoser building purpose).
static Idx msLabelSpecViolated = DiagLabelSet::msLabelSymbolTable.InsEntry("F")
 Static index of label "specification violated".

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.


Member Typedef Documentation

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

Convenience definition of NameSet::Iterator.

Definition at line 43 of file diag_attrlabelset.h.


Constructor & Destructor Documentation

faudes::DiagLabelSet::DiagLabelSet ( void   ) 

Constructor for DiagLabelSet with static LabelSymbolTable.

Definition at line 24 of file diag_attrlabelset.cpp.

faudes::DiagLabelSet::DiagLabelSet ( SymbolTable pSymTab  ) 

Constructor for DiagLabelSet with specified SymbolTable.

Definition at line 35 of file diag_attrlabelset.cpp.

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:
rFilename Filename
rLabel Token label for the labels in the file; default value "DiagLabels"

Definition at line 60 of file diag_attrlabelset.h.


Member Function Documentation

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

Clear mDiagLabels.

Reimplemented from faudes::AttributeVoid.

Definition at line 109 of file diag_attrlabelset.cpp.

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

Copy attribute members.

Parameters:
rSrcAttr Source to copy from

Definition at line 47 of file diag_attrlabelset.cpp.

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

Test equality.

Parameters:
rOther Attribute to compare with

Definition at line 53 of file diag_attrlabelset.cpp.

void faudes::DiagLabelSet::DoRead ( TokenReader rTr,
const std::string &  rLabel,
const Type pContext 
) [protected, virtual]

Read mDiagLabels from TokenReader.

Parameters:
rTr Reference to TokenReader
rLabel Is ignored. Label of the section is "DiagLabels".
pContext Write context to provide contextual information

Reimplemented from faudes::AttributeFlags.

Definition at line 161 of file diag_attrlabelset.cpp.

void faudes::DiagLabelSet::DoWrite ( TokenWriter rTw,
const std::string &  rLabel,
const Type pContext 
) const [protected, virtual]

Write mDiagLabels to TokenWriter.

Parameters:
rTw Reference to TokenWriter
rLabel Is ignored. Label of the section is "DiagLabels".
pContext Write context to provide contextual information

Reimplemented from faudes::AttributeFlags.

Definition at line 149 of file diag_attrlabelset.cpp.

void faudes::DiagLabelSet::DoXWrite ( TokenWriter rTw,
const std::string &  rLabel,
const Type pContext 
) const [protected, virtual]

Write mDiagLabels to TokenWriter.

Parameters:
rTw Reference to TokenWriter
rLabel Is ignored. Label of the section is "DiagLabels".
pContext Write context to provide contextual information

Reimplemented from faudes::AttributeFlags.

Definition at line 155 of file diag_attrlabelset.cpp.

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

Check if mDiagLabels is empty.

Returns:
true if empty

Definition at line 79 of file diag_attrlabelset.cpp.

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

Delete element by index.

The symbolic name is not removed from the SymbolTable.

Parameters:
index Index to delete.
Returns:
True if element did exist.

Definition at line 104 of file diag_attrlabelset.cpp.

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

Test existence of index.

Parameters:
index Index to test
Returns:
True if index is in this set

Definition at line 89 of file diag_attrlabelset.cpp.

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

Return index label "ambiguous".

Returns:
Index of static msLabelA.

Definition at line 119 of file diag_attrlabelset.cpp.

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

Return index label "normal".

Returns:
Index of static msLabelN.

Definition at line 114 of file diag_attrlabelset.cpp.

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.

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.

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

Add an element by index.

Index must be already known to the global SymbolTable.

Parameters:
index Index to add
Returns:
True, if element was new to set

Definition at line 94 of file diag_attrlabelset.cpp.

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

Insert elements of rSet.

Parameters:
rSet Indices of elements to add

Definition at line 99 of file diag_attrlabelset.cpp.

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.

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

Reset pointer mpSymbolTable.

Parameters:
pSymTab Pointer to new symbol table

Definition at line 74 of file diag_attrlabelset.cpp.

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

Set intersection operator.

Returns:
Intersection DiagLabelSet

Definition at line 166 of file diag_attrlabelset.cpp.

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

Set union operator.

Returns:
Union DiagLabelSet

Definition at line 174 of file diag_attrlabelset.cpp.

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

Set difference operator.

Returns:
Difference DiagLabelSet

Definition at line 182 of file diag_attrlabelset.cpp.

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

Test for subset.

Definition at line 191 of file diag_attrlabelset.cpp.

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

Test for superset.

Definition at line 196 of file diag_attrlabelset.cpp.

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.

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.

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.

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

Symbolic name lookup of element in SymbolTable.

Parameters:
index Index 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

Set of diagnoser label names.

Definition at line 38 of file diag_attrlabelset.h.

Idx faudes::DiagLabelSet::msLabelA = DiagLabelSet::msLabelSymbolTable.InsEntry("A") [static, private]

Static index of label "ambiguous".

Definition at line 30 of file diag_attrlabelset.h.

Idx faudes::DiagLabelSet::msLabelN = DiagLabelSet::msLabelSymbolTable.InsEntry("N") [static, private]

Static index of label "normal".

Definition at line 28 of file diag_attrlabelset.h.

Idx faudes::DiagLabelSet::msLabelRelN = DiagLabelSet::msLabelSymbolTable.InsEntry("relN") [static, private]

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

Definition at line 32 of file diag_attrlabelset.h.

Idx faudes::DiagLabelSet::msLabelSpecViolated = DiagLabelSet::msLabelSymbolTable.InsEntry("F") [static, private]

Static index of label "specification violated".

Definition at line 34 of file diag_attrlabelset.h.

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.23h --- 2014.04.03 --- c++ api documentaion by doxygen