9 #ifndef __MC_MOCAPSTREAMIMPL_H_INCLUDED__
10 #define __MC_MOCAPSTREAMIMPL_H_INCLUDED__
23 #include <hboost/system/system_error.hpp>
48 bool myDoConvertUnits =
false;
49 bool myDoConvertUpAxis =
false;
66 bool myHasStartTime =
false;
76 friend class MC_MocapStreamManager;
96 MC_MocapStreamImpl::registerDevice(
this);
100 MC_MocapStreamImpl::unregisterDevice(
this);
104 return UTmakeUnique<T>();
116 UT_ConcurrentQueue<std::pair<UT_StringHolder, fpreal64>>
myPackets;
117 UT_ConcurrentQueue<UT_Function<void(void*)>>
myTasks;
168 myPortOpened =
false;
179 if (myPackets.unsafe_size() > 250)
183 myPackets.push(std::make_pair<UT_StringHolder, fpreal64>(
190 std::atomic<bool> myConnected;
191 std::atomic<bool> myKilled;
192 std::atomic<bool> myPortOpened;
193 std::atomic<bool> myError;
232 return myPort == other.
myPort
255 static void getBoostErrorMessage(hboost::system::error_code e,
261 static void handleBoostError(hboost::system::error_code e,
284 bool &parse_incomplete) = 0;
302 virtual int expirationCount();
307 virtual void updateJoints(
GU_Detail *gdp,
325 template <
typename... Args>
333 template <
typename... Args>
349 void queueServerTask(
const UT_Function<
void(
void*)> &task);
352 virtual const char*
name()
const = 0;
356 virtual const char*
label()
const = 0;
393 static void registerDevice(RegisterBase*);
394 static void unregisterDevice(RegisterBase*);
396 static void* threadBody(
void*
data);
400 void endServerThread();
415 const MC_MocapServerFunc myServerFunc;
416 const ServerOptions myServerOptions;
417 ServerState myServerState;
418 unsigned long long myParseCount;
UT_StringHolder myNodePath
GLuint GLsizei const GLchar * label
void setError(const char *msg)
UT_StringHolder myActorPattern
#define SYS_VISIBILITY_EXPORT
GT_API const UT_StringHolder time
SYS_VISIBILITY_EXPORT void newMocapStreamDevice(void *)
UT_ConcurrentQueue< std::pair< UT_StringHolder, fpreal64 > > myPackets
void addParseError(const char *fmt, Args &&...args)
Call this to report an error when parsing.
const UT_StringHolder theActorAttribName
unsigned long long uint64
bool killed()
Whether the connection has been killed.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
MC_MocapStreamCookParms myStreamCookParms
void gotPacket(UT_StringHolder &&packet)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void setConnected(bool connected)
virtual bool removeExpiredSkeletons() const
UT_StringHolder myConfigAttrib
UT_UniquePtr< MC_MocapStreamImpl > getInstance() override
UT_StringHolder myLocalIP
GLuint const GLchar * name
std::function< T > UT_Function
void addParseWarning(const char *fmt, Args &&...args)
Call this to report a warning when parsing.
bool getError(UT_StringHolder &res) const
Reads the error message if one has been added.
UT_StringHolder myMulticastIP
void resetError()
Resets the error state.
bool isSameConnection(const ServerOptions &other) const
void setPortOpened(bool port_opened)
void setKilled(bool killed)
UT_StringHolder myFacialAttribs
**If you just want to fire and args
UT_UniquePtr< GU_MotionClipRW > myClip
UT_ConcurrentQueue< UT_Function< void(void *)> > myTasks
void reset()
Resets the server state to its default values.
bool connected()
Whether a connection is currently established.