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

MonitoringProfile Class Reference
[Fault Detection Identification and Recovery]

#include <MonitoringProfile.h>

Inheritance diagram for MonitoringProfile:

CC_RootObject DC_DeltaProfile DC_ForbiddenValueProfile DC_NullProfile DC_ProfileList DC_SampleMonitoringProfile DC_SimpleChangeProfile DC_StuckDataProfile RangeProfile List of all members.

Detailed Description

Base class from which all monitoring profile classes are derived.

A monitoring profile encapsulates a profile against which the value of a monitored variable must be checked (monitoring check). Two versions of the monitoring check are offered by this class, one for monitored variables of TD_Float type and one for monitored variables of TD_Integer type.

Monitoring profiles can be enabled or disabled. A monitoring profile that is disabled will always report: "no deviation from profile".

Monitoring profiles can be linked in sequential chains. The client only sees one single monitoring profile (the one at the head of the chain) but its execution can lead to all profiles in the chain being executed in sequence. This class defines a next monitoring profile attribute that holds the pointer to the next monitoring profile in the chain. A monitoring profile reports "no profile violation detected" only if neither itself nor any of the monitoring profiles downstream in the chain of linked profiles report "no profile violation detected".

A violation of a monitoring profile is reported as an event.

This class is abstract because the implementation of the monitoring profile is class-specific and must be defined in the derived classes that implement concrete profiles. The management of the enable status and the reporting of profile violation as events is however performed in this base class.

Todo:
Add an internal variable that to record the reason for the violation and that concrete monitoring profiles can set to indicate how the profile was violated (e.g. violation of upper boundary of a range interval). Clients can then inspect the value of this variable to know the exact reason of the profile violation.

Add a test case to cover the "next monitoring profile" functionality. This could be obtained by modifying the test case of DC_ProfileList.

Monitoring profiles use parameters that are implemented as internal variables. In practice, these parameters will often have to come from the parameter database. Two solutions are possible: generators are used to parameterize the concrete monitoring profiles classes with respect to the mode of implementation of the profile parameters. Or aspect programs are used modify the monitoring profile class as follows: code to set the link to the parameter database is inserted, and code to update the value of the internal parameter with the value read from the parameter database is added at the beginning of method doProfileCheck.

Author:
Alessandro Pasetti

Roberto Totaro

Version:
1.0

Definition at line 67 of file MonitoringProfile.h.

Public Member Functions

 MonitoringProfile (void)
 Instantiate a monitoring profile.

bool deviatesFromProfile (TD_Float value)
 Check whether the value of the monitored variable - passed as an argument to the method - is within the profile encapsulated by the monitoring profile object.

bool deviatesFromProfile (TD_Integer value)
 Version of method deviatesFromProfile() for monitored variables of integer type.

void setEnabled (bool enableStatus)
 Set the enable status of the monitoring profile.

bool isEnabled (void)
 Check the enable status of the monitoring profile.

void setNextMonitoringProfile (MonitoringProfile *pNextMonitoringProfile)
 Set the next monitoring profile.

MonitoringProfilegetNextMonitoringProfile ()
 Get the next monitoring profile.

virtual void reset (void)
 Reset the internal state of the monitoring profile to the value it had immediately after instantiation.


Protected Member Functions

virtual bool doProfileCheck (TD_Float value)=0
 Encapsulate the check of the monitored variable value against the monitoring profile.

virtual bool doProfileCheck (TD_Integer value)=0
 Version of method doProfileCheck() for monitored variables of integer type.


Constructor & Destructor Documentation

MonitoringProfile::MonitoringProfile void   ) 
 

Instantiate a monitoring profile.

The enabled status of the profile is initialized to "enabled". The "next monitoring profile" attribute is set to NULL.

Definition at line 22 of file MonitoringProfile.cpp.


Member Function Documentation

bool MonitoringProfile::deviatesFromProfile TD_Integer  value  ) 
 

Version of method deviatesFromProfile() for monitored variables of integer type.

See also:
deviatesFromProfile

Definition at line 41 of file MonitoringProfile.cpp.

bool MonitoringProfile::deviatesFromProfile TD_Float  value  ) 
 

Check whether the value of the monitored variable - passed as an argument to the method - is within the profile encapsulated by the monitoring profile object.

The check is only done if the monitoring profile object is enabled. If it is disabled, the method returns true indicating that there is no deviation from the profile. After performing the monitoring check encapsulated by this class, it is verified whether there are any linked monitoring checks and, if so, the check value is passed on to them. A return value of "deviation detected" may indicate either that this check has detected a violation or that a violation has been detected by the next monitoring profile in the chain.

A pseudo-code implementation for this method is as follows:

   bool outcome = NO_MON_PROFILE_DEVIATION;
   if ( isEnabled() )
   { if (doProfileCheck(value))
     { createEventReport(EVT_MON_PROFILE_VIOLATION);
       outcome = MON_PROFILE_DEVIATION;
     }
   }
   if ( pNext!=pNULL )     // there is a next monitoring profile 
      if ( next->deviatesFromProfile(value) )
          outcome = MON_PROFILE_DEVIATION;
   return outcome; 
The doProfileCheck() method is abstract and encapsulates the implementation of the profile check. Thus, this class enforces the management of the enabled status and of the "next monitoring profile" but delegates implementation of the monitoring profile check to derived classes implementing concrete profiles. An event is created when deviations from the profile are detected. The event parameter is the class identifier of the monitoring profile object itself.
Parameters:
value the value of the monitored variable
Returns:
true if the monitored variable deviates from the monitoring profile, false otherwise

Definition at line 27 of file MonitoringProfile.cpp.

virtual bool MonitoringProfile::doProfileCheck TD_Integer  value  )  [protected, pure virtual]
 

Version of method doProfileCheck() for monitored variables of integer type.

See also:
doProfileCheck

Implemented in DC_DeltaProfile, DC_ForbiddenValueProfile, DC_NullProfile, DC_ProfileList, DC_SampleMonitoringProfile, DC_SimpleChangeProfile, DC_StuckDataProfile, and RangeProfile.

virtual bool MonitoringProfile::doProfileCheck TD_Float  value  )  [protected, pure virtual]
 

Encapsulate the check of the monitored variable value against the monitoring profile.

This method is called by method deviatesFromProfile() in this same class. User of monitoring profiles do not see method doProfileCheck(), they only see method deviatesFromProfile().

See also:
deviatesFromProfile
Parameters:
value the value of the monitored variable
Returns:
true if the monitored variable deviates from the monitoring profile, false otherwise

Implemented in DC_DeltaProfile, DC_ForbiddenValueProfile, DC_InRangeProfile, DC_NullProfile, DC_OutOfRangeProfile, DC_ProfileList, DC_SampleMonitoringProfile, DC_SimpleChangeProfile, DC_StuckDataProfile, and RangeProfile.

MonitoringProfile * MonitoringProfile::getNextMonitoringProfile  ) 
 

Get the next monitoring profile.

If no monitoring profile has been chained to this one, then a value of pNULL is returned.

See also:
deviatesFromProfile
Returns:
the next monitoring profile

Definition at line 60 of file MonitoringProfile.cpp.

bool MonitoringProfile::isEnabled void   )  [inline]
 

Check the enable status of the monitoring profile.

Returns:
true if the profile is enabled, false otherwise

Definition at line 17 of file MonitoringProfile_inl.h.

void MonitoringProfile::reset void   )  [virtual]
 

Reset the internal state of the monitoring profile to the value it had immediately after instantiation.

Some monitoring profiles need to keep track of past values of the monitored variable and therefore have an internal state. This method allows this internal state to be reset. This class offers a default implementation of this method that does not do anything. Subclasses may need to override this default implementation.

Reimplemented in DC_DeltaProfile, and DC_StuckDataProfile.

Definition at line 64 of file MonitoringProfile.cpp.

void MonitoringProfile::setEnabled bool  enableStatus  )  [inline]
 

Set the enable status of the monitoring profile.

When the profile is disabled, a call to method deviatesFromProfile() always returns "no deviation from profile".

Parameters:
enableStatus if true, then the profile is enabled; if false, then the profile is disabled

Definition at line 13 of file MonitoringProfile_inl.h.

void MonitoringProfile::setNextMonitoringProfile MonitoringProfile pNextMonitoringProfile  ) 
 

Set the next monitoring profile.

See also:
deviatesFromProfile
Parameters:
pNextMonitoringProfile the next monitoring profile

Definition at line 55 of file MonitoringProfile.cpp.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved