Smart class to manage IDataDistributionChannelCallback. More...
#include <SmartDataDistributionManager.h>
Public Member Functions | |
| SmartDataDistributionChannel () | |
| Initialize a new SmartDataDistributionChannel. | |
| DDM_CHANNEL_DIRECTION | GetDirection () |
| Returns the DDM_CHANNEL_DIRECTION channel direction. | |
| void | SetInformation (const char *channelName, IDataDistributionChannelBase *pIDataDistributionChannelBase, CHANNEL_HANDLE_PARAMETER, DDM_CHANNEL_DIRECTION direction) |
| Sets information on SmartDataDistributionChannel. | |
| OPERATION_RESULT | StartChannel (unsigned long timeout) |
| Starts the channel. | |
| OPERATION_RESULT | StopChannel (unsigned long timeout) |
| Stops the channel. | |
| OPERATION_RESULT | Lock (unsigned long timeout) |
| Locks the channel. | |
| OPERATION_RESULT | Unlock () |
| Unlock the channel. | |
| OPERATION_RESULT | SeekChannel (int64_t position) |
| Seeks the channel. | |
| OPERATION_RESULT | WriteOnChannel (const char *key, size_t keyLen, void *buffer, size_t bufferLen, const BOOL waitAll=FALSE, const int64_t timestamp=DDM_NO_TIMESTAMP) |
| Writes data on the channel. | |
| OPERATION_RESULT | ReadFromChannel (int64_t offset, size_t *dataLen, void **buffer) |
| Reads data from the channel. | |
| OPERATION_RESULT | ChangeChannelDirection (DDM_CHANNEL_DIRECTION direction) |
| Change the DDM_CHANNEL_DIRECTION of the channel. | |
| const char * | GetChannelName () |
| Returns the channel name. | |
| int64_t | GetTimestamp () |
| Returns the timestamp. | |
| int64_t | GetOffset () |
| Returns the actual channel offset. | |
| virtual void | OnDataAvailable (const char *key, size_t keyLen, const void *buffer, const size_t len) |
| Function to override to receive data available. | |
| virtual void | OnDataAvailable (const std::string key, const void *buffer, const size_t len) |
| Function to override to receive data available. | |
| virtual void | OnConditionOrError (const OPERATION_RESULT errorCode, const int nativeCode, const char *subSystemReason) |
| Function to override to receive condition or error. | |
| virtual void | OnConditionOrError (const OPERATION_RESULT errorCode, const int nativeCode, const std::string subSystemReason) |
| Function to override to receive condition or error. | |
Protected Member Functions | |
| ~SmartDataDistributionChannel () | |
| Destructor of SmartDataDistributionChannel. | |
| virtual void | OnUnderlyingEvent (const CHANNEL_HANDLE_PARAMETER, const UnderlyingEventData *uEvent) |
| Function to override to receive UnderlyingEventData. | |
Protected Member Functions inherited from IDataDistributionChannelCallback | |
Smart class to manage IDataDistributionChannelCallback.
A smart manager for channels
| SmartDataDistributionChannel::SmartDataDistributionChannel | ( | ) |
Initialize a new SmartDataDistributionChannel.
|
protected |
Destructor of SmartDataDistributionChannel.
| OPERATION_RESULT SmartDataDistributionChannel::ChangeChannelDirection | ( | DDM_CHANNEL_DIRECTION | direction | ) |
Change the DDM_CHANNEL_DIRECTION of the channel.
direction DDM_CHANNEL_DIRECTION direction
| const char * SmartDataDistributionChannel::GetChannelName | ( | ) |
Returns the channel name.
| DDM_CHANNEL_DIRECTION SmartDataDistributionChannel::GetDirection | ( | ) |
Returns the DDM_CHANNEL_DIRECTION channel direction.
| int64_t SmartDataDistributionChannel::GetOffset | ( | ) |
Returns the actual channel offset.
| int64_t SmartDataDistributionChannel::GetTimestamp | ( | ) |
Returns the timestamp.
| OPERATION_RESULT SmartDataDistributionChannel::Lock | ( | unsigned long | timeout | ) |
Locks the channel.
timeout the operation timeout in milliseconds
|
virtual |
Function to override to receive condition or error.
errorCode the DDM_UNDERLYING_ERROR_CONDITION error or condition nativeCode the native code from transport subsystem subSystemReason reason from transport subsystem
|
virtual |
Function to override to receive condition or error.
errorCode the DDM_UNDERLYING_ERROR_CONDITION error or condition nativeCode the native code from transport subsystem subSystemReason reason from transport subsystem
|
virtual |
Function to override to receive data available.
key the key of the message, NULL if the key was omitted in transmission keyLen the length of key buffer the data buffer received len the length of the buffer timestamp The timestamp associated to the data: Milliseconds since epoch (UTC). offset The offset associated to the data
|
virtual |
Function to override to receive data available.
key the key of the message, NULL if the key was omitted in transmission buffer the data buffer received len the length of the buffer timestamp The timestamp associated to the data: Milliseconds since epoch (UTC). offset The offset associated to the data
|
protectedvirtual |
Function to override to receive UnderlyingEventData.
channelHandle the CHANNEL_HANDLE of the channel uEvent the UnderlyingEventData received from transport subsystem
Implements IDataDistributionChannelCallback.
| OPERATION_RESULT SmartDataDistributionChannel::ReadFromChannel | ( | int64_t | offset, |
| size_t * | dataLen, | ||
| void ** | buffer ) |
Reads data from the channel.
offset offset to read info from dataLen pointer will receive length of data read buffer the buffer to receive data from the channel, it cannot be NULL
| OPERATION_RESULT SmartDataDistributionChannel::SeekChannel | ( | int64_t | position | ) |
Seeks the channel.
position the new channel position
| void SmartDataDistributionChannel::SetInformation | ( | const char * | channelName, |
| IDataDistributionChannelBase * | pIDataDistributionChannelBase, | ||
| CHANNEL_HANDLE_PARAMETER | , | ||
| DDM_CHANNEL_DIRECTION | direction ) |
Sets information on SmartDataDistributionChannel.
channelName the channel name pIDataDistributionChannelBase pointer to IDataDistributionChannelBase instance channelHandle the CHANNEL_HANDLE to the channel direction DDM_CHANNEL_DIRECTION direction
| OPERATION_RESULT SmartDataDistributionChannel::StartChannel | ( | unsigned long | timeout | ) |
Starts the channel.
timeout the operation timeout in milliseconds
| OPERATION_RESULT SmartDataDistributionChannel::StopChannel | ( | unsigned long | timeout | ) |
Stops the channel.
timeout the operation timeout in milliseconds
| OPERATION_RESULT SmartDataDistributionChannel::Unlock | ( | ) |
Unlock the channel.
| OPERATION_RESULT SmartDataDistributionChannel::WriteOnChannel | ( | const char * | key, |
| size_t | keyLen, | ||
| void * | buffer, | ||
| size_t | bufferLen, | ||
| const BOOL | waitAll = FALSE, | ||
| const int64_t | timestamp = DDM_NO_TIMESTAMP ) |
Writes data on the channel.
key the key of the message to write, it can be NULL keyLen the length of the key buffer the buffer to write on the channel, it cannot be NULL bufferLen the length of the buffer to write waitAll set to TRUE to wait a complete message dispatch, default is FALSE.
timestamp a timestamp associable to the message, default is DDM_NO_TIMESTAMP and means no timestamp written