1 #ifndef VRPN_REDUNDANT_TRANSMISSION_H 2 #define VRPN_REDUNDANT_TRANSMISSION_H 28 vrpn_uint32 defaultRetransmissions(
void)
const;
29 timeval defaultInterval(
void)
const;
30 vrpn_bool isEnabled(
void)
const;
34 virtual void mainloop(
void);
38 void enable(vrpn_bool);
40 virtual void setDefaults(vrpn_uint32 numRetransmissions,
41 timeval transmissionInterval);
44 virtual int pack_message(vrpn_uint32 len, timeval time, vrpn_uint32 type,
45 vrpn_uint32 sender,
const char *buffer,
46 vrpn_uint32 class_of_service,
47 vrpn_int32 numRetransmissions = -1,
48 timeval *transmissionInterval = NULL);
80 char *
encode_set(
int *len, vrpn_uint32 num, timeval interval);
81 void decode_set(
const char **buf, vrpn_uint32 *num, timeval *interval);
129 void set(
int numRetransmissions, timeval transmissionInterval);
130 void enable(vrpn_bool);
155 #define VRPN_RR_LENGTH 8 170 void record(vrpn_bool);
174 void writeMemory(
const char *filename);
180 void clearMemory(
void);
214 #endif // VRPN_REDUNDANT_TRANSMISSION_H void register_types(vrpn_Connection *)
vrpn_RedundantController_Protocol d_protocol
Description of a callback entry for a user type.
int nextTimestampToReplace
vrpn_Connection * d_connection
timeval transmissionInterval
queuedMessage * d_messageList
vrpn_uint32 remainingTransmissions
vrpn_bool handlerIsRegistered
Sends messages to a vrpn_RedundantController so that a vrpn_RedundantTransmission on a server can be ...
Generic connection class not specific to the transport mechanism.
virtual int register_types(void)=0
Register the types of messages this device sends/receives. Return 0 on success, -1 on fail...
char * encode_enable(int *len, vrpn_bool)
vrpn_uint32 d_numTransmissions
int(VRPN_CALLBACK * vrpn_MESSAGEHANDLER)(void *userdata, vrpn_HANDLERPARAM p)
Type of a message handler for vrpn_Connection messages.
Accepts commands over a connection to control a local vrpn_RedundantTransmission's default parameters...
void decode_enable(const char **buf, vrpn_bool *)
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.
All types of client/server/peer objects in VRPN should be derived from the vrpn_BaseClass type descri...
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_Connection * d_connection
timeval d_transmissionInterval
This structure is what is passed to a vrpn_Connection message callback.
vrpn_RedundantController_Protocol d_protocol
const int vrpn_CONNECTION_MAX_TYPES
void decode_set(const char **buf, vrpn_uint32 *num, timeval *interval)
Class from which all user-level (and other) classes that communicate with vrpn_Connections should der...
vrpn_RedundantTransmission * d_object
vrpnMsgCallbackEntry * cb
class VRPN_API vrpn_RedundantTransmission
char * encode_set(int *len, vrpn_uint32 num, timeval interval)
Helper class for vrpn_Connection that automates redundant transmission for unreliable (low-latency) m...
vrpn_uint32 d_numMessagesQueued
For debugging, mostly.
const int vrpn_ANY_SENDER
vrpn_ANY_SENDER can be used to register callbacks on a given message type from any sender...