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

 

         

orcaifaceimpl::ConsumerImpl< ProviderType, ConsumerType, ObjectType, ConsumerTypeIType > Class Template Reference

#include <consumerImpl.h>

Inherits orcaifaceimpl::ConsumerSubscriber, and orcaifaceimpl::AbstractConsumer< ObjectType >.

Inherited by orcalog::GenericAutoLogger< orca::DriveBicycle, orca::DriveBicycleConsumer, orca::DriveBicycleData, DriveBicycleLogWriter >, orcalog::GenericAutoLogger< orca::Gps, orca::GpsConsumer, orca::GpsData, GpsLogWriter >, orcalog::GenericAutoLogger< orca::Image, orca::ImageConsumer, orca::ImageDataPtr, ImageLogWriter >, orcalog::GenericAutoLogger< orca::Localise2d, orca::Localise2dConsumer, orca::Localise2dData, Localise2dLogWriter >, orcalog::GenericAutoLogger< orca::Localise3d, orca::Localise3dConsumer, orca::Localise3dData, Localise3dLogWriter >, orcalog::GenericAutoLogger< orca::MultiCamera, orca::MultiCameraConsumer, orca::MultiCameraDataPtr, MultiCameraLogWriter >, orcalog::GenericAutoLogger< orca::Odometry2d, orca::Odometry2dConsumer, orca::Odometry2dData, Odometry2dLogWriter >, orcalog::GenericAutoLogger< orca::Odometry3d, orca::Odometry3dConsumer, orca::Odometry3dData, Odometry3dLogWriter >, orcalog::GenericSnapshotLogger< orca::DriveBicycle, orca::DriveBicycleConsumer, orca::DriveBicycleData, DriveBicycleLogWriter >, orcalog::GenericSnapshotLogger< orca::Gps, orca::GpsConsumer, orca::GpsData, GpsLogWriter >, orcalog::GenericSnapshotLogger< orca::Localise2d, orca::Localise2dConsumer, orca::Localise2dData, Localise2dLogWriter >, orcalog::GenericSnapshotLogger< orca::Localise3d, orca::Localise3dConsumer, orca::Localise3dData, Localise3dLogWriter >, orcalog::GenericSnapshotLogger< orca::Odometry2d, orca::Odometry2dConsumer, orca::Odometry2dData, Odometry2dLogWriter >, orcalog::GenericSnapshotLogger< orca::Odometry3d, orca::Odometry3dConsumer, orca::Odometry3dData, Odometry3dLogWriter >, orcaifaceimpl::BufferedConsumerImpl< ProviderType, ConsumerType, ObjectType, ConsumerTypeIType >, orcaifaceimpl::NotifyingConsumerImpl< ProviderType, ConsumerType, ObjectType, ConsumerTypeIType >, orcaifaceimpl::StoringConsumerImpl< ProviderType, ConsumerType, ObjectType, ConsumerTypeIType >, and orcalogfactory::PathFollower2dAutoLogger.

List of all members.

Public Member Functions

 ConsumerImpl (const orcaice::Context &context)
 Constructor creates consumer interface object. Does not contain any remote calls.
ConsumerPrxType consumerPrx () const
 Access the proxy to the internal consumer interface implementation.
orcaice::Contextcontext ()
 Access to the context.
virtual void dataEvent (const ObjectType &data)
virtual void subscribeWithString (const std::string &proxyString)
virtual void unsubscribe ()
virtual bool subscribeWithString (const std::string &proxyString, gbxutilacfr::Stoppable *activity, const std::string &subsysName="", int retryIntervalSec=2, int retryNumber=-1)

Protected Attributes

ConsumerPrxType consumerPrx_
 Proxy to the internal consumer interface implementation.
Ice::ObjectPtr consumerPtr_
 Hang onto this so we can remove from the adapter and control when things get deleted.

Detailed Description

template<class ProviderType, class ConsumerType, class ObjectType, class ConsumerTypeIType = ConsumerTypeI<ConsumerType,ObjectType>>
class orcaifaceimpl::ConsumerImpl< ProviderType, ConsumerType, ObjectType, ConsumerTypeIType >

A generic consumer: instantiates and looks after a consumerI, i.e. adds it to/removes it from the adapter.

Derived classes need to implement the dataEvent() callback function which is called when the new data arrives.

This consumer itself. In the constructor it adds itself to the adapter and subscribes for data updates. In the destructor it removes itself from the adapter and unsubscribes from future data updates. There's still a small chance that IceStorm will report an error when data delivery and unsubscription are closely spaced, e.g. ('ast' in 'status/ast' means asterisk, replaced to avoid compiler warning):

Oct 25 03:26:47 tango /usr/bin/icebox[2474]: Topic: status/ast@tango/localnav: subscribeAndGetPublisher: 07394FBF-586C-4128-AA28-1727B9DA2E19 QoS:  subscriptions: []
Oct 25 03:26:49 tango /usr/bin/icebox[2474]: Topic: status/ast@tango/localnav: unsubscribe: 07394FBF-586C-4128-AA28-1727B9DA2E19[07394FBF-586C-4128-AA28-1727B9DA2E19]
Oct 25 03:26:49 tango /usr/bin/icebox[2474]: Subscriber: 0x81182e0 07394FBF-586C-4128-AA28-1727B9DA2E19: subscriber errored out: OutgoingAsync.cpp:305: Ice::ObjectNotExistException: object does not exist: identity: `07394FBF-586C-4128-AA28-1727B9DA2E19' facet:  operation: setData retry: 0/0

Member Function Documentation

template<class ProviderType, class ConsumerType, class ObjectType, class ConsumerTypeIType = ConsumerTypeI<ConsumerType,ObjectType>>
virtual void orcaifaceimpl::ConsumerImpl< ProviderType, ConsumerType, ObjectType, ConsumerTypeIType >::dataEvent ( const ObjectType &  data  )  [inline, virtual]
template<class ProviderType, class ConsumerType, class ObjectType, class ConsumerTypeIType = ConsumerTypeI<ConsumerType,ObjectType>>
virtual bool orcaifaceimpl::ConsumerImpl< ProviderType, ConsumerType, ObjectType, ConsumerTypeIType >::subscribeWithString ( const std::string &  proxyString,
gbxutilacfr::Stoppable *  activity,
const std::string &  subsysName = "",
int  retryIntervalSec = 2,
int  retryNumber = -1 
) [inline, virtual]

Tries to connect to remote interface with stringified proxy proxyString. Will try to connect retryNumber number of times (-1 means infinite), waiting for retryIntervalSec [s] after each attempt. If succesful, tries to subscribe for data using the internal consumer interface. Catches appropriate exceptions. DOCUMENT!

Returns TRUE if subscribed succesfully, FALSE otherwise.

Implements orcaifaceimpl::ConsumerSubscriber.

template<class ProviderType, class ConsumerType, class ObjectType, class ConsumerTypeIType = ConsumerTypeI<ConsumerType,ObjectType>>
virtual void orcaifaceimpl::ConsumerImpl< ProviderType, ConsumerType, ObjectType, ConsumerTypeIType >::subscribeWithString ( const std::string &  proxyString  )  [inline, virtual]

Tries to connect to remote interface with stringified proxy proxyString. If succesful, tries to subscribe for data using the internal consumer interface. Does not catch any exceptions.

Implements orcaifaceimpl::ConsumerSubscriber.

template<class ProviderType, class ConsumerType, class ObjectType, class ConsumerTypeIType = ConsumerTypeI<ConsumerType,ObjectType>>
virtual void orcaifaceimpl::ConsumerImpl< ProviderType, ConsumerType, ObjectType, ConsumerTypeIType >::unsubscribe (  )  [inline, virtual]

When previously subscribed, tries to connect to the internally-stored topic proxy and unsubscribes. When not currently subscribed, quietly returns.

Implements orcaifaceimpl::ConsumerSubscriber.


The documentation for this class was generated from the following file:
 

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


Generated for Orca Robotics by  doxygen 1.4.5