vrpn 07.35
Virtual Reality Peripheral Network
Loading...
Searching...
No Matches
vrpn_RedundantReceiver Class Reference

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. More...

#include <vrpn_RedundantTransmission.h>

Collaboration diagram for vrpn_RedundantReceiver:

Classes

struct  RRRecord
struct  RRMemory

Public Member Functions

 vrpn_RedundantReceiver (vrpn_Connection *)
virtual ~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.
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.
void clearMemory (void)
 Throws away / resets statistics.

Static Protected Member Functions

static int VRPN_CALLBACK handle_possiblyRedundantMessage (void *, vrpn_HANDLERPARAM)

Protected Attributes

vrpn_Connectiond_connection
RRRecord d_records [vrpn_CONNECTION_MAX_TYPES]
RRRecord d_generic
RRMemoryd_memory
RRMemoryd_lastMemory
vrpn_bool d_record

Detailed Description

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.

Constructor & Destructor Documentation

◆ vrpn_RedundantReceiver()

vrpn_RedundantReceiver::vrpn_RedundantReceiver ( vrpn_Connection * c)

Definition at line 415 of file vrpn_RedundantTransmission.C.

References d_connection, d_lastMemory, d_memory, and d_record.

Referenced by handle_possiblyRedundantMessage().

◆ ~vrpn_RedundantReceiver()

vrpn_RedundantReceiver::~vrpn_RedundantReceiver ( void )
virtual

Member Function Documentation

◆ clearMemory()

void vrpn_RedundantReceiver::clearMemory ( void )

Throws away / resets statistics.

Definition at line 587 of file vrpn_RedundantTransmission.C.

References d_lastMemory, d_memory, and vrpn_RedundantReceiver::RRMemory::next.

◆ handle_possiblyRedundantMessage()

◆ record()

void vrpn_RedundantReceiver::record ( vrpn_bool on)

Turns "memory" (tracking statistics of redundant reception) on and off.

Definition at line 552 of file vrpn_RedundantTransmission.C.

References d_record.

◆ register_handler()

int vrpn_RedundantReceiver::register_handler ( vrpn_int32 type,
vrpn_MESSAGEHANDLER handler,
void * userdata,
vrpn_int32 sender = vrpn_ANY_SENDER )
virtual

◆ unregister_handler()

int vrpn_RedundantReceiver::unregister_handler ( vrpn_int32 type,
vrpn_MESSAGEHANDLER handler,
void * userdata,
vrpn_int32 sender = vrpn_ANY_SENDER )
virtual

◆ writeMemory()

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 554 of file vrpn_RedundantTransmission.C.

References d_memory, vrpn_RedundantReceiver::RRMemory::next, vrpn_RedundantReceiver::RRMemory::numSeen, and vrpn_RedundantReceiver::RRMemory::timestamp.

Member Data Documentation

◆ d_connection

vrpn_Connection* vrpn_RedundantReceiver::d_connection
protected

◆ d_generic

RRRecord vrpn_RedundantReceiver::d_generic
protected

◆ d_lastMemory

RRMemory* vrpn_RedundantReceiver::d_lastMemory
protected

◆ d_memory

RRMemory* vrpn_RedundantReceiver::d_memory
protected

◆ d_record

vrpn_bool vrpn_RedundantReceiver::d_record
protected

◆ d_records


The documentation for this class was generated from the following files: