orca-robotics


INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

REPOSITORY
Interfaces
Components
Libraries
Utilities
Software Map

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard
Wiki
login/pass: orca/orca

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

componentmonitor.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
00005  *
00006  * This copy of Orca is licensed to you under the terms described in
00007  * the LICENSE file included in this distribution.
00008  *
00009  */
00010  
00011 #ifndef COMPONENT_MONITOR
00012 #define COMPONENT_MONITOR
00013 
00014 #include <iostream>
00015 #include <hydroiceutil/jobqueue.h>
00016 
00017 #include <orca/systemstatus.h>
00018 #include "statusconsumerImpl.h"
00019 
00020 using namespace std;
00021 
00022 namespace systemstatus {
00023     
00024 //
00025 // Monitors individual component's status interface
00026 // Wraps up the StatusConsumer interface
00027 //
00028 // Author: Tobias Kaupp
00029 //
00030 class ComponentMonitor
00031 {
00032     public:
00033         ComponentMonitor( hydroiceutil::JobQueuePtr  jobQueue,
00034                           const std::string         &platformName,
00035                           const std::string         &componentName,
00036                           const orcaice::Context    &context );
00037         ~ComponentMonitor();
00038         
00039         // Get the current component status
00040         void getComponentStatus( orca::ObservedComponentStatus &obsCompStat );
00041         
00042     private:
00043         orca::ObservedComponentState currentState_;
00044         hydroiceutil::JobQueuePtr jobQueue_;
00045         std::string platformName_;
00046         std::string componentName_;
00047         orcaice::Context context_;
00048         StatusConsumerImplPtr statusConsumer_;
00049         
00050         // set the component state based on what we observe locally
00051         void setObservedState( orca::ObservedComponentStatus &obsCompStat );
00052         
00053         // set the component state based on information reported by the Status interface
00054         void setReportedState( const StatusDetails           &statDetails,
00055                                orca::ObservedComponentStatus &obsCompStat );
00056         
00057         void addSubscribeJob();
00058         
00059         bool isHomeInterfaceReachable();
00060         
00061 };
00062 
00063 
00064 }
00065 
00066 #endif
00067 
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5