div class="twikiTopBar">

Chair for Computer Aided Medical Procedures & Augmented Reality
Lehrstuhl für Informatikanwendungen in der Medizin & Augmented Reality

DWARF::PoseService Class Reference
[Ubiquitous Tracking Environment]

A service class for sending PoseData. More...

Inheritance diagram for DWARF::PoseService:

Inheritance graph
[legend]
Collaboration diagram for DWARF::PoseService:

Collaboration graph
[legend]

Public Member Functions

 PoseService (const char *name="PoseService")
 The default constructor for the PoseService.
virtual ~PoseService ()
 Construct a PoseService with an external EventProcessor.
PoseSendergetPoseSender (const char *name)
 Return the PoseSender for the given ability.
MiddlewareUtils::EventReceiverSession<
PoseData > * 
getEventReceiver (const char *name)
 Return the EventReceiver for the given need.
std::vector< PoseSender * > getAllSenders ()
 Returns a vector containing all PoseSenders.
std::vector< MiddlewareUtils::EventReceiverSession<
PoseData > * > 
getAllReceivers ()
 Returns a vector containing all EventReceivers.
int numberOfSenders ()
 Returns the number of currently managed PoseSenders.
int numberOfReceivers ()
 Returns the number of currently managed EventReceivers.
void enable ()
void disable ()
bool shouldSend ()
 Return whether events should be sent continuously.
void onEvent (const PoseData &pose)
 Override this if you want to receive PoseData events.

Protected Member Functions

virtual CORBA::Object_ptr createAbilityObject (DWARF::AbilityDescription_ptr abilityDescr)
 Create an Ability object for a given description.
virtual CORBA::Object_ptr createNeedObject (DWARF::NeedDescription_ptr needDescr)
 Create a Need object for a given description.
virtual void run ()=0
 The run method for the main service thread.

Private Attributes

int m_numSender
int m_numReceiver
std::string m_name
omni_mutex m_abilMapMutex
std::map< std::string, PoseSender * > m_senderMap
omni_mutex m_needMapMutex
std::map< std::string, MiddlewareUtils::EventReceiverSession<
DWARF::PoseData > * > 
m_receiverMap
volatile bool m_shouldSend
omni_mutex m_mutexShouldSend
omni_condition m_signalShouldSend

Detailed Description

A service class for sending PoseData.

This class implements a service which sends and/or receives PoseData. For every initial PoseData ability it stores an PoseSender which handles the communication.

Author:
Daniel Pustka <pustka@in.tum.de>

Franz Strasser <strassef@in.tum.de>

Martin Wagner <wagnerm@in.tum.de>

Definition at line 57 of file PoseService.h.


Constructor & Destructor Documentation

PoseService::PoseService const char *  name = "PoseService"  ) 
 

The default constructor for the PoseService.

This constructor takes an optional service and creates the service object.

Parameters:
name An optional service name (default: "PoseService")

Definition at line 37 of file PoseService.cpp.

virtual DWARF::PoseService::~PoseService  )  [inline, virtual]
 

Construct a PoseService with an external EventProcessor.

Empty default destructor

Definition at line 139 of file PoseService.h.


Member Function Documentation

Object_ptr PoseService::createAbilityObject DWARF::AbilityDescription_ptr  abilityDescr  )  [protected, virtual]
 

Create an Ability object for a given description.

Parameters:
abilityDescr The description of the ability
Returns:
The created C++ Object_ptr

Reimplemented from TemplateService.

Definition at line 106 of file PoseService.cpp.

Object_ptr PoseService::createNeedObject DWARF::NeedDescription_ptr  needDescr  )  [protected, virtual]
 

Create a Need object for a given description.

Parameters:
needDescr The description of the ability
Returns:
The created C++ Object_ptr

Reimplemented from TemplateService.

Reimplemented in DWARF::ErrorVisualizerService.

Definition at line 64 of file PoseService.cpp.

void PoseService::disable  ) 
 

Disables continuous sending of events for all PoseSenders

Definition at line 225 of file PoseService.cpp.

void PoseService::enable  ) 
 

Enables continuous sending of events for all PoseSenders

Definition at line 218 of file PoseService.cpp.

std::vector< EventReceiverSession< PoseData > * > PoseService::getAllReceivers  ) 
 

Returns a vector containing all EventReceivers.

Returns:
Vector with pointers to all EventReceivers

Definition at line 192 of file PoseService.cpp.

std::vector< PoseSender * > PoseService::getAllSenders  ) 
 

Returns a vector containing all PoseSenders.

Returns:
Vector with pointers to all PoseSenders

Definition at line 157 of file PoseService.cpp.

EventReceiverSession< PoseData > * PoseService::getEventReceiver const char *  name  ) 
 

Return the EventReceiver for the given need.

Parameters:
name The name of the need

Definition at line 184 of file PoseService.cpp.

PoseSender * PoseService::getPoseSender const char *  name  ) 
 

Return the PoseSender for the given ability.

Parameters:
name The name of the ability

Definition at line 148 of file PoseService.cpp.

int PoseService::numberOfReceivers  ) 
 

Returns the number of currently managed EventReceivers.

Returns:
Number of receivers

Definition at line 207 of file PoseService.cpp.

int PoseService::numberOfSenders  ) 
 

Returns the number of currently managed PoseSenders.

Returns:
Number of senders

Definition at line 172 of file PoseService.cpp.

void DWARF::PoseService::onEvent const PoseData pose  )  [inline]
 

Override this if you want to receive PoseData events.

This method implements the EventProcessor interface. The default behavior is to ignore all events. The actual implementation must be provided in subclasses by overriding this method.

Parameters:
pose The received PoseData structure

Reimplemented in DWARF::StaticAutoCalibrationService, and DWARF::StaticCalibrationService.

Definition at line 205 of file PoseService.h.

bool DWARF::PoseService::shouldSend  )  [inline]
 

Return whether events should be sent continuously.

Returns:
Should the service send events?

Definition at line 194 of file PoseService.h.


Field Documentation

omni_mutex DWARF::PoseService::m_abilMapMutex [private]
 

A mutex for the access to the id map

Definition at line 75 of file PoseService.h.

omni_mutex DWARF::PoseService::m_mutexShouldSend [private]
 

A mutex for the access to m_shouldSend and for the condition variable

Definition at line 90 of file PoseService.h.

std::string DWARF::PoseService::m_name [private]
 

The service's name

Reimplemented from TemplateService.

Reimplemented in DWARF::ContinuousPoseService.

Definition at line 72 of file PoseService.h.

omni_mutex DWARF::PoseService::m_needMapMutex [private]
 

A mutex for the need map

Definition at line 81 of file PoseService.h.

int DWARF::PoseService::m_numReceiver [private]
 

Number of registered EventReceiver objects

Definition at line 66 of file PoseService.h.

int DWARF::PoseService::m_numSender [private]
 

Number of registered PoseSender objects

Definition at line 63 of file PoseService.h.

std::map< std::string, MiddlewareUtils::EventReceiverSession< DWARF::PoseData> * > DWARF::PoseService::m_receiverMap [private]
 

map of needs

Definition at line 84 of file PoseService.h.

std::map< std::string, PoseSender* > DWARF::PoseService::m_senderMap [private]
 

map of abilities

Definition at line 78 of file PoseService.h.

volatile bool DWARF::PoseService::m_shouldSend [private]
 

Variable whether the senders is enabled or disabled

Definition at line 87 of file PoseService.h.

omni_condition DWARF::PoseService::m_signalShouldSend [private]
 

Condition variable to signal the change of m_shouldSend

Definition at line 93 of file PoseService.h.

DWARF::PoseService Class Reference | generated on Sun Apr 29 02:02:03 2007 by Doxygen 1.4.1 for DWARF