diag_attrfailureevents.cpp
Go to the documentation of this file.
1/** @file diag_attrfailureevents.cpp
2 Implements failure and indicator events belonging to a common partition.
3*/
4
6
7using namespace std;
8
9namespace faudes {
10
11// faudes type std
12FAUDES_TYPE_IMPLEMENTATION(Void,AttributeFailureEvents,AttributeFlags)
13
14// Construct
16 // configure unregistered set type
17 mFailureEvents.Name("FailureEvents");
18 mFailureEvents.TypeName("FailureEvents");
19 mFailureEvents.ElementTag("Event");
20 mIndicatorEvents.Name("IndicatorEvents");
21 mIndicatorEvents.TypeName("IndicatorEvents");
22 mIndicatorEvents.ElementTag("Event");
23}
24
25// Copy Construct
29
30// DoCopy()
36
37// DoCopy()
43
44
45// Equality
47 // test base
48 if(!AttributeFlags::DoEqual(rAttr)) return false;
49 // my members
50 if(mFailureEvents!=rAttr.mFailureEvents) return false;
51 if(mIndicatorEvents!=rAttr.mIndicatorEvents) return false;
52 // pass
53 return true;
54}
55
56// IsDefault()
60
61// Clear()
66
67// DoWrite()
68void AttributeFailureEvents::DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
69 if(IsDefault()) return;
70 AttributeFlags::DoWrite(rTw,"",pContext);
72 mFailureEvents.Write(rTw,"FailureEvents", pContext);
74 mIndicatorEvents.Write(rTw,"IndicatorEvents", pContext);
75}
76
77// DoXWrite()
78void AttributeFailureEvents::DoXWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
79 if(IsDefault()) return;
80 AttributeFlags::DoXWrite(rTw,"",pContext);
82 mFailureEvents.XWrite(rTw,"FailureEvents", pContext);
84 mIndicatorEvents.XWrite(rTw,"IndicatorEvents", pContext);
85}
86
87
88
89// DoRead()
90void AttributeFailureEvents::DoRead(TokenReader &rTr, const std::string &rLabel, const Type *pContext) {
91 AttributeFlags::DoRead(rTr,"",pContext);
92 Token token;
93 while(1) {
94 rTr.Peek(token);
95 if(token.Type()!=Token::Begin) break;
96 if(token.StringValue()=="FailureEvents") {
97 mFailureEvents.Read(rTr, "FailureEvents", pContext);
98 continue;
99 }
100 if(token.StringValue()=="IndicatorEvents") {
101 mIndicatorEvents.Read(rTr, "IndicatorEvents", pContext);
102 continue;
103 }
104 break;
105 }
106}
107
108
109} // namespace faudes
110
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)
Definition cfl_types.h:1017
bool DoEuqal(const AttributeFailureEvents &rAttr) const
void DoMove(AttributeFailureEvents &rSrcAttr)
void DoCopy(const AttributeFailureEvents &rSrcAttr)
void DoWrite(TokenWriter &rTw, const std::string &rLabel, const Type *pContext) const
void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
void DoXWrite(TokenWriter &rTw, const std::string &rLabel, const Type *pContext) const
bool DoEqual(const AttributeFlags &rOther) const
virtual void DoXWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
virtual void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
virtual void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
void DoCopy(const AttributeFlags &rSrcAttr)
bool Peek(Token &token)
const std::string & StringValue(void) const
@ Begin
<label> (begin of section)
Definition cfl_token.h:84
TokenType Type(void) const
virtual void Name(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)

libFAUDES 2.34e --- 2026.03.16 --- c++ api documentaion by doxygen