TINC
Toolkit for Interactive Computation
|
The TincServer class. More...
#include <TincServer.hpp>
Public Types | |
enum | { CREATE_DATA_SLICE = 0x01 } |
enum | Status { STATUS_UNKNOWN = 0x00 , STATUS_AVAILABLE = 0x01 , STATUS_BUSY = 0x02 } |
Public Member Functions | |
TincServer () | |
bool | sendTincMessage (void *msg, al::Socket *dst=nullptr, al::ValueSource *src=nullptr) override |
sendTincMessage More... | |
void | setVerbose (bool verbose) |
bool | verbose () |
bool | barrier (uint32_t group=0, float timeoutsec=0.0) override |
Initiate a barrier by notifying all connections to lock, and then unlock after all acknowledge. More... | |
std::pair< std::string, uint16_t > | serverAddress () |
void | disconnectAllClients () |
void | markBusy () override |
void | markAvailable () override |
bool | registerParameter (al::ParameterMeta ¶m, al::Socket *src=nullptr) |
register a parameter with this Tinc node More... | |
bool | registerParameterSpaceDimension (ParameterSpaceDimension &psd, al::Socket *src=nullptr) |
register a parameter space dimencion with this Tinc node More... | |
bool | registerParameterSpace (ParameterSpace &ps, al::Socket *src=nullptr) |
register a parameter space with this Tinc node More... | |
bool | registerProcessor (Processor &processor, al::Socket *src=nullptr) |
register a processor with this Tinc node More... | |
bool | registerDiskBuffer (DiskBufferAbstract &db, al::Socket *src=nullptr) |
register a disk buffer with this Tinc node More... | |
bool | registerDataPool (DataPool &dp, al::Socket *src=nullptr) |
register a data pool with this Tinc node More... | |
TincProtocol & | operator<< (al::ParameterMeta &p) |
TincProtocol & | operator<< (ParameterSpace &p) |
TincProtocol & | operator<< (ParameterSpaceDimension &psd) |
TincProtocol & | operator<< (Processor &p) |
TincProtocol & | operator<< (DiskBufferAbstract &db) |
TincProtocol & | operator<< (DataPool &dp) |
void | requestParameters (al::Socket *dst) |
void | requestParameterSpaces (al::Socket *dst) |
void | requestProcessors (al::Socket *dst) |
void | requestDiskBuffers (al::Socket *dst) |
void | requestDataPools (al::Socket *dst) |
void | removeParameter (std::string name, std::string group="", bool invoked=false, al::Socket *src=nullptr) |
void | removeParameterSpace (std::string name, al::Socket *src=nullptr) |
void | removeProcessor (std::string name, al::Socket *src=nullptr) |
void | removeDiskbuffer (std::string name, al::Socket *src=nullptr) |
void | removeDataPool (std::string name, al::Socket *src=nullptr) |
ParameterSpaceDimension * | getDimension (std::string name, std::string group="") |
get a registered dimension in this Tinc node More... | |
al::ParameterMeta * | getParameter (std::string name, std::string group="") |
get a parameter from a registered dimension in this Tinc node More... | |
std::vector< ParameterSpaceDimension * > | dimensions () |
ParameterSpace * | getParameterSpace (std::string name) |
std::vector< ParameterSpace * > | parameterSpaces () |
DiskBufferAbstract * | getDiskBuffer (std::string name) |
DataPool * | getDataPool (std::string name) |
Status | getStatus () |
void | setRootMapEntry (std::string serverPath, std::string clientPath, std::string host="") |
setRootMapEntry More... | |
const std::map< std::string, std::vector< std::pair< std::string, std::string > > > | getRootPathMap () |
void | print (std::ostream &stream=std::cout) |
Protected Member Functions | |
bool | processIncomingMessage (al::Message &message, al::Socket *src) override |
void | onConnection (al::Socket *newConnection) override |
void | processBarrierAckLock (al::Socket *src, uint64_t barrierConsecutive) |
void | processClientMetadataMessage (void *details, al::Socket *src) |
void | disconnectClient (al::Socket *src) |
void | connectParameterCallbacks (al::ParameterMeta ¶m) |
void | connectDimensionCallbacks (ParameterSpaceDimension &psd) |
void | readRequestMessage (int objectType, std::string objectId, al::Socket *src) |
void | processRequestParameters (al::Socket *dst) |
void | processRequestParameterSpaces (al::Socket *dst) |
void | processRequestProcessors (al::Socket *dst) |
void | processRequestDiskBuffers (al::Socket *dst) |
void | processRequestDataPools (al::Socket *dst) |
bool | readRegisterMessage (int objectType, void *any, al::Socket *src, bool forward=false) |
bool | processRegisterParameter (void *any, al::Socket *src, bool forward=false) |
bool | processRegisterParameterSpace (void *any, al::Socket *src, bool forward=false) |
bool | processRegisterProcessor (void *any, al::Socket *src, bool forward=false) |
bool | processRegisterDiskBuffer (void *any, al::Socket *src, bool forward=false) |
bool | processRegisterDataPool (void *any, al::Socket *src, bool forward=false) |
bool | processConfigureParameterMessage (void *conf, ParameterSpaceDimension *dim, al::Socket *src, bool forward=false) |
void | sendRegisterMessage (ParameterSpaceDimension *dim, al::Socket *dst, al::Socket *src=nullptr) |
void | sendRegisterMessage (ParameterSpace *ps, al::Socket *dst, al::Socket *src=nullptr) |
void | sendRegisterMessage (Processor *p, al::Socket *dst, al::Socket *src=nullptr) |
void | sendRegisterMessage (DiskBufferAbstract *p, al::Socket *dst, al::Socket *src=nullptr) |
void | sendRegisterMessage (DataPool *p, al::Socket *dst, al::Socket *src=nullptr) |
bool | readConfigureMessage (int objectType, void *any, al::Socket *src, bool forward=false) |
bool | processConfigureParameter (void *any, al::Socket *src, bool forward=false) |
bool | processConfigureParameterSpace (void *any, al::Socket *src, bool forward=false) |
bool | processConfigureProcessor (void *any, al::Socket *src, bool forward=false) |
bool | processConfigureDiskBuffer (void *any, al::Socket *src, bool forward=false) |
bool | processConfigureDataPool (void *any, al::Socket *src, bool forward=false) |
void | sendConfigureMessage (ParameterSpaceDimension *dim, al::Socket *dst, al::Socket *src=nullptr) |
void | sendConfigureMessage (ParameterSpace *ps, al::Socket *dst, al::Socket *src=nullptr) |
void | sendConfigureMessage (Processor *p, al::Socket *dst, al::Socket *src=nullptr) |
void | sendConfigureMessage (DataPool *p, al::Socket *dst, al::Socket *src=nullptr) |
void | sendConfigureMessage (DiskBufferAbstract *p, al::Socket *dst, al::Socket *src=nullptr) |
void | sendConfigureParameterSpaceAddDimension (ParameterSpace *ps, ParameterSpaceDimension *dim, al::Socket *dst, al::Socket *src=nullptr) |
void | sendConfigureParameterSpaceRemoveDimension (ParameterSpace *ps, ParameterSpaceDimension *dim, al::Socket *dst, al::Socket *src=nullptr) |
bool | readRemoveMessage (int objectType, void *any, al::Socket *src) |
bool | processRemoveParameter (void *any, al::Socket *src) |
void | sendRemoveMessage (ParameterSpaceDimension *dim, al::Socket *dst, al::Socket *src=nullptr) |
void | sendValueMessage (float value, std::string fullAddress, al::ValueSource *src=nullptr) |
void | sendValueMessage (bool value, std::string fullAddress, al::ValueSource *src=nullptr) |
void | sendValueMessage (int32_t value, std::string fullAddress, al::ValueSource *src=nullptr) |
void | sendValueMessage (uint64_t value, std::string fullAddress, al::ValueSource *src=nullptr) |
void | sendValueMessage (std::string value, std::string fullAddress, al::ValueSource *src=nullptr) |
void | sendValueMessage (al::Vec3f value, std::string fullAddress, al::ValueSource *src=nullptr) |
void | sendValueMessage (al::Vec4f value, std::string fullAddress, al::ValueSource *src=nullptr) |
void | sendValueMessage (al::Color value, std::string fullAddress, al::ValueSource *src=nullptr) |
void | sendValueMessage (al::Pose value, std::string fullAddress, al::ValueSource *src=nullptr) |
bool | readPingMessage (int objectType, void *any, al::Socket *src) |
bool | readCommandMessage (int objectType, void *any, al::Socket *src) |
bool | sendCommandErrorMessage (uint64_t commandId, std::string objectId, std::string errorMessage, al::Socket *src) |
bool | processCommandParameter (void *any, al::Socket *src) |
bool | processCommandParameterSpace (void *any, al::Socket *src) |
bool | processCommandDiskBuffer (void *any, al::Socket *src) |
bool | processCommandDataPool (void *any, al::Socket *src) |
bool | sendProtobufMessage (void *message, al::Socket *dst) |
std::string | mapFromRemotePath (std::string path, al::Socket *src) |
std::string | mapToRemotePath (std::string path, al::Socket *src) |
Protected Attributes | |
std::vector< ParameterSpaceDimension * > | mParameterSpaceDimensions |
std::vector< ParameterSpace * > | mParameterSpaces |
std::vector< Processor * > | mProcessors |
std::vector< DiskBufferAbstract * > | mDiskBuffers |
std::vector< DataPool * > | mDataPools |
std::vector< std::shared_ptr< ParameterSpaceDimension > > | mLocalPSDs |
std::vector< std::shared_ptr< ParameterSpace > > | mLocalPSs |
std::vector< std::shared_ptr< DiskBufferAbstract > > | mLocalDBs |
std::vector< std::shared_ptr< DataPool > > | mLocalDPs |
int | barrierWaitGranularTimeMs = 20 |
std::mutex | mBusyCountLock |
uint32_t | mBusyCount = 0 |
std::map< std::string, std::vector< std::pair< std::string, std::string > > > | mRootPathMap |
std::map< al::Socket *, std::string > | mClientHostnames |
std::map< al::Socket *, std::vector< uint64_t > > | mPongsReceived |
std::mutex | mPongLock |
bool | mVerbose {false} |
The TincServer class.
Listens for connections from TINC Clients (C++ or python) and synchronizes the state between them.
Definition at line 57 of file TincServer.hpp.
|
inherited |
Enumerator | |
---|---|
CREATE_DATA_SLICE |
Definition at line 74 of file TincProtocol.hpp.
|
inherited |
Enumerator | |
---|---|
STATUS_UNKNOWN | |
STATUS_AVAILABLE | |
STATUS_BUSY |
Definition at line 76 of file TincProtocol.hpp.
tinc::TincServer::TincServer | ( | ) |
|
overridevirtual |
Initiate a barrier by notifying all connections to lock, and then unlock after all acknowledge.
group | group to make the barrier for. 0 is all. |
timeoutsec | timeout in seconds |
This requires both server and clients to explicitly call barrier(). This is used to syncrhonize applications so they resume execution after all have finished executing a piece of code.
Implements tinc::TincProtocol.
|
protectedinherited |
|
protectedinherited |
|
inlineinherited |
Definition at line 206 of file TincProtocol.hpp.
void tinc::TincServer::disconnectAllClients | ( | ) |
|
protected |
|
inherited |
|
inherited |
get a registered dimension in this Tinc node
name | name (id) of the dimension |
group |
If group is empty, the first matching name in any group is returned
It is recommended that you always call this function instead of storing the pointer, as the dimension might be free in some cases, for example if it was created by a network REGISTER command and then destroyed through a network REMOVE command.
|
inherited |
|
inherited |
get a parameter from a registered dimension in this Tinc node
name | name (id) of the parameter |
group |
If group is empty, the first matching name in any group is returned
It is recommended that you always call this function instead of storing the pointer, as the dimension might be free in some cases, for example if it was created by a network REGISTER command and then destroyed through a network REMOVE command.
|
inherited |
|
inlineinherited |
Definition at line 255 of file TincProtocol.hpp.
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
overridevirtual |
Reimplemented from tinc::TincProtocol.
|
overridevirtual |
Reimplemented from tinc::TincProtocol.
|
overrideprotected |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
Definition at line 213 of file TincProtocol.hpp.
|
inherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
overrideprotected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
register a data pool with this Tinc node
dp | the data pool to register |
src | the source socket of the request |
If src is not nullptr, network notification of registration will be blocked for that destination.
|
inherited |
register a disk buffer with this Tinc node
db | the disk buffer to register |
src | the source socket of the request |
If src is not nullptr, network notification of registration will be blocked for that destination.
|
inherited |
register a parameter with this Tinc node
param | the parameter to register |
src | the source socket of the request |
If src is not nullptr, network notification of registration will be blocked for that destination. This is equivalent to registerParameterSpaceDimension() and will internally wrap the parameter in a dimension. TincClient does not take ownership of the param object, and does not free it when destroyed.
|
inherited |
register a parameter space with this Tinc node
psd | the parameter space dimension to register |
src | the source socket of the request |
If src is not nullptr, network notification of registration will be blocked for that destination.
|
inherited |
register a parameter space dimencion with this Tinc node
ps | the parameter space to register |
src | the source socket of the request |
If src is not nullptr, network notification of registration will be blocked for that destination. TincClient does not take ownership of the psd object, and does not free it when destroyed.
|
inherited |
register a processor with this Tinc node
processor | the processor to register |
src | the source socket of the request |
If src is not nullptr, network notification of registration will be blocked for that destination.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
overridevirtual |
sendTincMessage
msg | The encoded message to send |
dst | the socket to send meessage to. If nullptr send to all |
src | information of source. If passed block sending to this location. |
Reimplemented from tinc::TincProtocol.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
std::pair<std::string, uint16_t> tinc::TincServer::serverAddress | ( | ) |
|
inlineinherited |
setRootMapEntry
serverPath | |
clientPath | |
host | This function is only generally useful if set for the server. |
Definition at line 248 of file TincProtocol.hpp.
void tinc::TincServer::setVerbose | ( | bool | verbose | ) |
|
inline |
Definition at line 66 of file TincServer.hpp.
|
protectedinherited |
Definition at line 414 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 417 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 416 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 422 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 405 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 404 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 410 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 411 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 408 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 409 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 401 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 402 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 426 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 425 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 403 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 421 of file TincProtocol.hpp.
|
protectedinherited |
Definition at line 428 of file TincProtocol.hpp.