#include <CorelinkClasses.h>
|
static void | connect (const std::string &serverIP, int port) |
|
static void | connectPlugin () |
|
static void | cleanup () |
|
static std::string | getToken () |
|
static std::vector< std::string > | listServerFunctions () |
|
static std::vector< std::string > | describeServerFunction (const std::string &func) |
|
static std::vector< std::string > | listWorkspaces () |
|
static bool | addWorkspace (const std::string &workspace) |
|
static bool | rmWorkspace (const std::string &workspace) |
|
static rapidjson::Document | genericComm (const rapidjson::Document &json) |
|
static rapidjson::Document | genericComm (const std::string &json) |
|
static rapidjson::Document | genericComm (const char *json, const int &len=0) |
|
static std::vector< int > | listStreams (const std::vector< std::string > &workspaces={}, const std::vector< std::string > &types={}) |
|
static StreamData | streamInfo (const int &streamID) |
|
static SendStream | createSender (const std::string &workspace, const std::string &type, const std::string &meta, bool echo, bool alert, int protocol) |
|
static RecvStream | createReceiver (const std::string &workspace, const std::vector< std::string > &types, const std::string &meta, bool echo, bool alert, int protocol) |
|
static bool | subscribe (const STREAM_ID &receiverID, const STREAM_ID &senderID) |
|
static bool | unsubscribe (const STREAM_ID &receiverID, const STREAM_ID &senderID) |
|
static bool | rmStream (const STREAM_ID &streamID) |
|
Definition at line 159 of file CorelinkClasses.h.
◆ addWorkspace()
bool Corelink::Client::addWorkspace |
( |
const std::string & |
workspace | ) |
|
|
inlinestatic |
Tries to add a workspace to the server.
- Parameters
-
workspace | Name of workspace to add to server. |
- Returns
- Success of adding workspace.
Definition at line 147 of file CorelinkClient.h.
◆ cleanup()
void Corelink::Client::cleanup |
( |
| ) |
|
|
inlinestatic |
◆ connect()
void Corelink::Client::connect |
( |
const std::string & |
serverIP, |
|
|
int |
port |
|
) |
| |
|
inlinestatic |
Tries to connect to the server using the provided address.
- Parameters
-
serverIP | Server IP. |
port | Server port. |
- Exceptions
-
ERROR_CODE_STATE | if client is already initialized. |
ERROR_CODE_SOCKET | if socket connection issues occur. |
ERROR_CODE_COMM | if credentials are incorrect. |
Definition at line 75 of file CorelinkClient.h.
◆ connectPlugin()
void Corelink::Client::connectPlugin |
( |
| ) |
|
|
inlinestatic |
Tries to connect to the server using environment variables provided by kubernetes.
- Parameters
-
serverIP | Server IP. |
port | Server port. |
- Exceptions
-
ERROR_CODE_STATE | if client is already initialized. |
ERROR_CODE_SOCKET | if socket connection issues occur. |
ERROR_CODE_COMM | if credentials are incorrect. |
ERROR_CODE_VALUE | if environment variables not found. |
Definition at line 81 of file CorelinkClient.h.
◆ createReceiver()
RecvStream Corelink::Client::createReceiver |
( |
const std::string & |
workspace, |
|
|
const std::vector< std::string > & |
types, |
|
|
const std::string & |
meta, |
|
|
bool |
echo, |
|
|
bool |
alert, |
|
|
int |
protocol |
|
) |
| |
|
inlinestatic |
Attempts to create a receiver stream.
- Parameters
-
workspace | workspace being used for stream. |
types | types of information stream is listening to. |
typeLen | amount of types provided |
meta | Metadata attached to stream. |
echo | Can client listen to itself. |
alert | Recieve server updates for new streams. |
protocol | Protocol used by stream. |
Definition at line 234 of file CorelinkClient.h.
◆ createSender()
SendStream Corelink::Client::createSender |
( |
const std::string & |
workspace, |
|
|
const std::string & |
type, |
|
|
const std::string & |
meta, |
|
|
bool |
echo, |
|
|
bool |
alert, |
|
|
int |
protocol |
|
) |
| |
|
inlinestatic |
Attempts to create a sender stream.
- Parameters
-
workspace | Workspace being used for stream. |
type | Type of information stream is sending. |
meta | Metadata attached to stream. |
echo | Can client listen to itself. |
alert | Recieve server updates for new streams. |
protocol | Protocol used by stream. |
- Returns
- Handler to access send functions.
Definition at line 227 of file CorelinkClient.h.
◆ describeServerFunction()
std::vector< std::string > Corelink::Client::describeServerFunction |
( |
const std::string & |
func | ) |
|
|
inlinestatic |
TODO: Create a wrapper class for the function data. Gets information about the function specified.
- Parameters
-
func | Function to get information on. |
- Returns
- List of properties of the function.
Definition at line 131 of file CorelinkClient.h.
◆ genericComm() [1/3]
rapidjson::Document Corelink::Client::genericComm |
( |
const rapidjson::Document & |
json | ) |
|
|
inlinestatic |
Sends a generic message to the server. (Best approach to use)
- Parameters
-
json | Rapidjson object to send. |
Definition at line 155 of file CorelinkClient.h.
◆ genericComm() [2/3]
rapidjson::Document Corelink::Client::genericComm |
( |
const std::string & |
json | ) |
|
|
inlinestatic |
Sends a generic message to the server.
- Parameters
-
json | Json string to send to the server. |
Definition at line 176 of file CorelinkClient.h.
◆ genericComm() [3/3]
rapidjson::Document Corelink::Client::genericComm |
( |
const char * |
json, |
|
|
const int & |
len = 0 |
|
) |
| |
|
inlinestatic |
Sends a generic message to the server.
- Parameters
-
json | Json string to send to the server. |
len | Length of message. Default to 0 if string ends with a null terminator. |
Definition at line 189 of file CorelinkClient.h.
◆ getToken()
std::string Corelink::Client::getToken |
( |
| ) |
|
|
inlinestatic |
Gets the current token string. (No actual use on client)
- Returns
- Current token value.
Gets the token assigned to the current session.
- Returns
- Token string.
Definition at line 104 of file CorelinkClient.h.
◆ listServerFunctions()
std::vector< std::string > Corelink::Client::listServerFunctions |
( |
| ) |
|
|
inlinestatic |
Gets list of functions available on the server.
- Returns
- List of functions on server.
Definition at line 124 of file CorelinkClient.h.
◆ listStreams()
std::vector< int > Corelink::Client::listStreams |
( |
const std::vector< std::string > & |
workspaces = {} , |
|
|
const std::vector< std::string > & |
types = {} |
|
) |
| |
|
inlinestatic |
Gets the list of sender streams available on the server.
- Parameters
-
workspaces | List of workspaces to include in data. Leave empty for all. |
types | List of types to include in data. Leave empty for all. |
- Returns
- List of sender streamIDs.
Definition at line 202 of file CorelinkClient.h.
◆ listWorkspaces()
std::vector< std::string > Corelink::Client::listWorkspaces |
( |
| ) |
|
|
inlinestatic |
Gets list of workspaces available on the server.
- Returns
- List of workspaces on server.
Definition at line 140 of file CorelinkClient.h.
◆ rmStream()
bool Corelink::Client::rmStream |
( |
const STREAM_ID & |
streamID | ) |
|
|
inlinestatic |
Destroys a receiver associated with this session and cleans it from the server.
- Parameters
-
streamID | ID of stream to remove from both server and client. |
Definition at line 252 of file CorelinkClient.h.
◆ rmWorkspace()
bool Corelink::Client::rmWorkspace |
( |
const std::string & |
workspace | ) |
|
|
inlinestatic |
Tries to remove a workspace from the server.
- Parameters
-
workspace | Name of workspace to remove from server. |
- Returns
- Success of removing workspace.
Definition at line 151 of file CorelinkClient.h.
◆ streamInfo()
StreamData Corelink::Client::streamInfo |
( |
const int & |
streamID | ) |
|
|
inlinestatic |
Gets information on a specific stream in the server.
- Parameters
-
streamID | ID to obtain information about. |
- Returns
- Streamdata containing server side information on the stream (does not include sources, reference and some other members).
Definition at line 220 of file CorelinkClient.h.
◆ subscribe()
bool Corelink::Client::subscribe |
( |
const STREAM_ID & |
receiverID, |
|
|
const STREAM_ID & |
senderID |
|
) |
| |
|
inlinestatic |
Subcribes a reciever to a new sender.
- Parameters
-
receiver | Reciever stream to listen to new sender. |
sender | Sender stream to listen to. |
- Returns
- Success or failure upon subscribing to stream.
Definition at line 242 of file CorelinkClient.h.
◆ unsubscribe()
bool Corelink::Client::unsubscribe |
( |
const STREAM_ID & |
receiverID, |
|
|
const STREAM_ID & |
senderID |
|
) |
| |
|
inlinestatic |
Unsubcribes a reciever from a sender.
- Parameters
-
receiver | Reciever stream to stop listening to sender. |
sender | Sender stream to stop listening to. |
- Returns
- Success or failure upon unsubscribing from stream.
Definition at line 247 of file CorelinkClient.h.
The documentation for this class was generated from the following files: