Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

DC_StuckDataProfile.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // DC_StuckDataProfile.cpp 00005 // 00006 // Version 1.1 00007 // Date 07.01.03 (Version 1.0) 00008 // 01.10.03 (Version 1.1) 00009 // Author A. Pasetti (P&P Software), R. Totaro 00010 // 00011 // Change Record: 00012 // Version 1.1: replaced double and int with TD_Float and TD_Integer 00013 00014 #include "../GeneralInclude/CompilerSwitches.h" 00015 #include "../GeneralInclude/DebugSupport.h" 00016 #include "../GeneralInclude/Constants.h" 00017 #include "../GeneralInclude/ClassId.h" 00018 #include "DC_StuckDataProfile.h" 00019 00020 DC_StuckDataProfile::DC_StuckDataProfile(void) { 00021 setClassId(ID_STUCKDATAPROFILE); 00022 stuckThreshold = 0; 00023 reset(); 00024 } 00025 00026 bool DC_StuckDataProfile::doProfileCheck(TD_Float value) { 00027 assert(false); 00028 return MON_PROFILE_DEVIATION; 00029 } 00030 00031 bool DC_StuckDataProfile::doProfileCheck(TD_Integer value) { 00032 assert(counter<(stuckThreshold+1)); 00033 00034 if (value!=previousValue) { 00035 counter=0; 00036 previousValue=value; 00037 } 00038 else { 00039 counter++; 00040 00041 if (counter==stuckThreshold) { 00042 counter=0; 00043 return MON_PROFILE_DEVIATION; 00044 } 00045 } 00046 00047 return NO_MON_PROFILE_DEVIATION; 00048 } 00049 00050 void DC_StuckDataProfile::setStuckThreshold(unsigned int stuckThreshold) { 00051 this->stuckThreshold = stuckThreshold; 00052 } 00053 00054 unsigned int DC_StuckDataProfile::getStuckThreshold(void) const { 00055 return stuckThreshold; 00056 } 00057 00058 void DC_StuckDataProfile::reset(void) { 00059 counter = 0; 00060 previousValue = PREVIOUS_VALUE_INIT; 00061 } 00062 00063 bool DC_StuckDataProfile::isObjectConfigured(void) { 00064 return (MonitoringProfile::isObjectConfigured() && stuckThreshold>0); 00065 }
Copyright 2003 P&P Software GmbH - All Rights Reserved