INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         
trivialstatus.h
1 /*
2  * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
3  * http://gearbox.sf.net/
4  * Copyright (c) 2004-2010 Alex Brooks, Alexei Makarenko, Tobias Kaupp
5  *
6  * This distribution is licensed to you under the terms described in
7  * the LICENSE file included in this distribution.
8  *
9  */
10 
11 #ifndef GBXUTILACFR_TRIVIAL_STATUS_H
12 #define GBXUTILACFR_TRIVIAL_STATUS_H
13 
14 #if defined (WIN32)
15  #if defined (GBXUTILACFR_STATIC)
16  #define GBXUTILACFR_EXPORT
17  #elif defined (GBXUTILACFR_EXPORTS)
18  #define GBXUTILACFR_EXPORT __declspec (dllexport)
19  #else
20  #define GBXUTILACFR_EXPORT __declspec (dllimport)
21  #endif
22 #else
23  #define GBXUTILACFR_EXPORT
24 #endif
25 
26 #include <gbxutilacfr/status.h>
27 #include <gbxutilacfr/tracer.h>
28 
29 namespace gbxutilacfr {
30 
31 
39 class GBXUTILACFR_EXPORT TrivialStatus : public Status
40 {
41 public:
42 
43  TrivialStatus( Tracer& tracer,
44  bool stateChange=true, bool ok=false, bool warn=true, bool fault=true, bool heartbeat=false );
45 
46  virtual void addSubsystem( const std::string& subsystem,
47  double maxHeartbeatIntervalSec=-1.0, SubsystemType type=SubsystemStandard );
48  virtual void removeSubsystem( const std::string& subsystem );
50  virtual std::vector<std::string> subsystems();
52  virtual SubsystemStatus subsystemStatus( const std::string& subsystem );
55  virtual ComponentStatus componentStatus();
56  virtual void setMaxHeartbeatInterval( const std::string& subsystem, double interval );
57  virtual void setSubsystemType( const std::string& subsystem, SubsystemType type );
58 
59  virtual void setSubsystemStatus( const std::string& subsystem, SubsystemState state, SubsystemHealth health, const std::string& msg="" );
60 
61  virtual void initialising( const std::string& subsystem );
62  virtual void working( const std::string& subsystem );
63  virtual void finalising( const std::string& subsystem );
64  virtual void fault( const std::string& subsystem, const std::string& msg );
65 
66  virtual void ok( const std::string& subsystem, const std::string& msg="" );
67  virtual void warning( const std::string& subsystem, const std::string& msg );
68  virtual void critical( const std::string& subsystem, const std::string& msg );
69 
70  virtual void heartbeat( const std::string& subsystem );
71  virtual void message( const std::string& subsystem, const std::string& msg );
72 
73  virtual void process();
74 
75 private:
76 
77  void internalSetStatus( const std::string& subsystem, gbxutilacfr::SubsystemState state,
78  gbxutilacfr::SubsystemHealth health, const std::string& msg )
79  { internalSetStatus(subsystem,state,health,true,msg); };
80 
81  void internalSetStatus( const std::string& subsystem, gbxutilacfr::SubsystemState state,
83  { internalSetStatus(subsystem,state,health,false,""); };
84 
85  void internalSetStatus( const std::string& subsystem, gbxutilacfr::SubsystemState state,
86  gbxutilacfr::SubsystemHealth health, bool hasMessage, const std::string& msg );
87 
88  Tracer& tracer_;
89 
90  bool stateChange_;
91  bool ok_;
92  bool warn_;
93  bool fault_;
94  bool heartbeat_;
95 };
96 
97 } // namespace
98 
99 #endif
SubsystemHealth
Possible subsystem status values.
Definition: status.h:52
Status of a single component.
Definition: status.h:150
A trivial implementation of the status API which does not assemble information.
Definition: trivialstatus.h:39
SubsystemState
Possible subsystem status values.
Definition: status.h:32
Local and remote tracing.
Definition: tracer.h:111
SubsystemType
Subsystem type which describes common behavior models of a subsystem.
Definition: status.h:100
ACFR utilities.
Definition: gbxnovatelacfr/driver.h:24
Local interface to component status.
Definition: status.h:253
Standard model: subsystem&#39;s life cycle is equal to the life cycle of the component.
Definition: status.h:103
Status for a single subsystem.
Definition: status.h:66
 

Generated for GearBox by  doxygen 1.4.5