INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         
gbxutilacfr::TrivialStatus Class Reference

A trivial implementation of the status API which does not assemble information. More...

#include <trivialstatus.h>

Inheritance diagram for gbxutilacfr::TrivialStatus:
Inheritance graph

Public Member Functions

virtual void addSubsystem (const std::string &subsystem, double maxHeartbeatIntervalSec=-1.0, SubsystemType type=SubsystemStandard)
 
virtual void removeSubsystem (const std::string &subsystem)
 
virtual std::vector< std::string > subsystems ()
 Does not keep track of subsystems, returns empty vector.
 
virtual SubsystemStatus subsystemStatus (const std::string &subsystem)
 Does not keep track of status, throws Exception on any query.
 
virtual ComponentStatus componentStatus ()
 
virtual void setMaxHeartbeatInterval (const std::string &subsystem, double interval)
 
virtual void setSubsystemType (const std::string &subsystem, SubsystemType type)
 Sets the subsystem type which describes the expected behavior of the subsystem.
 
virtual void setSubsystemStatus (const std::string &subsystem, SubsystemState state, SubsystemHealth health, const std::string &msg="")
 
virtual void initialising (const std::string &subsystem)
 
virtual void working (const std::string &subsystem)
 
virtual void finalising (const std::string &subsystem)
 
virtual void fault (const std::string &subsystem, const std::string &msg)
 
virtual void ok (const std::string &subsystem, const std::string &msg="")
 
virtual void warning (const std::string &subsystem, const std::string &msg)
 
virtual void critical (const std::string &subsystem, const std::string &msg)
 
virtual void heartbeat (const std::string &subsystem)
 
virtual void message (const std::string &subsystem, const std::string &msg)
 
virtual void process ()
 

Detailed Description

A trivial implementation of the status API which does not assemble information.

System status information is not assembled but all changes are traced to Tracer.

See also
Status

Member Function Documentation

◆ addSubsystem()

void gbxutilacfr::TrivialStatus::addSubsystem ( const std::string & subsystem,
double maxHeartbeatIntervalSec = -1.0,
SubsystemType type = SubsystemStandard )
virtual

Adds a new subsystem to the system status descriptor. This command must be called before actually modifying the subsystem status, i.e. all other status commands will raise an exception if a subsystem with that name does not already exists.

An Exception is also raised when trying to add a subsystem with an existing name.

It is possible to specify the maximum expected interval between heartbeats. See setMaxHeartbeatInterval() for details.

It is also possible to describe the expected behavior of the subsystem by specifying SubsystemType. See setSubsystemType() for details.

The initial status of the new subsystem is the same as produced by the empty constructor of SubsystemStatus.

Implements gbxutilacfr::Status.

References addSubsystem().

Referenced by addSubsystem().

◆ componentStatus()

ComponentStatus gbxutilacfr::TrivialStatus::componentStatus ( )
virtual

Does not keep track of individual subsystems and therefore cannot determine component status. Always throws Exception.

Implements gbxutilacfr::Status.

References componentStatus().

Referenced by componentStatus().

◆ critical()

void gbxutilacfr::TrivialStatus::critical ( const std::string & subsystem,
const std::string & message )
virtual

Sets subsystem health to Critical. Diagnostic message is required. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References critical(), and gbxutilacfr::SubsystemCritical.

Referenced by critical().

◆ fault()

void gbxutilacfr::TrivialStatus::fault ( const std::string & subsystem,
const std::string & message )
virtual

Sets state of the subsystem to Fault. Diagnostic message is required. Subsystem health is automatically changed to Critical. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References fault(), gbxutilacfr::SubsystemCritical, and gbxutilacfr::SubsystemFault.

Referenced by fault().

◆ finalising()

void gbxutilacfr::TrivialStatus::finalising ( const std::string & subsystem)
virtual

Sets state of the subsystem to Finalising. Health and message are not affected. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References finalising(), and gbxutilacfr::SubsystemFinalising.

Referenced by finalising().

◆ heartbeat()

void gbxutilacfr::TrivialStatus::heartbeat ( const std::string & subsystem)
virtual

Record heartbeat from a subsystem: let Status know the subsystem is alive without modifying its status. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References heartbeat().

Referenced by heartbeat().

◆ initialising()

void gbxutilacfr::TrivialStatus::initialising ( const std::string & subsystem)
virtual

Sets state of the subsystem to Initialising. Health and message are not affected. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References initialising(), and gbxutilacfr::SubsystemInitialising.

Referenced by initialising().

◆ message()

void gbxutilacfr::TrivialStatus::message ( const std::string & subsystem,
const std::string & message )
virtual

Change the human-readable message for a subsystem but keep the previous state and health information. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References message().

Referenced by message().

◆ ok()

void gbxutilacfr::TrivialStatus::ok ( const std::string & subsystem,
const std::string & message = "" )
virtual

Sets subsystem health to Ok. The old message is cleared if a new one is not supplied. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References ok(), and gbxutilacfr::SubsystemOk.

Referenced by ok().

◆ process()

void gbxutilacfr::TrivialStatus::process ( )
virtual

This function must be called periodically in order for status publishing to happen and stalled susbsystems identified.

Implements gbxutilacfr::Status.

References process().

Referenced by process().

◆ removeSubsystem()

void gbxutilacfr::TrivialStatus::removeSubsystem ( const std::string & subsystem)
virtual

Removes a subsystem from the status descriptor. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References removeSubsystem().

Referenced by removeSubsystem().

◆ setMaxHeartbeatInterval()

void gbxutilacfr::TrivialStatus::setMaxHeartbeatInterval ( const std::string & subsystem,
double intervalSec )
virtual

Sets the maximum expected interval between heartbeats (in seconds). When time since the last heartbeat exceeds the specified value, the subsystem is considered stalled. Negative interval means infinite interval. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References setMaxHeartbeatInterval().

Referenced by setMaxHeartbeatInterval().

◆ setSubsystemStatus()

void gbxutilacfr::TrivialStatus::setSubsystemStatus ( const std::string & subsystem,
SubsystemState state,
SubsystemHealth health,
const std::string & message = "" )
virtual

Sets the status of a subsystem (both state and health) in an atomic operation. Use this method when both state and health have changed. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References setSubsystemStatus().

Referenced by setSubsystemStatus().

◆ warning()

void gbxutilacfr::TrivialStatus::warning ( const std::string & subsystem,
const std::string & message )
virtual

Sets subsystem health to Warning. Diagnostic message is required. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References gbxutilacfr::SubsystemWarning, and warning().

Referenced by warning().

◆ working()

void gbxutilacfr::TrivialStatus::working ( const std::string & subsystem)
virtual

Sets state of the subsystem to Working. Health and message are not affected. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References gbxutilacfr::SubsystemWorking, and working().

Referenced by working().


The documentation for this class was generated from the following files:
 

Generated for GearBox by  doxygen 1.4.5