vrpn
07.33
Virtual Reality Peripheral Network
|
#include <vrpn_RedundantTransmission.h>
Classes | |
struct | RRMemory |
struct | RRRecord |
Public Member Functions | |
vrpn_RedundantReceiver (vrpn_Connection *) | |
~vrpn_RedundantReceiver (void) | |
virtual int | register_handler (vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, vrpn_int32 sender=vrpn_ANY_SENDER) |
virtual int | unregister_handler (vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, vrpn_int32 sender=vrpn_ANY_SENDER) |
void | record (vrpn_bool) |
Turns "memory" (tracking statistics of redundant reception) on and off. More... | |
void | writeMemory (const char *filename) |
Writes statistics to the named file: timestamp of every message received and number of copies of that message. Detects partial losses, but not when all copies are lost, since vrpn_RR doesn't expect messages. More... | |
void | clearMemory (void) |
Throws away / resets statistics. More... | |
Static Protected Member Functions | |
static int VRPN_CALLBACK | handle_possiblyRedundantMessage (void *, vrpn_HANDLERPARAM) |
Protected Attributes | |
vrpn_Connection * | d_connection |
RRRecord | d_records [vrpn_CONNECTION_MAX_TYPES] |
RRRecord | d_generic |
RRMemory * | d_memory |
RRMemory * | d_lastMemory |
vrpn_bool | d_record |
Helper class that eliminates duplicates; only the first instance of a message is delivered. Registers a callback on connection for any type it's told to monitor; when it gets a message back, checks its list of recently-seen-timestamps for that type; if it isn't on the list, it's dispatched and replaces the oldest item on the list. List length is limited, so if too many messages of the same type (more than VRPN_RR_LENGTH) are interleaved - if transmissionInterval * numRetransmissions > VRPN_RR_LENGTH * the normal rate of message generation - it will not detect the redundant messages.
Definition at line 157 of file vrpn_RedundantTransmission.h.
vrpn_RedundantReceiver::vrpn_RedundantReceiver | ( | vrpn_Connection * | c | ) |
Definition at line 414 of file vrpn_RedundantTransmission.C.
References vrpn_Connection::addReference(), and d_connection.
vrpn_RedundantReceiver::~vrpn_RedundantReceiver | ( | void | ) |
Definition at line 426 of file vrpn_RedundantTransmission.C.
References vrpn_RedundantReceiver::RRRecord::cb, d_connection, d_generic, d_records, vrpnMsgCallbackEntry::next, vrpn_Connection::removeReference(), and vrpn_CONNECTION_MAX_TYPES.
void vrpn_RedundantReceiver::clearMemory | ( | void | ) |
Throws away / resets statistics.
Definition at line 567 of file vrpn_RedundantTransmission.C.
References d_lastMemory, d_memory, and vrpn_RedundantReceiver::RRMemory::next.
|
staticprotected |
Definition at line 580 of file vrpn_RedundantTransmission.C.
References vrpn_RedundantReceiver::RRRecord::cb, d_generic, d_lastMemory, d_memory, d_record, d_records, vrpnMsgCallbackEntry::handler, vrpn_HANDLERPARAM::msg_time, vrpnMsgCallbackEntry::next, vrpn_RedundantReceiver::RRMemory::next, vrpn_RedundantReceiver::RRRecord::nextTimestampToReplace, vrpn_RedundantReceiver::RRRecord::numSeen, vrpn_RedundantReceiver::RRMemory::numSeen, vrpn_HANDLERPARAM::sender, vrpnMsgCallbackEntry::sender, vrpn_RedundantReceiver::RRMemory::timestamp, vrpn_RedundantReceiver::RRRecord::timestampSeen, vrpn_HANDLERPARAM::type, vrpnMsgCallbackEntry::userdata, vrpn_ANY_SENDER, and VRPN_RR_LENGTH.
Referenced by register_handler().
void vrpn_RedundantReceiver::record | ( | vrpn_bool | on | ) |
Turns "memory" (tracking statistics of redundant reception) on and off.
Definition at line 532 of file vrpn_RedundantTransmission.C.
References d_record.
|
virtual |
Definition at line 454 of file vrpn_RedundantTransmission.C.
References vrpn_RedundantReceiver::RRRecord::cb, d_connection, d_generic, d_records, handle_possiblyRedundantMessage(), vrpnMsgCallbackEntry::handler, vrpn_RedundantReceiver::RRRecord::handlerIsRegistered, vrpnMsgCallbackEntry::next, vrpn_Connection::register_handler(), vrpnMsgCallbackEntry::sender, vrpnMsgCallbackEntry::userdata, and vrpn_ANY_TYPE.
|
virtual |
Definition at line 494 of file vrpn_RedundantTransmission.C.
References vrpn_RedundantReceiver::RRRecord::cb, d_generic, d_records, vrpnMsgCallbackEntry::handler, vrpnMsgCallbackEntry::next, vrpnMsgCallbackEntry::sender, vrpnMsgCallbackEntry::userdata, and vrpn_ANY_TYPE.
void vrpn_RedundantReceiver::writeMemory | ( | const char * | filename | ) |
Writes statistics to the named file: timestamp of every message received and number of copies of that message. Detects partial losses, but not when all copies are lost, since vrpn_RR doesn't expect messages.
Definition at line 534 of file vrpn_RedundantTransmission.C.
References d_memory, vrpn_RedundantReceiver::RRMemory::next, vrpn_RedundantReceiver::RRMemory::numSeen, and vrpn_RedundantReceiver::RRMemory::timestamp.
|
protected |
Definition at line 184 of file vrpn_RedundantTransmission.h.
Referenced by register_handler(), vrpn_RedundantReceiver(), and ~vrpn_RedundantReceiver().
|
protected |
Definition at line 198 of file vrpn_RedundantTransmission.h.
Referenced by handle_possiblyRedundantMessage(), register_handler(), unregister_handler(), and ~vrpn_RedundantReceiver().
|
protected |
Definition at line 207 of file vrpn_RedundantTransmission.h.
Referenced by clearMemory(), and handle_possiblyRedundantMessage().
|
protected |
Definition at line 206 of file vrpn_RedundantTransmission.h.
Referenced by clearMemory(), handle_possiblyRedundantMessage(), and writeMemory().
|
protected |
Definition at line 208 of file vrpn_RedundantTransmission.h.
Referenced by handle_possiblyRedundantMessage(), and record().
|
protected |
Definition at line 197 of file vrpn_RedundantTransmission.h.
Referenced by handle_possiblyRedundantMessage(), register_handler(), unregister_handler(), and ~vrpn_RedundantReceiver().