INTRODUCTION Overview Download and Install Documentation Publications REPOSITORY Libraries DEVELOPER Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
substatus.h00001 /* 00002 * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics 00003 * http://gearbox.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This distribution is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef GBXUTILACFR_SUBSYSTEM_STATUS_H 00012 #define GBXUTILACFR_SUBSYSTEM_STATUS_H 00013 00014 #include <gbxutilacfr/status.h> 00015 00016 namespace gbxutilacfr { 00017 00032 class SubStatus 00033 { 00034 00035 public: 00038 SubStatus( Status& status, const std::string& subsystem ) : 00039 status_(status), 00040 subsysName_(subsystem) 00041 { 00042 status_.addSubsystem( subsysName_ ); 00043 }; 00044 00046 ~SubStatus() 00047 { 00048 status_.removeSubsystem( subsysName_ ); 00049 } 00050 00052 void setMaxHeartbeatInterval( double interval ) { status_.setMaxHeartbeatInterval( subsysName_, interval ); }; 00053 00055 void heartbeat() { status_.heartbeat( subsysName_ ); }; 00056 00058 void initialising( const std::string& message="" ) { status_.initialising( subsysName_, message ); }; 00059 00061 void ok( const std::string& message="" ) { status_.ok( subsysName_, message ); }; 00062 00064 void warning( const std::string& message ) { status_.warning( subsysName_, message ); }; 00065 00067 void fault( const std::string& message ) { status_.fault( subsysName_, message ); }; 00068 00070 std::string name() const { return subsysName_; }; 00071 private: 00072 00073 Status& status_; 00074 std::string subsysName_; 00075 }; 00076 00077 } // namespace 00078 00079 #endif |