INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
components/systemstatus/statusconsumerImpl.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 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 STATUS_CONSUMER_IMPL_H 00012 #define STATUS_CONSUMER_IMPL_H 00013 00014 #include <orcasystemstatusutil/statusconsumerImpl.h> 00015 #include <gbxsickacfr/gbxiceutilacfr/store.h> 00016 00017 namespace systemstatus { 00018 00019 class StatusConsumerImpl : public orcasystemstatusutil::StatusConsumerImpl 00020 { 00021 public: 00022 00023 // Platform and component names are different from the ones in the context! 00024 StatusConsumerImpl( const orca::FQComponentName& fqCompName, 00025 const Config& config, 00026 const orcaice::Context& context ); 00027 00028 // thread-safe access to the latest available estimated component status 00029 orca::EstimatedComponentStatus estimatedStatus(); 00030 00031 // thread-safe acess to the state which remember if resubscribe has been requested. 00032 // Default behavior of this function is to turn the state off if it's on. I.e. a repeat 00033 // call will return FALSE (assuming that another request has not been filed). 00034 bool isResubscribeRequested( bool turnOffIfOn=true ); 00035 00036 protected: 00037 00038 // generated events 00039 virtual void estimateChangedEvent( const orca::EstimatedComponentStatus& ); 00040 virtual void resubscribeRequestedEvent( const orca::EstimatedComponentStatus& status ); 00041 00042 private: 00043 00044 gbxiceutilacfr::Store<orca::EstimatedComponentStatus> estCompStatus_; 00045 00046 // there's a small change of missing a repeat request to resubscribe (see 00047 // comments in the code). it's not important in this case. 00048 gbxiceutilacfr::Store<bool> resubscribeRequest_; 00049 00050 }; 00051 typedef IceUtil::Handle<StatusConsumerImpl> StatusConsumerImplPtr; 00052 00053 } 00054 00055 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)