|
From: <rus...@us...> - 2009-05-01 21:25:24
|
Revision: 398
http://gearbox.svn.sourceforge.net/gearbox/?rev=398&view=rev
Author: russo2503v
Date: 2009-05-01 21:25:23 +0000 (Fri, 01 May 2009)
Log Message:
-----------
added missing files 2
Added Paths:
-----------
gearbox/trunk/src/gbxutilacfr/subhealth.h
Added: gearbox/trunk/src/gbxutilacfr/subhealth.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/subhealth.h (rev 0)
+++ gearbox/trunk/src/gbxutilacfr/subhealth.h 2009-05-01 21:25:23 UTC (rev 398)
@@ -0,0 +1,67 @@
+/*
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * http://gearbox.sf.net/
+ * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ *
+ * This distribution is licensed to you under the terms described in
+ * the LICENSE file included in this distribution.
+ *
+ */
+
+#ifndef GBXUTILACFR_SUBSYSTEM_HEALTH_H
+#define GBXUTILACFR_SUBSYSTEM_HEALTH_H
+
+#include <gbxutilacfr/status.h>
+
+namespace gbxutilacfr {
+
+//!
+//! @brief Convenience class which allows feedback on the health of a subsystem.
+//!
+//! @par Overview
+//!
+//! Provides a convenient interface for setting health information for one subsystem.
+//!
+//! @sa Status, SubsystemStatus
+//!
+class SubHealth
+{
+
+public:
+ //! Sets a reference to the system Status and this subsystem's name.
+ //! Adds this subsystem to the system.
+ SubHealth( Status& sysStatus, const std::string& subsysName ) :
+ status_(sysStatus),
+ subsysName_(subsysName)
+ {};
+
+ //! Passes this information to the system Status.
+ void heartbeat() { status_.heartbeat( subsysName_ ); };
+
+ //! Passes this information to the system Status.
+ void message( const std::string& message ) { status_.message( subsysName_, message ); };
+
+ //! Passes this information to the system Status.
+ void ok( const std::string& message="" ) { status_.ok( subsysName_, message ); };
+
+ //! Passes this information to the system Status.
+ void warning( const std::string& message ) { status_.warning( subsysName_, message ); };
+
+ //! Passes this information to the system Status.
+ void fault( const std::string& message ) { status_.fault( subsysName_, message ); };
+
+ //! Returns subsystem's name
+ std::string name() const { return subsysName_; };
+
+ // Returns system Status object
+// Status& status() { return status_; };
+
+private:
+
+ Status& status_;
+ std::string subsysName_;
+};
+
+} // namespace
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|