|
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 Project Download Mailing lists
|
statusImpl.h00001 /* 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 ORCAICE_STATUS_IMPL_H 00012 #define ORCAICE_STATUS_IMPL_H 00013 00014 #include <memory> 00015 #include <hydroiceutil/localstatus.h> 00016 #include <gbxsickacfr/gbxiceutilacfr/store.h> 00017 #include <gbxsickacfr/gbxiceutilacfr/timer.h> 00018 00019 #include <orca/status.h> 00020 #include <orcaice/topichandler.h> 00021 #include <orcaice/context.h> 00022 00023 // class gbxiceutilacfr::Thread; 00024 00025 namespace orcaice 00026 { 00027 namespace detail 00028 { 00029 00030 class ComponentStatusAggregator; 00031 00032 class StatusImpl : public hydroiceutil::LocalStatus, public IceUtil::Shared 00033 { 00034 friend class StatusI; 00035 00036 public: 00037 StatusImpl( const orcaice::Context& context ); 00038 ~StatusImpl(); 00039 00040 void updateContext( const orcaice::Context& context ) { context_ = context; }; 00041 void initInterface(); 00042 // void initInterface( gbxiceutilacfr::Thread* thread, const std::string& subsysName="", int retryInterval=2 ); 00043 00044 private: 00045 00046 // from LocalStatus 00047 virtual void publishEvent( const hydroiceutil::LocalComponentStatus& componentStatus ); 00048 00049 // remote call implementations, mimic (but do not inherit) the orca interface 00050 ::orca::StatusData internalGetData() const; 00051 IceStorm::TopicPrx internalSubscribe(const ::orca::StatusConsumerPrx&); 00052 00053 gbxiceutilacfr::Store<orca::StatusData> dataStore_; 00054 // we don't need to protect it if we only read from it. 00055 // todo: make a special read-only class. 00056 gbxiceutilacfr::Timer upTimer_; 00057 00058 std::auto_ptr<ComponentStatusAggregator> aggregator_; 00059 00060 typedef TopicHandler<orca::StatusConsumerPrx,orca::StatusData> StatusTopicHandler; 00061 std::auto_ptr<StatusTopicHandler> topicHandler_; 00062 void initTopicHandler(); 00063 00064 // Hang onto this so we can remove from the adapter and control when things get deleted 00065 Ice::ObjectPtr ptr_; 00066 const std::string interfaceName_; 00067 orcaice::Context context_; 00068 }; 00069 00070 typedef IceUtil::Handle<StatusImpl> StatusImplPtr; 00071 00072 } // namespace 00073 } // namespace 00074 00075 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)
1.4.5