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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

binaryswitchImpl.h

00001 #ifndef ORCA_BINARYSWITCH_IMPL_H
00002 #define ORCA_BINARYSWITCH_IMPL_H
00003 
00004 #include <memory>
00005 #include <orca/binaryswitch.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 AbstractBinarySwitchCallback {
00019 public:
00020     virtual ~AbstractBinarySwitchCallback() {}
00021 
00022     virtual void setData( const orca::BinarySwitchData &data )=0;
00023 };
00024 
00028 class BinarySwitchImpl : public IceUtil::Shared
00029 {
00030 friend class BinarySwitchI;
00031 
00032 public:
00034     BinarySwitchImpl( AbstractBinarySwitchCallback &callback,
00035                       const std::string            &interfaceTag, 
00036                       const orcaice::Context       &context );
00038     BinarySwitchImpl( AbstractBinarySwitchCallback &callback,
00039                       const orcaice::Context       &context,
00040                       const std::string            &interfaceName );
00041     ~BinarySwitchImpl();
00042     
00043     // local functions
00045     void initInterface();
00046 
00049     void initInterface( gbxutilacfr::Stoppable* activity, const std::string& subsysName="", int retryInterval=2 );
00050 
00052     void localSet( const orca::BinarySwitchData& data )
00053     {
00054         dataStore_.set( data );
00055     }
00056 
00059     void localSetAndSend( const orca::BinarySwitchData &data );
00060 
00061 private:
00062     void init();
00063 
00064     // remote call implementations, mimic (but do not inherit) the orca interface
00065     ::orca::BinarySwitchData internalGetData();
00066     IceStorm::TopicPrx internalSubscribe(const orca::BinarySwitchConsumerPrx& subscriber);
00067 
00068     gbxiceutilacfr::Store<orca::BinarySwitchData> dataStore_;
00069 
00070     typedef orcaice::TopicHandler<orca::BinarySwitchConsumerPrx,orca::BinarySwitchData> BinarySwitchTopicHandler;
00071     std::auto_ptr<BinarySwitchTopicHandler> topicHandler_;
00072 
00073     AbstractBinarySwitchCallback &callback_;
00074 
00075     Ice::ObjectPtr ptr_;
00076     const std::string interfaceName_;
00077     orcaice::Context context_;
00078 };
00079 typedef IceUtil::Handle<BinarySwitchImpl> BinarySwitchImplPtr;
00080 
00081 }
00082 
00083 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5