Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

nc::RTSupplier Class Reference

#include <acsncRTSupplier.h>

Inheritance diagram for nc::RTSupplier:

Inheritance graph
[legend]
Collaboration diagram for nc::RTSupplier:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RTSupplier (const char *channelName, acscomponent::ACSComponentImpl *component)
virtual void disconnect ()
template<class T> void publishData (T data)

Protected Member Functions

virtual ~RTSupplier ()

Static Protected Member Functions

void worker (void *param_p)

Protected Attributes

baci::BACIThreadManagerthreadManager_mp
std::queue< CosNotification::StructuredEvent > unpublishedEvents_m
CORBA::Any any_m
ACE_Thread_Mutex eventQueueMutex_m

Private Member Functions

void operator= (const RTSupplier &)
 RTSupplier (const RTSupplier &)

Detailed Description

RTSupplier is used to publish data onto a notification channel defined by the string passed to RTSupplier's constructor. Please do not let the name confuse you as this class does not publish structured events in real-time. Instead, invocations of the publishData method merely save the structured event to an internal queue and the event will be sent across the network by a low-priority thread sometime later. In summary, it's safe to call publishData from real-time code as it does not block until the event has been received on manager's host.

TODO:


Constructor & Destructor Documentation

nc::RTSupplier::RTSupplier const char *  channelName,
acscomponent::ACSComponentImpl component
 

Constructor

Parameters:
channlName The name of the channel events will be published to.
component A reference to a component is needed for the Event Description (which is normally hidden from Consumers).

virtual nc::RTSupplier::~RTSupplier  )  [protected, virtual]
 

Destructor is protected.

nc::RTSupplier::RTSupplier const RTSupplier  )  [private]
 

ALMA C++ coding standards state copy constructors should be disabled.


Member Function Documentation

virtual void nc::RTSupplier::disconnect  )  [virtual]
 

Overriden from Supplier class. Ensures all events in the queue are published before exiting.

Returns:
void

Reimplemented from nc::Supplier.

void nc::RTSupplier::operator= const RTSupplier  )  [private]
 

ALMA C++ coding standards state assignment operators should be disabled.

template<class T>
void nc::RTSupplier::publishData data  ) 
 

Templated method called by the developer to send ICD events to consumers. publishData saves the ICD event to an internal queue and returns control immediately. Please note that any exceptions associated with actual CORBA calls involved with pushing events are only logged as this functionality is really performed by the worker method/thread.

Exceptions:
ACSErrTypeCommon::CORBAProblemEx 
Parameters:
data A user-defined IDL struct. FRIDGE::temperatureDataBlockEvent for example

void nc::RTSupplier::worker void *  param_p  )  [static, protected]
 

Low priority thread method which is actually responsible for sending events across the network. Any exceptions generated by the CORBA calls are only logged here. This thread just sleeps for awhile if there are no events to publish. If the queue is non-empty, it publishes all events before sleeping again.

Parameters:
parmam_p A pointer to this instance.
Returns:
void


Member Data Documentation

CORBA::Any nc::RTSupplier::any_m [protected]
 

A CORBA any which is used to encode/store ICD style events. This has been made a member variable to improve performance of the publishData method.

ACE_Thread_Mutex nc::RTSupplier::eventQueueMutex_m [protected]
 

Mutex prevents real-time code from saving half an event with the low priority thread trying to publish it.

baci::BACIThreadManager* nc::RTSupplier::threadManager_mp [protected]
 

BACI thread manager used to control the worker thread.

std::queue<CosNotification::StructuredEvent> nc::RTSupplier::unpublishedEvents_m [protected]
 

A queque of structured events.


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:37:33 2009 for ACS C++ API by doxygen 1.3.8