37#include <sio_client.h>
39#include "Base/Headers/String.h"
40#include "Base/Headers/Dictionary.h"
41#include "Base/Headers/Pointer.hpp"
42#include "Base/Headers/UUID.h"
115 void OnNewMessage(std::string
const& name, message::ptr
const& data,
bool hasAck, message::list &ack_resp);
117 void OnUserJoined(std::string
const& name, message::ptr
const& data,
bool hasAck, message::list &ack_resp);
119 void OnUserLeft(std::string
const& name, message::ptr
const& data,
bool hasAck, message::list &ack_resp);
121 void OnLogin(std::string
const& name, message::ptr
const& data,
bool hasAck, message::list &ack_resp);
123 void OnConnected(std::string
const& nsp);
125 void OnClosed(client::close_reason
const& reason);
129 std::unique_ptr<client> _io;
A hash-based key-value store, useful for quick associative lookups.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
A specific channel of communication within the SocketIO framework.
DynamicPointer< SocketIOChannel > createChannel(const StringView &name, UUID target=Constant< UUID >::Invalid)
Creates a new communication channel with the given name.
void removeChannel(DynamicPointer< SocketIOChannel > &channel)
Removes a channel from this connection.
DynamicPointer< SocketIOChannel > createChannel(const StringView &name, std::function< void(const char *data, uint04 size)> data_callback, UUID target=Constant< UUID >::Invalid)
Creates a new communication channel with a data receive callback.
void setName(const StringView &name)
Sets the display name for this client.
const String & url() const
Gets the current server URL.
SocketIO(QObject *parent=0)
Constructs a SocketIO instance.
void close()
Closes the current connection.
bool isConnected() const
Checks whether the client is currently connected.
const Dictionary< UUID, String > & onlineClients() const
Gets the dictionary of currently online clients.
void addChannel(DynamicPointer< SocketIOChannel > &channel)
Adds an existing channel to this connection.
bool connect(const StringView &url="http://ndevr.org:3000")
Connects to a SocketIO server at the given URL.
void setRunID(const UUID &run_id)
Sets the run ID for this session.
static DynamicPointer< SocketIO > GetSocketIO(const StringView &url="http://ndevr.org:3000")
Gets or creates a shared SocketIO instance for the given URL.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...