#include <acsncSimpleConsumer.h>
List of all members.
Detailed Description
template<class T>
class nc::SimpleConsumer< T >
SimpleConsumer is used to consume data from a notification channel defined by the string passed to SimpleConsumer's constructor. In a nutshell, this class has been provided so that developers do not have to subclass Consumer and can instead use a generic function to process events.
To begin consuming data, simply invoke the consumerReady method. After that, the eventHandlerFunction will be invoked asynchronously each time an event is received.
TODO:
- add a check on the datatype in push_structured_event
- support subscriptions to multiple event types...may not be feasible
Member Typedef Documentation
Constructor & Destructor Documentation
Constructor to be used within components.
- Parameters:
-
| channelName | The channel's name |
| acsNCDomain | name of the ACS NC domain name. This is an optional parameter. It will default to acscommon::NAMESERVICE_BINDING_NC_DOMAIN_DEFAULT if it is not specified. |
ALMA C++ coding standards state copy constructors should be disabled.
Member Function Documentation
template<class T>
template<class J >
A special version of the addSubscription method. Not only subscribes to an event_type, but it also saves a function pointer and an extra paremter to the function to be utilized when an event of type_name is received. Currently the implementation only allows this method to be invoked once (and that is done from the ACSNC_NEW_SIMPLE_CONSUMER macro). The template paramter is the type_name of the event to be received.
- Parameters:
-
| templateFunction | A (static) method which will be invoked each time a type_name event is received. The method must accept a <T> structure as it's first parameter. |
| handlerParam | A void pointer that will be passed to templateFunction (in addition to the actual ICD <T> event) each time a type_name event is received. |
- Exceptions:
-
| ACSErrTypeCommon::CouldntPerformActionEx | |
- Returns:
- void
A special version of the addSubscription method. Not only subscribes to an event_type, but it also saves a function pointer and an extra paremter to the function to be utilized when an event of type_name is received. Currently the implementation only allows this method to be invoked once (and that is done from the ACSNC_NEW_SIMPLE_CONSUMER macro).
- Parameters:
-
| type_name | Type of the event to be received |
| templateFunction | A (static) method which will be invoked each time a type_name event is received. The method must accept a <T> structure as it's first parameter. |
| handlerParam | A void pointer that will be passed to templateFunction (in addition to the actual ICD <T> event) each time a type_name event is received. |
- Returns:
- void
Disconnect from the channel. Call this instead of deleting the object. Once disconnect has been invoked, developers should treat the object as if it has been deleted.
- Returns:
- void
Reimplemented from nc::Consumer.
Entry point for the buffer's consumer thread
ALMA C++ coding standards state assignment operators should be disabled.
It just invokes some function registered via the addSubscription method
template<class T>
virtual void nc::SimpleConsumer< T >::push_structured_event |
( |
const CosNotification::StructuredEvent & |
notification |
) |
[virtual] |
This is the abstract method inherited Consumer which must be overridden. In the SimpleConsumer class, it just invokes some function registered via the addSubscription method. In doing this, one does not have to override SimpleConsumer. Note that this method must not be invoked by your code!
- Exceptions:
-
| CosEventComm::Disconnected | |
- Returns:
- void
Implements nc::Consumer.
Member Data Documentation
This is a single parameter that will be passed to the handler function in addition to the ICD <T> event.
This function does something with T events.
The documentation for this class was generated from the following file: