Loading...
Searching...
No Matches
SmartDataDistributionChannel Class Reference

Smart class to manage IDataDistributionChannelCallback. More...

#include <SmartDataDistributionManager.h>

Inheritance diagram for SmartDataDistributionChannel:
IDataDistributionChannelCallback

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

Detailed Description

Smart class to manage IDataDistributionChannelCallback.

A smart manager for channels

Constructor & Destructor Documentation

◆ SmartDataDistributionChannel()

SmartDataDistributionChannel::SmartDataDistributionChannel ( )

Initialize a new SmartDataDistributionChannel.

◆ ~SmartDataDistributionChannel()

SmartDataDistributionChannel::~SmartDataDistributionChannel ( )
protected

Member Function Documentation

◆ ChangeChannelDirection()

OPERATION_RESULT SmartDataDistributionChannel::ChangeChannelDirection ( DDM_CHANNEL_DIRECTION direction)

Change the DDM_CHANNEL_DIRECTION of the channel.

direction DDM_CHANNEL_DIRECTION direction

Returns
the OPERATION_RESULT of the operation

◆ GetChannelName()

const char * SmartDataDistributionChannel::GetChannelName ( )

Returns the channel name.

Returns
the channel name

◆ GetDirection()

DDM_CHANNEL_DIRECTION SmartDataDistributionChannel::GetDirection ( )

Returns the DDM_CHANNEL_DIRECTION channel direction.

◆ GetOffset()

int64_t SmartDataDistributionChannel::GetOffset ( )

Returns the actual channel offset.

Returns
the offset of data

◆ GetTimestamp()

int64_t SmartDataDistributionChannel::GetTimestamp ( )

Returns the timestamp.

Returns
Milliseconds since epoch (UTC)

◆ Lock()

OPERATION_RESULT SmartDataDistributionChannel::Lock ( unsigned long timeout)

Locks the channel.

timeout the operation timeout in milliseconds

Returns
the OPERATION_RESULT of the operation

◆ OnConditionOrError() [1/2]

virtual void SmartDataDistributionChannel::OnConditionOrError ( const OPERATION_RESULT errorCode,
const int nativeCode,
const char * subSystemReason )
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

◆ OnConditionOrError() [2/2]

virtual void SmartDataDistributionChannel::OnConditionOrError ( const OPERATION_RESULT errorCode,
const int nativeCode,
const std::string subSystemReason )
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

◆ OnDataAvailable() [1/2]

virtual void SmartDataDistributionChannel::OnDataAvailable ( const char * key,
size_t keyLen,
const void * buffer,
const size_t len )
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

◆ OnDataAvailable() [2/2]

virtual void SmartDataDistributionChannel::OnDataAvailable ( const std::string key,
const void * buffer,
const size_t len )
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

◆ OnUnderlyingEvent()

virtual void SmartDataDistributionChannel::OnUnderlyingEvent ( const CHANNEL_HANDLE_PARAMETER ,
const UnderlyingEventData * uEvent )
protectedvirtual

Function to override to receive UnderlyingEventData.

channelHandle the CHANNEL_HANDLE of the channel uEvent the UnderlyingEventData received from transport subsystem

Implements IDataDistributionChannelCallback.

◆ ReadFromChannel()

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

Returns
the OPERATION_RESULT of the operation

◆ SeekChannel()

OPERATION_RESULT SmartDataDistributionChannel::SeekChannel ( int64_t position)

Seeks the channel.

position the new channel position

Returns
the OPERATION_RESULT of the operation

◆ SetInformation()

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

Remarks
Used from SmartDataDistribution::CreateSmartChannel

◆ StartChannel()

OPERATION_RESULT SmartDataDistributionChannel::StartChannel ( unsigned long timeout)

Starts the channel.

timeout the operation timeout in milliseconds

Returns
the OPERATION_RESULT of the operation

◆ StopChannel()

OPERATION_RESULT SmartDataDistributionChannel::StopChannel ( unsigned long timeout)

Stops the channel.

timeout the operation timeout in milliseconds

Returns
the OPERATION_RESULT of the operation

◆ Unlock()

OPERATION_RESULT SmartDataDistributionChannel::Unlock ( )

Unlock the channel.

Returns
the OPERATION_RESULT of the operation

◆ WriteOnChannel()

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.

Remarks
it depends on underlying implementation timestamp a timestamp associable to the message, default is DDM_NO_TIMESTAMP and means no timestamp written
Returns
the OPERATION_RESULT of the operation

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