diag_attrfailureevents.cppGo to the documentation of this file.00001 /** @file diag_attrfailureevents.cpp 00002 Implements failure and indicator events belonging to a common partition. 00003 */ 00004 00005 #include "diag_attrfailureevents.h" 00006 00007 using namespace std; 00008 00009 namespace faudes { 00010 00011 // faudes type std 00012 FAUDES_TYPE_IMPLEMENTATION(Void,AttributeFailureEvents,AttributeFlags) 00013 00014 // Construct 00015 AttributeFailureEvents::AttributeFailureEvents(void) { 00016 // configure unregistered set type 00017 mFailureEvents.Name("FailureEvents"); 00018 mFailureEvents.TypeName("FailureEvents"); 00019 mFailureEvents.XElementTag("Event"); 00020 mIndicatorEvents.Name("IndicatorEvents"); 00021 mIndicatorEvents.TypeName("IndicatorEvents"); 00022 mIndicatorEvents.XElementTag("Event"); 00023 } 00024 00025 00026 // DoAssign() 00027 void AttributeFailureEvents::DoAssign(const AttributeFailureEvents& rSrcAttr){ 00028 AttributeFlags::DoAssign(rSrcAttr); 00029 mFailureEvents = rSrcAttr.mFailureEvents; 00030 mIndicatorEvents = rSrcAttr.mIndicatorEvents; 00031 } 00032 00033 00034 // Equality 00035 bool AttributeFailureEvents::DoEuqal(const AttributeFailureEvents& rAttr) const { 00036 // test base 00037 if(!AttributeFlags::DoEqual(rAttr)) return false; 00038 // my members 00039 if(mFailureEvents!=rAttr.mFailureEvents) return false; 00040 if(mIndicatorEvents!=rAttr.mIndicatorEvents) return false; 00041 // pass 00042 return true; 00043 } 00044 00045 // IsDefault() 00046 bool AttributeFailureEvents::IsDefault(void) const{ 00047 return (mFailureEvents.Empty() && mIndicatorEvents.Empty()); 00048 } 00049 00050 // Clear() 00051 void AttributeFailureEvents::Clear(void) { 00052 mFailureEvents.Clear(); 00053 mIndicatorEvents.Clear(); 00054 } 00055 00056 // DoWrite() 00057 void AttributeFailureEvents::DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const { 00058 if(IsDefault()) return; 00059 AttributeFlags::DoWrite(rTw,"",pContext); 00060 if(!mFailureEvents.Empty()) 00061 mFailureEvents.Write(rTw,"FailureEvents", pContext); 00062 if(!mIndicatorEvents.Empty()) 00063 mIndicatorEvents.Write(rTw,"IndicatorEvents", pContext); 00064 } 00065 00066 // DoXWrite() 00067 void AttributeFailureEvents::DoXWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const { 00068 if(IsDefault()) return; 00069 AttributeFlags::DoXWrite(rTw,"",pContext); 00070 if(!mFailureEvents.Empty()) 00071 mFailureEvents.XWrite(rTw,"FailureEvents", pContext); 00072 if(!mIndicatorEvents.Empty()) 00073 mIndicatorEvents.XWrite(rTw,"IndicatorEvents", pContext); 00074 } 00075 00076 00077 00078 // DoRead() 00079 void AttributeFailureEvents::DoRead(TokenReader &rTr, const std::string &rLabel, const Type *pContext) { 00080 AttributeFlags::DoRead(rTr,"",pContext); 00081 Token token; 00082 while(1) { 00083 rTr.Peek(token); 00084 if(token.Type()!=Token::Begin) break; 00085 if(token.StringValue()=="FailureEvents") { 00086 mFailureEvents.Read(rTr, "FailureEvents", pContext); 00087 continue; 00088 } 00089 if(token.StringValue()=="IndicatorEvents") { 00090 mIndicatorEvents.Read(rTr, "IndicatorEvents", pContext); 00091 continue; 00092 } 00093 break; 00094 } 00095 } 00096 00097 00098 } // namespace faudes 00099 libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen |