![]() |
RflySimSDK v3.05
RflySimSDK说明文档
|
#include <vrpn_Log.h>
Public 成员函数 | |
vrpn_Log (vrpn_TranslationTable *senders, vrpn_TranslationTable *types) | |
char * | getName () |
int | open (void) |
Opens the log file. | |
int | close (void) |
Closes and saves the log file. | |
int | saveLogSoFar (void) |
Saves any messages logged so far. | |
int | logIncomingMessage (size_t payloadLen, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer) |
int | logOutgoingMessage (vrpn_int32 payloadLen, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer) |
int | logMessage (vrpn_int32 payloadLen, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_bool isRemote=VRPN_FALSE) |
int | setCookie (const char *cookieBuffer) |
int | setCompoundName (const char *name, int index) |
int | setName (const char *name) |
int | setName (const char *name, size_t len) |
long & | logMode (void) |
Returns a reference so we can |= it. | |
int | addFilter (vrpn_LOGFILTER filter, void *userdata) |
timeval | lastLogTime () |
Returns the time of the last message that was logged | |
Protected 成员函数 | |
int | checkFilters (vrpn_int32 payloadLen, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer) |
Protected 属性 | |
char * | d_logFileName |
long | d_logmode |
vrpn_LOGLIST * | d_logTail |
vrpn_LOGLIST * | d_firstEntry |
FILE * | d_file |
char * | d_magicCookie |
vrpn_bool | d_wroteMagicCookie |
vrpnLogFilterEntry * | d_filters |
vrpn_TranslationTable * | d_senders |
vrpn_TranslationTable * | d_types |
timeval | d_lastLogTime |
Logs a VRPN stream. Used by vrpn_Endpoint.
int close | ( | void | ) |
Closes and saves the log file.
char * getName | ( | ) |
Allocates a new string and copies the log file name to it. IMPORTANT: code calling this function is responsible for freeing the memory.
timeval lastLogTime | ( | ) |
Returns the time of the last message that was logged
int logIncomingMessage | ( | size_t | payloadLen, |
struct timeval | time, | ||
vrpn_int32 | type, | ||
vrpn_int32 | sender, | ||
const char * | buffer ) |
Should be called with the timeval adjusted by the clock offset on the receiving Endpoint.
int logMessage | ( | vrpn_int32 | payloadLen, |
struct timeval | time, | ||
vrpn_int32 | type, | ||
vrpn_int32 | sender, | ||
const char * | buffer, | ||
vrpn_bool | isRemote = VRPN_FALSE ) |
We'd like to make this protected, but there's one place it needs to be exposed, at least until we get cleverer.
long & logMode | ( | void | ) |
Returns a reference so we can |= it.
int open | ( | void | ) |
Opens the log file.
int saveLogSoFar | ( | void | ) |
Saves any messages logged so far.
int setCompoundName | ( | const char * | name, |
int | index ) |
Takes a name of the form foo.bar and an index <n> and sets the name of the log file to be foo-<n>.bar; if there is no period in the name, merely appends -<n>.
int setCookie | ( | const char * | cookieBuffer | ) |
The magic cookie is set to the default value of the version of VRPN compiled, but a more correct value to write in the logfile (if we're logging incoming messages) is that of the version of VRPN we're communicating with.