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