libFAUDES
Sections
Index
|
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 // DoAssign() 00015 void AttributeFailureEvents::DoAssign(const AttributeFailureEvents& rSrcAttr){ 00016 AttributeFlags::DoAssign(rSrcAttr); 00017 mFailureEvents = rSrcAttr.mFailureEvents; 00018 mIndicatorEvents = rSrcAttr.mIndicatorEvents; 00019 } 00020 00021 00022 // Equality 00023 bool AttributeFailureEvents::DoEuqal(const AttributeFailureEvents& rAttr) const { 00024 // test base 00025 if(!AttributeFlags::DoEqual(rAttr)) return false; 00026 // my members 00027 if(mFailureEvents!=rAttr.mFailureEvents) return false; 00028 if(mIndicatorEvents!=rAttr.mIndicatorEvents) return false; 00029 // pass 00030 return true; 00031 } 00032 00033 // IsDefault() 00034 bool AttributeFailureEvents::IsDefault(void) const{ 00035 return (mFailureEvents.Empty() && mIndicatorEvents.Empty()); 00036 } 00037 00038 // Clear() 00039 void AttributeFailureEvents::Clear(void) { 00040 mFailureEvents.Clear(); 00041 mIndicatorEvents.Clear(); 00042 } 00043 00044 // DoWrite() 00045 void AttributeFailureEvents::DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const { 00046 if(IsDefault()) return; 00047 AttributeFlags::DoWrite(rTw,"",pContext); 00048 if(!mFailureEvents.Empty()) 00049 mFailureEvents.Write(rTw,"FailureEvents", pContext); 00050 if(!mIndicatorEvents.Empty()) 00051 mIndicatorEvents.Write(rTw,"IndicatorEvents", pContext); 00052 } 00053 00054 // DoRead() 00055 void AttributeFailureEvents::DoRead(TokenReader &rTr, const std::string &rLabel, const Type *pContext) { 00056 AttributeFlags::DoRead(rTr,"",pContext); 00057 Token token; 00058 while(1) { 00059 rTr.Peek(token); 00060 if(token.Type()!=Token::Begin) break; 00061 if(token.StringValue()=="FailureEvents") { 00062 mFailureEvents.Read(rTr, "FailureEvents", pContext); 00063 continue; 00064 } 00065 if(token.StringValue()=="IndicatorEvents") { 00066 mIndicatorEvents.Read(rTr, "IndicatorEvents", pContext); 00067 continue; 00068 } 00069 break; 00070 } 00071 } 00072 00073 00074 } // namespace faudes 00075 |
libFAUDES 2.20d --- 2011.04.26 --- c++ source docu by doxygen