Classes | Public Member Functions | Static Public Attributes

JAUS::RangeSubscriber Class Reference

This service is used to subscribe to range data from components with the Range Sensor service. More...

#include <rangesubscriber.h>

Inheritance diagram for JAUS::RangeSubscriber:
JAUS::Management::Child JAUS::AccessControl::Child JAUS::Events::Child JAUS::Service

List of all members.

Classes

class  Callback
 Callback class used to receive image/range data as it arrives. More...

Public Member Functions

 RangeSubscriber ()
 Constructor.
 ~RangeSubscriber ()
 Destructor.
virtual void Shutdown ()
 Method called on Shutdown.
bool CreateRangeSubscription (const Address &id, const Byte deviceID=0, const unsigned int waitTimeMs=Service::DefaultWaitMs)
 Create a subscription to range data.
bool GetRangeSensorInfo (const Address &id, RangeSensorConfig::List &list, const unsigned int waitTimeMs=Service::DefaultWaitMs *3) const
 Query a component with a Range Sensor service for number of devices.
virtual void ProcessLocalRangeScan (const Point3D::List &scan, const Address &sourceID, const Byte deviceID, const Time &timestamp)
bool HaveRangeSubscription (const Address &id, const int deviceID=-1) const
 Method to check if a video subscription is present.
bool CancelRangeSubscription (const Address &id=Address(), const int deviceID=-1)
 Method to check cancel a range subscription.
void RegisterCallback (Callback *callback, const bool add=true)
 Method to register a callback to receive range data as it arrives.
virtual bool GenerateEvent (const Events::Subscription &info) const
virtual bool IsEventSupported (const Events::Type type, const double requestedPeriodicRate, const Message *queryMessage, double &confirmedPeriodicRate, std::string &errorMessage) const
virtual bool IsDiscoverable () const
virtual void Receive (const Message *message)
 Processes message received by the Service. If not supported, then message is passed to inheriting services.
virtual MessageCreateMessage (const UShort messageCode) const
 Attempts to create the message desired. Only message supported by this Service can be created by this Service.
virtual bool Resume ()
virtual bool Reset ()
virtual bool Standby ()
virtual bool SetEmergency ()
virtual bool ClearEmergency ()
virtual bool ReleaseControl ()
 Method called whenever control of the parent component has been released.

Static Public Attributes

static const std::string Name = "urn:jaus:jss:jpp:extras:RangeSubscriber"
 String name of the Service.

Detailed Description

This service is used to subscribe to range data from components with the Range Sensor service.

Definition at line 58 of file rangesubscriber.h.


Constructor & Destructor Documentation

RangeSubscriber::RangeSubscriber (  )

Constructor.

Definition at line 52 of file rangesubscriber.cpp.

RangeSubscriber::~RangeSubscriber (  )

Destructor.

Definition at line 64 of file rangesubscriber.cpp.


Member Function Documentation

bool RangeSubscriber::CancelRangeSubscription ( const Address id = Address(),
const int  deviceID = -1 
)

Method to check cancel a range subscription.

Parameters:
[in]idID of the source of the subscription.
[in]deviceIDID of the sensor, set to -1 for any sensor.
Returns:
True if a range subscription exists, otherwise false.

Definition at line 180 of file rangesubscriber.cpp.

virtual bool JAUS::RangeSubscriber::ClearEmergency (  ) [inline, virtual]

Reimplemented from JAUS::Management::Child.

Definition at line 130 of file rangesubscriber.h.

Message * RangeSubscriber::CreateMessage ( const UShort  messageCode ) const [virtual]

Attempts to create the message desired. Only message supported by this Service can be created by this Service.

Parameters:
[in]messageCodeMessage to create.
Returns:
Pointer to newly allocated Message data, NULL if message is not supported by the Service.

Implements JAUS::Service.

Definition at line 400 of file rangesubscriber.cpp.

bool RangeSubscriber::CreateRangeSubscription ( const Address id,
const Byte  deviceID = 0,
const unsigned int  waitTimeMs = Service::DefaultWaitMs 
)

Create a subscription to range data.

Parameters:
[in]idThe component ID to get video data from.
[in]deviceIDThe sensor/source on the component.
[in]waitTimeMsHow long to wait in ms before timeout on request.
Returns:
True on success, false on failure.

Definition at line 90 of file rangesubscriber.cpp.

virtual bool JAUS::RangeSubscriber::GenerateEvent ( const Events::Subscription info ) const [inline, virtual]

Implements JAUS::Events::Child.

Definition at line 108 of file rangesubscriber.h.

bool RangeSubscriber::GetRangeSensorInfo ( const Address id,
RangeSensorConfig::List list,
const unsigned int  waitTimeMs = Service::DefaultWaitMs*3 
) const

Query a component with a Range Sensor service for number of devices.

Parameters:
[in]idThe component ID to get range data from.
[out]listRange sensor data.
[in]waitTimeMsHow long to wait in ms before timeout on request.
Returns:
True on success, false on failure.

Definition at line 115 of file rangesubscriber.cpp.

bool RangeSubscriber::HaveRangeSubscription ( const Address id,
const int  deviceID = -1 
) const

Method to check if a video subscription is present.

Parameters:
[in]idID of the source of the subscription.
[in]deviceIDID of the sensor, set to -1 for any sensor.
Returns:
True if a range subscription exists, otherwise false.

Definition at line 140 of file rangesubscriber.cpp.

virtual bool JAUS::RangeSubscriber::IsDiscoverable (  ) const [inline, virtual]

Implements JAUS::Service.

Definition at line 116 of file rangesubscriber.h.

virtual bool JAUS::RangeSubscriber::IsEventSupported ( const Events::Type  type,
const double  requestedPeriodicRate,
const Message queryMessage,
double &  confirmedPeriodicRate,
std::string &  errorMessage 
) const [inline, virtual]

Implements JAUS::Events::Child.

Definition at line 110 of file rangesubscriber.h.

virtual void JAUS::RangeSubscriber::ProcessLocalRangeScan ( const Point3D::List &  scan,
const Address sourceID,
const Byte  deviceID,
const Time timestamp 
) [inline, virtual]

Definition at line 97 of file rangesubscriber.h.

void RangeSubscriber::Receive ( const Message message ) [virtual]

Processes message received by the Service. If not supported, then message is passed to inheriting services.

This Service supports the following message: Report Image

Parameters:
[in]messageMessage data to process.

Reimplemented from JAUS::Service.

Definition at line 260 of file rangesubscriber.cpp.

void RangeSubscriber::RegisterCallback ( Callback callback,
const bool  add = true 
)

Method to register a callback to receive range data as it arrives.

Parameters:
[in]callbackPointer to callback to add/remove.
[in]addIf true, callback is added, if false, it is removed.

Definition at line 230 of file rangesubscriber.cpp.

virtual bool JAUS::RangeSubscriber::ReleaseControl (  ) [inline, virtual]

Method called whenever control of the parent component has been released.

Reimplemented from JAUS::Management::Child.

Definition at line 132 of file rangesubscriber.h.

virtual bool JAUS::RangeSubscriber::Reset (  ) [inline, virtual]

Implements JAUS::Management::Child.

Definition at line 124 of file rangesubscriber.h.

virtual bool JAUS::RangeSubscriber::Resume (  ) [inline, virtual]

Implements JAUS::Management::Child.

Definition at line 122 of file rangesubscriber.h.

virtual bool JAUS::RangeSubscriber::SetEmergency (  ) [inline, virtual]

Reimplemented from JAUS::Management::Child.

Definition at line 128 of file rangesubscriber.h.

void RangeSubscriber::Shutdown (  ) [virtual]

Method called on Shutdown.

Reimplemented from JAUS::Service.

Definition at line 74 of file rangesubscriber.cpp.

virtual bool JAUS::RangeSubscriber::Standby (  ) [inline, virtual]

Implements JAUS::Management::Child.

Definition at line 126 of file rangesubscriber.h.


Member Data Documentation

const std::string RangeSubscriber::Name = "urn:jaus:jss:jpp:extras:RangeSubscriber" [static]

String name of the Service.

Definition at line 82 of file rangesubscriber.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines