nc::RTSupplier − |
#include <acsncRTSupplier.h> Inherits nc::Supplier. |
Classes |
class EventProcessingCallback |
struct unpublishedEventData |
Public Member Functions |
RTSupplier (const char *channelName, acscomponent::ACSComponentImpl *component, const char *acsNCDomainName=0) |
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::BACIThreadManager * threadManager_mp |
std::queue< unpublishedEventData > unpublishedEvents_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 &) |
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: |
• |
override the configQofS and configAdminProps methods for real-time use |
||
• |
performance tests |
||
• |
integrate this class with the ACS Exception Manager because asynchornous exceptions can be thrown by the static worker method |
||
• |
investigate whether a mutex is really needed for std::queues in gcc 3.3. |
nc::RTSupplier::RTSupplier (const char * channelName, acscomponent::ACSComponentImpl * component, const char * acsNCDomainName = 0) Constructor |
Parameters: |
channelName The name of the channel events will be
published to. |
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. |
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 (T 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 |
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. |
Logging::RepeatGuardLogger<Logging::BaseLog>* nc::RTSupplier::rtSupGuardb [protected] Repeat guard for the logger, to be used in static methods |
Logging::RepeatGuardLogger<ACSErr::ACSbaseExImpl>* nc::RTSupplier::rtSupGuardex [protected] Repeat guard for the exceptions, to be used in static methods |
baci::BACIThreadManager* nc::RTSupplier::threadManager_mp [protected] BACI thread manager used to control the worker thread. |
std::queue<unpublishedEventData> nc::RTSupplier::unpublishedEvents_m [protected] A queque of structured events. |
Generated automatically by Doxygen for ACS-2015.2 C++ API from the source code. |