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
|
estopImpl.h00001 #ifndef ORCA_ESTOP_IMPL_H 00002 #define ORCA_ESTOP_IMPL_H 00003 00004 #include <memory> 00005 #include <orca/estop.h> 00006 #include <gbxsickacfr/gbxiceutilacfr/store.h> 00007 #include <orcaice/context.h> 00008 #include <orcaice/topichandler.h> 00009 00010 namespace gbxutilacfr { class Stoppable; } 00011 00012 namespace orcaifaceimpl 00013 { 00014 00018 class AbstractEStopCallback { 00019 public: 00020 virtual ~AbstractEStopCallback() {} 00021 00022 virtual void setEnabled( bool enabled )=0; 00023 }; 00024 00028 class EStopImpl : public IceUtil::Shared 00029 { 00030 friend class EStopI; 00031 00032 public: 00034 EStopImpl( AbstractEStopCallback &callback, 00035 const orca::EStopDescription &descr, 00036 const std::string &interfaceTag, 00037 const orcaice::Context &context ); 00039 EStopImpl( AbstractEStopCallback &callback, 00040 const orca::EStopDescription &descr, 00041 const orcaice::Context &context, 00042 const std::string &interfaceName ); 00043 ~EStopImpl(); 00044 00045 // local functions 00047 void initInterface(); 00048 00051 void initInterface( gbxutilacfr::Stoppable* activity, const std::string& subsysName="", int retryInterval=2 ); 00052 00054 void localSet( const orca::EStopData& data ) 00055 { 00056 dataStore_.set( data ); 00057 } 00058 00059 orca::EStopDescription getDescription() const 00060 { return description_; } 00061 00064 void localSetAndSend( const orca::EStopData &data ); 00065 00066 private: 00067 void init(); 00068 00069 // remote call implementations, mimic (but do not inherit) the orca interface 00070 orca::EStopDescription internalGetDescription() const 00071 { return description_; } 00072 ::orca::EStopData internalGetData(); 00073 IceStorm::TopicPrx internalSubscribe(const orca::EStopConsumerPrx& subscriber); 00074 00075 gbxiceutilacfr::Store<orca::EStopData> dataStore_; 00076 00077 typedef orcaice::TopicHandler<orca::EStopConsumerPrx,orca::EStopData> EStopTopicHandler; 00078 std::auto_ptr<EStopTopicHandler> topicHandler_; 00079 00080 AbstractEStopCallback &callback_; 00081 const orca::EStopDescription description_; 00082 00083 Ice::ObjectPtr ptr_; 00084 const std::string interfaceName_; 00085 orcaice::Context context_; 00086 }; 00087 typedef IceUtil::Handle<EStopImpl> EStopImplPtr; 00088 00089 } 00090 00091 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)