NDEVR
API Documentation
SocketIOChannel

A specific channel of communication within the SocketIO framework. More...

Collaboration diagram for SocketIOChannel:
[legend]

Public Member Functions

const Stringname () const
 Gets the name of this channel.
void sendData (const char *data, uint04 size)
 Sends data over this channel.
void setRecieveDataCallback (std::function< void(const char *data, uint04 size)> data_callback)
 Sets the callback to invoke when data is received on this channel.
const UUIDtarget () const
 Gets the target UUID for this channel.

Protected Member Functions

 SocketIOChannel (const StringView &name, std::function< void(const char *data, uint04 size)> data_callback, UUID target=Constant< UUID >::Invalid)
 Constructs a channel with a data receive callback.
 SocketIOChannel (const StringView &name, UUID target=Constant< UUID >::Invalid)
 Constructs a channel with the given name and optional target.
void recieveData (const char *data, uint04 size)
 Dispatches received data to the receive callback.
void setSendDataCallback (std::function< void(const char *data, uint04 size)> data_callback)
 Sets the callback used to send data through the SocketIO connection.

Protected Attributes

String m_name
 The channel name.
std::function< void(const char *data, uint04 size)> m_recieve_data_callback
 Callback for incoming data.
std::function< void(const char *data, uint04 size)> m_send_data_callback
 Callback for outgoing data.
UUID m_target
 The target client UUID, or invalid for broadcast.

Detailed Description

A specific channel of communication within the SocketIO framework.


Definition at line 41 of file SocketIOChannel.h.

Constructor & Destructor Documentation

◆ SocketIOChannel() [1/2]

SocketIOChannel::SocketIOChannel ( const StringView & name,
UUID target = Constant<UUID>::Invalid )
inlineexplicitprotected

Constructs a channel with the given name and optional target.

Parameters
[in]nameThe channel name. Must not be empty or contain '|'.
[in]targetThe UUID of the target client, or invalid for broadcast.

Definition at line 49 of file SocketIOChannel.h.

References m_name, m_recieve_data_callback, m_target, name(), and target().

◆ SocketIOChannel() [2/2]

SocketIOChannel::SocketIOChannel ( const StringView & name,
std::function< void(const char *data, uint04 size)> data_callback,
UUID target = Constant<UUID>::Invalid )
inlineprotected

Constructs a channel with a data receive callback.

Parameters
[in]nameThe channel name. Must not be empty or contain '|'.
[in]data_callbackCallback invoked when data is received.
[in]targetThe UUID of the target client, or invalid for broadcast.

Definition at line 61 of file SocketIOChannel.h.

References m_name, m_recieve_data_callback, m_target, name(), and target().

Member Function Documentation

◆ name()

const String & SocketIOChannel::name ( ) const
inline

Gets the name of this channel.

Returns
A reference to the channel name string.

Definition at line 86 of file SocketIOChannel.h.

References m_name.

Referenced by SocketIOChannel(), and SocketIOChannel().

◆ recieveData()

void SocketIOChannel::recieveData ( const char * data,
uint04 size )
inlineprotected

Dispatches received data to the receive callback.

Parameters
[in]dataPointer to the received data.
[in]sizeThe number of bytes received.

Definition at line 100 of file SocketIOChannel.h.

References m_recieve_data_callback.

◆ sendData()

void SocketIOChannel::sendData ( const char * data,
uint04 size )
inline

Sends data over this channel.

Parameters
[in]dataPointer to the data buffer to send.
[in]sizeThe number of bytes to send.

Definition at line 77 of file SocketIOChannel.h.

References m_send_data_callback.

◆ setRecieveDataCallback()

void SocketIOChannel::setRecieveDataCallback ( std::function< void(const char *data, uint04 size)> data_callback)
inline

Sets the callback to invoke when data is received on this channel.

Parameters
[in]data_callbackThe receive data callback function.

Definition at line 72 of file SocketIOChannel.h.

References m_recieve_data_callback.

◆ setSendDataCallback()

void SocketIOChannel::setSendDataCallback ( std::function< void(const char *data, uint04 size)> data_callback)
inlineprotected

Sets the callback used to send data through the SocketIO connection.

Parameters
[in]data_callbackThe send data callback function.

Definition at line 95 of file SocketIOChannel.h.

References m_send_data_callback.

◆ target()

const UUID & SocketIOChannel::target ( ) const
inline

Gets the target UUID for this channel.

Returns
A reference to the target UUID.

Definition at line 90 of file SocketIOChannel.h.

References m_target.

Referenced by SocketIOChannel(), and SocketIOChannel().


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