Diarkis C++Client Library API Document
DiarkisRpcBase Class Reference

Base class implementing sample RPC functionality. More...

#include <DiarkisRpcBase.h>

Collaboration diagram for DiarkisRpcBase:

Public Member Functions

 DiarkisRpcBase ()
 DiarkisRpcBase constructor. More...
 
virtual ~DiarkisRpcBase ()
 DiarkisRpcBase destructor. More...
 
virtual void SetupRpc (const char *uid, const std::shared_ptr< IDiarkisRoom > &room, const std::shared_ptr< LoggerFactory > &loggerFactory)
 Set up RPC. More...
 
virtual void SetupRpc (const std::string &uid, const std::shared_ptr< IDiarkisRoom > &room, const std::shared_ptr< LoggerFactory > &loggerFactory)
 Same as SetupRpc() More...
 
virtual bool RPCAll (uint32_t rpcID, const uint8_t *payload, size_t payloadSize, bool reliable=true)
 Call the RPCs of all participants in the room. More...
 
virtual bool RPCAll (uint32_t rpcID, const std::vector< uint8_t > &payload, bool reliable=true)
 Same as RPCAll() More...
 
virtual bool RPCMany (uint32_t rpcID, const char **memberIDs, size_t memberIDsCount, const uint8_t *payload, size_t payloadSize, bool reliable=true)
 Calls the RPC of any member participating in the room. More...
 
virtual bool RPCMany (uint32_t rpcID, const std::vector< std::string > &memberIDs, const std::vector< uint8_t > &payload, bool reliable=true)
 Same as RPCMany() More...
 
virtual bool RPCOne (uint32_t rpcID, const char *userID, const uint8_t *payload, size_t payloadSize, bool reliable=true)
 Calls the RPC of a specific member participating in the room. More...
 
virtual bool RPCOne (uint32_t rpcID, const std::string &userID, const std::vector< uint8_t > &payload, bool reliable=true)
 Same as RPCOne() More...
 

Protected Attributes

std::shared_ptr< IDiarkisRPCrpc_
 Pointer to IDiarkisRPC class. More...
 
std::shared_ptr< IDiarkisRoomroom_
 Pointer to IDiarkisRoom class. More...
 
std::shared_ptr< IDiarkisLoggerlogger_
 Pointer to IDiarkisLogger. More...
 
Diarkis::StdString ownUid_
 My user ID. More...
 
Diarkis::StdVector< std::function< void()> > eventUnsubscriptions_
 Lambda functions list. More...
 

Detailed Description

Base class implementing sample RPC functionality.

Constructor & Destructor Documentation

◆ DiarkisRpcBase()

DiarkisRpcBase::DiarkisRpcBase ( )

DiarkisRpcBase constructor.

◆ ~DiarkisRpcBase()

DiarkisRpcBase::~DiarkisRpcBase ( )
virtual

DiarkisRpcBase destructor.

Member Function Documentation

◆ SetupRpc() [1/2]

void DiarkisRpcBase::SetupRpc ( const char *  uid,
const std::shared_ptr< IDiarkisRoom > &  room,
const std::shared_ptr< LoggerFactory > &  loggerFactory 
)
virtual

Set up RPC.

Register loggers and callback functions.

Parameters
[in]uidyour user ID
[in]roomPointer to IDiarkisRoom class
[in]loggerFactoryLog for client library
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupRpc() [2/2]

void DiarkisRpcBase::SetupRpc ( const std::string &  uid,
const std::shared_ptr< IDiarkisRoom > &  room,
const std::shared_ptr< LoggerFactory > &  loggerFactory 
)
virtual

Same as SetupRpc()

Here is the call graph for this function:

◆ RPCAll() [1/2]

bool DiarkisRpcBase::RPCAll ( uint32_t  rpcID,
const uint8_t *  payload,
size_t  payloadSize,
bool  reliable = true 
)
virtual

Call the RPCs of all participants in the room.

Parameters
[in]rpcIDID of the RPC to be called
[in]payloadData to be sent
[in]payloadSizeLength of the payload
[in]reliableDetermines whether to send over reliable communication (RUDP).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RPCAll() [2/2]

bool DiarkisRpcBase::RPCAll ( uint32_t  rpcID,
const std::vector< uint8_t > &  payload,
bool  reliable = true 
)
virtual

Same as RPCAll()

Here is the call graph for this function:

◆ RPCMany() [1/2]

bool DiarkisRpcBase::RPCMany ( uint32_t  rpcID,
const char **  memberIDs,
size_t  memberIDsCount,
const uint8_t *  payload,
size_t  payloadSize,
bool  reliable = true 
)
virtual

Calls the RPC of any member participating in the room.

Parameters
[in]rpcIDID of the RPC to call
[in]memberIDsList of user IDs of members to call
[in]memberIDsCountNumber of member IDs
[in]payloadData to be sent
[in]payloadSizeLength of the payload
[in]reliableDetermines whether to send over reliable communication (RUDP).
Here is the caller graph for this function:

◆ RPCMany() [2/2]

bool DiarkisRpcBase::RPCMany ( uint32_t  rpcID,
const std::vector< std::string > &  memberIDs,
const std::vector< uint8_t > &  payload,
bool  reliable = true 
)
virtual

Same as RPCMany()

Here is the call graph for this function:

◆ RPCOne() [1/2]

bool DiarkisRpcBase::RPCOne ( uint32_t  rpcID,
const char *  userID,
const uint8_t *  payload,
size_t  payloadSize,
bool  reliable = true 
)
virtual

Calls the RPC of a specific member participating in the room.

Parameters
[in]rpcIDID of the RPC to call
[in]userIDTarget user ID
[in]payloadData to be sent
[in]payloadSizeLength of the payload
[in]reliableDetermines whether to send over reliable communication (RUDP).
Here is the caller graph for this function:

◆ RPCOne() [2/2]

bool DiarkisRpcBase::RPCOne ( uint32_t  rpcID,
const std::string &  userID,
const std::vector< uint8_t > &  payload,
bool  reliable = true 
)
virtual

Same as RPCOne()

Here is the call graph for this function:

Member Data Documentation

◆ rpc_

std::shared_ptr<IDiarkisRPC> DiarkisRpcBase::rpc_
protected

Pointer to IDiarkisRPC class.

◆ room_

std::shared_ptr<IDiarkisRoom> DiarkisRpcBase::room_
protected

Pointer to IDiarkisRoom class.

◆ logger_

std::shared_ptr<IDiarkisLogger> DiarkisRpcBase::logger_
protected

Pointer to IDiarkisLogger.

◆ ownUid_

Diarkis::StdString DiarkisRpcBase::ownUid_
protected

My user ID.

◆ eventUnsubscriptions_

Diarkis::StdVector<std::function<void()> > DiarkisRpcBase::eventUnsubscriptions_
protected

Lambda functions list.


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