19#if !defined(SMARTDATADISTRIBUTIONMANAGER_H__INCLUDED_)
20#define SMARTDATADISTRIBUTIONMANAGER_H__INCLUDED_
234 virtual void OnDataAvailable(
const char *key,
size_t keyLen,
const void *buffer,
const size_t len);
245 virtual void OnDataAvailable(
const std::string key,
const void *buffer,
const size_t len);
276 const char *m_ChannelName;
346 BOOL
Stop(
unsigned long timeout);
376 virtual const char *
OnConfiguration(
const char *channelName,
const char *key,
const char *value);
514 static_assert(std::is_base_of<SmartDataDistributionChannel, T>::value,
"type parameter of this class must derive from SmartDataDistributionChannel");
517 T *pSmartChannelT =
new T();
521 pSmartChannel->
SetInformation(channelName, pChannelBase, channelHandle, direction);
523 return pSmartChannelT;
DDM_CHANNEL_DIRECTION
DDM_CHANNEL_DIRECTION type.
Definition DataDistributionManagerEnums.h:70
DDM_LOG_LEVEL
DDM_LOG_LEVEL type.
Definition DataDistributionManagerEnums.h:87
DDM_INSTANCE_STATE
DDM_INSTANCE_STATE type.
Definition DataDistributionManagerEnums.h:112
DDM_CLUSTEREVENT
DDM_CLUSTEREVENT type.
Definition DataDistributionManagerEnums.h:133
#define DDM_NO_TIMESTAMP
Definition to avoid timestamp on write.
Definition DataDistributionManagerTypes.h:76
long OPERATION_RESULT
OPERATION_RESULT type.
Definition DataDistributionManagerTypes.h:102
#define CHANNEL_HANDLE_PARAMETER
Channel handle parameter definition.
Definition DataDistributionManagerTypes.h:89
#define CHANNEL_HANDLE
Channel handle definition.
Definition DataDistributionManagerTypes.h:84
#define OPERATION_FAILED(or)
Check if operation failed.
Definition DataDistributionManagerTypes.h:110
DataDistributionManager library.
The C++ callback interface to be externally implemented.
Definition DataDistributionManager.h:212
Base interface to be implemented from channel manager.
Definition DataDistributionManager.h:664
virtual CHANNEL_HANDLE CreateChannel(const char *channelName, IDataDistributionChannelCallback *dataCb, DDM_CHANNEL_DIRECTION direction=DDM_CHANNEL_DIRECTION::ALL, const char *arrayParams[]=NULL, int len=0)=0
Creates a new channel.
The C++ callback interface to be externally implemented.
Definition DataDistributionManager.h:405
The C++ callback interface to be externally implemented.
Definition DataDistributionManager.h:550
Interface to be implemented from mastership subsystem.
Definition DataDistributionManager.h:895
Interface to be implemented from common manager.
Definition DataDistributionManager.h:1027
virtual IDataDistributionSubsystem * GetSubsystemManager()=0
Returns the allocated communication subsystem.
Interface to manage time information.
Definition DataDistributionManager.h:111
Smart class to manage IDataDistributionCallback and IDataDistributionMastershipCallback.
Definition SmartDataDistributionManager.h:290
virtual void OnMultiplePrimary(int64_t myId, int64_t otherId)
Callback invoked when multiple primary server are detected.
virtual void OnStateReady(void *pState, int64_t len)
Callback invoked when a state transfer is completed.
IDataDistribution * m_pIDataDistribution
Definition SmartDataDistributionManager.h:480
IDataDistributionMastershipCommon * m_pIDataDistributionMastershipCommon
Definition SmartDataDistributionManager.h:481
~SmartDataDistributionBase()
Destructor of SmartDataDistributionBase.
virtual void OnClusterStateChange(DDM_CLUSTEREVENT change, int64_t serverid)
Callback invoked to report cluster state change.
virtual const char * OnConfiguration(const char *channelName, const char *key, const char *value)
Function invoked during configuration validation.
OPERATION_RESULT RequestMastershipManager(const char *hostAddress=NULL, const char *arrayParams[]=NULL, int len=0)
Allocate and initialize the mastership manager.
virtual void OnLogging(DDM_LOG_LEVEL level, const char *source, const char *function, const char *logStr)
Function invoked when a log is emitted from subsystem.
virtual void FirstStateChange(DDM_INSTANCE_STATE newState)
Callback invoked to report a first state change.
BOOL Stop(unsigned long timeout)
Stop the common manager.
virtual void OnStateChange(DDM_INSTANCE_STATE newState, DDM_INSTANCE_STATE oldState)
Callback invoked to report a state change.
virtual void OnCompletelyDisconnected(const char *channelName, const char *reason)
Callback invoked on a complete disconnection.
std::string GetMastershipLib()
Returns the mastership library in use from IDataDistribution instance.
BOOL Start(unsigned long timeout)
Start the common manager.
virtual void OnRequestedState(void **pState, size_t *len)
Callback invoked when a state transfer is requested.
SmartDataDistributionBase()
Initialize a new SmartDataDistributionBase.
std::string GetProtocolLib()
Returns the protocol library in use from IDataDistribution instance.
OPERATION_RESULT m_pInitializeHRESULT
Definition SmartDataDistributionManager.h:482
OPERATION_RESULT Initialize(const char *conf_file, const char *hostAddress=0, const char *channelTrailer=0)
Initialize SmartDataDistributionBase system.
OPERATION_RESULT Initialize(const char *arrayParams[], int len, const char *hostAddress=0, const char *channelTrailer=0)
Initialize IDataDistribution instance.
virtual void ChangingState(DDM_INSTANCE_STATE actualState, DDM_INSTANCE_STATE futureState)
Callback invoked to report a starting instance state change.
virtual void ChangedState(DDM_INSTANCE_STATE actualState)
Callback invoked to report a finished instance state change.
std::string GetProtocol()
Returns the protocol in use from IDataDistribution instance.
Smart class to manage IDataDistributionChannelCallback.
Definition SmartDataDistributionManager.h:106
OPERATION_RESULT StopChannel(unsigned long timeout)
Stops the channel.
int64_t GetTimestamp()
Returns the timestamp.
virtual void OnConditionOrError(const OPERATION_RESULT errorCode, const int nativeCode, const char *subSystemReason)
Function to override to receive condition or error.
virtual void OnDataAvailable(const char *key, size_t keyLen, const void *buffer, const size_t len)
Function to override to receive data available.
const char * GetChannelName()
Returns the channel name.
virtual void OnUnderlyingEvent(const CHANNEL_HANDLE_PARAMETER, const UnderlyingEventData *uEvent)
Function to override to receive UnderlyingEventData.
OPERATION_RESULT Unlock()
Unlock the channel.
int64_t GetOffset()
Returns the actual channel offset.
~SmartDataDistributionChannel()
Destructor of SmartDataDistributionChannel.
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 ChangeChannelDirection(DDM_CHANNEL_DIRECTION direction)
Change the DDM_CHANNEL_DIRECTION of the channel.
SmartDataDistributionChannel()
Initialize a new SmartDataDistributionChannel.
void SetInformation(const char *channelName, IDataDistributionChannelBase *pIDataDistributionChannelBase, CHANNEL_HANDLE_PARAMETER, DDM_CHANNEL_DIRECTION direction)
Sets information on SmartDataDistributionChannel.
virtual void OnDataAvailable(const std::string key, const void *buffer, const size_t len)
Function to override to receive data available.
OPERATION_RESULT SeekChannel(int64_t position)
Seeks the channel.
DDM_CHANNEL_DIRECTION GetDirection()
Returns the DDM_CHANNEL_DIRECTION channel direction.
OPERATION_RESULT Lock(unsigned long timeout)
Locks the channel.
OPERATION_RESULT ReadFromChannel(int64_t offset, size_t *dataLen, void **buffer)
Reads data from the channel.
virtual void OnConditionOrError(const OPERATION_RESULT errorCode, const int nativeCode, const std::string subSystemReason)
Function to override to receive condition or error.
OPERATION_RESULT StartChannel(unsigned long timeout)
Starts the channel.
Smart class to manage DataDistribution.
Definition SmartDataDistributionManager.h:492
~SmartDataDistribution()
Destructor of SmartDataDistribution.
Definition SmartDataDistributionManager.h:501
SmartDataDistribution()
Initialize a new SmartDataDistribution.
Definition SmartDataDistributionManager.h:497
T * CreateSmartChannel(const char *channelName, DDM_CHANNEL_DIRECTION direction=DDM_CHANNEL_DIRECTION::ALL, const char *arrayParams[]=NULL, int len=0)
Creates a new smart channel.
Definition SmartDataDistributionManager.h:512
Smart class to manage ITimeMeasureWrapper.
Definition SmartDataDistributionManager.h:45
SmartTimeMeasureWrapper()
Initialize a new SmartTimeMeasureWrapper.
int64_t ElapsedMilliseconds()
Reports the elapsed time in milliseconds.
~SmartTimeMeasureWrapper()
Destructor of SmartTimeMeasureWrapper.
int64_t ElapsedMicroseconds()
Reports the elapsed time in microseconds.
void ResetTime()
Reset the timer.
int64_t ElapsedNanoseconds()
Reports the elapsed time in nanoseconds.
void AddNanoseconds(unsigned int time)
Adds nanoseconds time to actual value.
Class to reports information from transport subsystem.
Definition DataDistributionManager.h:274