Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions

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.

Classes

class  EventProcessingCallback
struct  unpublishedEventData

Public Member Functions

 RTSupplier (const char *channelName, acscomponent::ACSComponentImpl *component)
virtual void disconnect ()
template<class T >
void publishData (T data, EventProcessingCallback *evProcCallback=NULL)
unsigned int getQueueSize ()

Protected Member Functions

virtual ~RTSupplier ()

Static Protected Member Functions

static void worker (void *param_p)

Protected Attributes

baci::BACIThreadManagerthreadManager_mp
std::queue< unpublishedEventDataunpublishedEvents_m
CORBA::Any any_m
ACE_Thread_Mutex eventQueueMutex_m
Logging::RepeatGuardLogger
< Logging::BaseLog > * 
rtSupGuardb
Logging::RepeatGuardLogger
< ACSErr::ACSbaseExImpl > * 
rtSupGuardex

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.

unsigned int nc::RTSupplier::getQueueSize (  ) 

Returns the size of the queue with events waiting to be sent by the worker thread.

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,
EventProcessingCallback evProcCallback = NULL 
)

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

static 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.

Repeat guard for the logger, to be used in static methods

Repeat guard for the exceptions, to be used in static methods

BACI thread manager used to control the worker thread.

A queque of structured events.


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