INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         
subhealth.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_SUBSYSTEM_HEALTH_H
12 #define GBXUTILACFR_SUBSYSTEM_HEALTH_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 
28 namespace gbxutilacfr {
29 
39 class GBXUTILACFR_EXPORT SubHealth
40 {
41 
42 public:
45  SubHealth( Status& sysStatus, const std::string& subsysName ) :
46  status_(sysStatus),
47  subsysName_(subsysName)
48  {};
49 
51  void heartbeat() { status_.heartbeat( subsysName_ ); };
52 
54  void message( const std::string& message ) { status_.message( subsysName_, message ); };
55 
57  void ok( const std::string& message="" ) { status_.ok( subsysName_, message ); };
58 
60  void warning( const std::string& message ) { status_.warning( subsysName_, message ); };
61 
63  void critical( const std::string& message ) { status_.critical( subsysName_, message ); };
64 
66  std::string name() const { return subsysName_; };
67 
68  // Returns system Status object
69 // Status& status() { return status_; };
70 
71 private:
72 
73  Status& status_;
74  std::string subsysName_;
75 };
76 
77 } // namespace
78 
79 #endif
Convenience class which allows feedback on the health of a subsystem.
Definition: subhealth.h:39
std::string name() const
Returns subsystem&#39;s name.
Definition: subhealth.h:66
SubHealth(Status &sysStatus, const std::string &subsysName)
Definition: subhealth.h:45
void ok(const std::string &message="")
Passes this information to the system Status.
Definition: subhealth.h:57
void warning(const std::string &message)
Passes this information to the system Status.
Definition: subhealth.h:60
ACFR utilities.
Definition: gbxnovatelacfr/driver.h:24
void critical(const std::string &message)
Passes this information to the system Status.
Definition: subhealth.h:63
void message(const std::string &message)
Passes this information to the system Status.
Definition: subhealth.h:54
Local interface to component status.
Definition: status.h:253
void heartbeat()
Passes this information to the system Status.
Definition: subhealth.h:51
 

Generated for GearBox by  doxygen 1.4.5