17 mDiagnoserStateMap.XElementTag(
"TargetState");
18 mDiagnoserStateMap.
Name(
"TargetStateEstimates");
19 mDiagnoserStateMap.TypeName(
"TargetStateEstimates");
23 AttributeDiagnoserState::~AttributeDiagnoserState(
void) {}
28 AttributeFlags::DoAssign(rSrcAttr);
33 bool AttributeDiagnoserState::IsDefault(
void)
const {
34 return mDiagnoserStateMap.Empty();
38 void AttributeDiagnoserState::Clear(
void) {
39 mDiagnoserStateMap.Clear();
44 return mDiagnoserStateMap;
49 return &mDiagnoserStateMap;
54 mDiagnoserStateMap = newDiagStateMap;
58 void AttributeDiagnoserState::AddStateLabelMapping(
Idx gstate,
Idx label) {
62 if(mDiagnoserStateMap.Exists(gstate)) {
63 hset = mDiagnoserStateMap.Attribute(gstate);
67 mDiagnoserStateMap.Insert(gstate,hset);
71 void AttributeDiagnoserState::AddStateLabelMap(
Idx gstate,
const DiagLabelSet& labels) {
76 if(mDiagnoserStateMap.Exists(gstate)) {
77 hset = mDiagnoserStateMap.Attribute(gstate);
84 mDiagnoserStateMap.Insert(gstate,hset);
88 string AttributeDiagnoserState::Str(
void)
const {
93 for (it = mDiagnoserStateMap.
Begin(); it != mDiagnoserStateMap.
End(); it++) {
94 label = mDiagnoserStateMap.Attribute(*it);
95 if (it != mDiagnoserStateMap.
Begin()) {
106 bool AttributeDiagnoserState::ExistsState(
Idx state)
const {
107 return mDiagnoserStateMap.Exists(state);
111 void AttributeDiagnoserState::DoWrite(
TokenWriter& rTw,
const std::string& rLabel,
const Type* pContext)
const {
112 if(IsDefault())
return;
113 mDiagnoserStateMap.Write(rTw,
"StateEstimates", pContext);
117 void AttributeDiagnoserState::DoXWrite(
TokenWriter& rTw,
const std::string& rLabel,
const Type* pContext)
const {
118 if(IsDefault())
return;
119 mDiagnoserStateMap.XWrite(rTw,
"TargetStateEstimates", pContext);
123 void AttributeDiagnoserState::DoRead(
TokenReader &rTr,
const std::string &rLabel,
const Type *pContext) {
124 mDiagnoserStateMap.Clear();
128 if(token.
IsBegin(
"StateEstimates"))
129 mDiagnoserStateMap.Read(rTr,
"",pContext);
131 if(token.
IsBegin(
"TargetStateEstimates"))
132 mDiagnoserStateMap.Read(rTr,
"",pContext);
140 if(!mDiagnoserStateMap.EqualAttributes(rOtherAttribute.
mDiagnoserStateMap))
return false;
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)
faudes type implementation macros, overall
Implements state estimates for the current status of the generator.
TaIndexSet< DiagLabelSet > mDiagnoserStateMap
The diagnoser state attribute is a map of state indices of the original generator to their failure la...
Implements the label representation for state estimates.
std::string Str(void) const
Prints mDiagLabels to a string.
NameSet mDiagLabels
Set of diagnoser label names.
bool Insert(const Idx &rIndex)
Add an element by index.
Set of indices with attributes.
A TokenReader reads sequential tokens from a file or string.
bool Peek(Token &token)
Peek next token.
A TokenWriter writes sequential tokens to a file, a string or stdout.
Tokens model atomic data for stream IO.
bool IsBegin(void) const
Test token Type.
Base class of all libFAUDES objects that participate in the run-time interface.
virtual void Name(const std::string &rName)
Set the objects's name.
State estimates for the current status of the generator (as state attributes).
Iterator End(void) const
Iterator to the end of set.
Iterator Begin(void) const
Iterator to the begin of set.
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
std::string ToStringInteger(Int number)
integer to string