HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MC_MocapStreamImpl::ServerState Struct Reference

#include <MC_MocapStreamImpl.h>

Public Member Functions

 ServerState ()
 
bool connected ()
 Whether a connection is currently established. More...
 
void setConnected (bool connected)
 
bool killed ()
 Whether the connection has been killed. More...
 
void setKilled (bool killed)
 
bool portOpened ()
 
void setPortOpened (bool port_opened)
 
void setError (const char *msg)
 
bool getError (UT_StringHolder &res) const
 Reads the error message if one has been added. More...
 
void resetError ()
 Resets the error state. More...
 
void reset ()
 Resets the server state to its default values. More...
 
void gotPacket (UT_StringHolder &&packet)
 

Public Attributes

UT_ConcurrentQueue< std::pair
< UT_StringHolder, fpreal64 > > 
myPackets
 
UT_ConcurrentQueue
< UT_Function< void(void *)> > 
myTasks
 

Detailed Description

Keeps track of the state of a mocap stream server and is used as a method of communcating between a server function and the base class.

For thread safety, the server function should only call setConnected(), setPortOpened(), setError(), gotPacket(), and killed(). While the server function is running, it should be the only thread calling these methods.

Examples:
mocapstream/MocapStreamRokokoHDK.C.

Definition at line 115 of file MC_MocapStreamImpl.h.

Constructor & Destructor Documentation

MC_MocapStreamImpl::ServerState::ServerState ( )
inline

Definition at line 119 of file MC_MocapStreamImpl.h.

Member Function Documentation

bool MC_MocapStreamImpl::ServerState::connected ( )
inline

Whether a connection is currently established.

Definition at line 123 of file MC_MocapStreamImpl.h.

bool MC_MocapStreamImpl::ServerState::getError ( UT_StringHolder res) const
inline

Reads the error message if one has been added.

Definition at line 147 of file MC_MocapStreamImpl.h.

void MC_MocapStreamImpl::ServerState::gotPacket ( UT_StringHolder &&  packet)
inline

Called in the server function to pass a packet along to be parsed once it has been received.

Examples:
mocapstream/MocapStreamRokokoHDK.C.

Definition at line 177 of file MC_MocapStreamImpl.h.

bool MC_MocapStreamImpl::ServerState::killed ( )
inline

Whether the connection has been killed.

Examples:
mocapstream/MocapStreamRokokoHDK.C.

Definition at line 127 of file MC_MocapStreamImpl.h.

bool MC_MocapStreamImpl::ServerState::portOpened ( )
inline

Whether the port for receiving data has been opened. setPortOpened(True) must be called for the data to begin parsing.

Definition at line 132 of file MC_MocapStreamImpl.h.

void MC_MocapStreamImpl::ServerState::reset ( )
inline

Resets the server state to its default values.

Definition at line 164 of file MC_MocapStreamImpl.h.

void MC_MocapStreamImpl::ServerState::resetError ( )
inline

Resets the error state.

Examples:
mocapstream/MocapStreamRokokoHDK.C.

Definition at line 158 of file MC_MocapStreamImpl.h.

void MC_MocapStreamImpl::ServerState::setConnected ( bool  connected)
inline
Examples:
mocapstream/MocapStreamRokokoHDK.C.

Definition at line 124 of file MC_MocapStreamImpl.h.

void MC_MocapStreamImpl::ServerState::setError ( const char *  msg)
inline

Sends an error message from the server function to be added to the log.

Examples:
mocapstream/MocapStreamRokokoHDK.C.

Definition at line 137 of file MC_MocapStreamImpl.h.

void MC_MocapStreamImpl::ServerState::setKilled ( bool  killed)
inline

Definition at line 128 of file MC_MocapStreamImpl.h.

void MC_MocapStreamImpl::ServerState::setPortOpened ( bool  port_opened)
inline
Examples:
mocapstream/MocapStreamRokokoHDK.C.

Definition at line 133 of file MC_MocapStreamImpl.h.

Member Data Documentation

UT_ConcurrentQueue<std::pair<UT_StringHolder, fpreal64> > MC_MocapStreamImpl::ServerState::myPackets

Definition at line 116 of file MC_MocapStreamImpl.h.

UT_ConcurrentQueue<UT_Function<void(void*)> > MC_MocapStreamImpl::ServerState::myTasks

Definition at line 117 of file MC_MocapStreamImpl.h.


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