4 vrpn_uint32 level,
const struct timeval time)
Structure passed back to user-level code from a vrpn_Text_Receiver.
vrpn_int32 d_text_message_id
ID for text messages.
static int VRPN_CALLBACK handle_message(void *userdata, vrpn_HANDLERPARAM p)
vrpn_Text_Receiver(const char *name, vrpn_Connection *c=NULL)
const struct timeval vrpn_TEXT_NOW
char message[vrpn_MAX_TEXT_LEN]
Generic connection class not specific to the transport mechanism.
int send_message(const char *msg, vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL, vrpn_uint32 level=0, const struct timeval time=vrpn_TEXT_NOW)
Send a text message.
virtual int init(void)
Initialize things that the constructor can't. Returns 0 on success, -1 on failure.
static int decode_text_message_from_buffer(char *msg, vrpn_TEXT_SEVERITY *severity, vrpn_uint32 *level, const char *buf)
Decodes the body of the text message from a buffer from the connection.
int register_autodeleted_handler(vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, vrpn_int32 sender=vrpn_ANY_SENDER)
Registers a handler with the connection, and remembers to delete at destruction.
vrpn_Connection * d_connection
Connection that this object talks to.
virtual ~vrpn_Text_Receiver(void)
This structure is what is passed to a vrpn_Connection message callback.
int send_text_message(const char *msg, struct timeval timestamp, vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL, vrpn_uint32 level=0)
Sends a NULL-terminated text message from the device d_sender_id.
vrpn_Callback_List< vrpn_TEXTCB > d_callback_list
vrpn_TEXT_SEVERITY
Since the sending of text messages has been pulled into the base class (so that every object can send...
Allows a user to handle text messages directly, in addition too having the.
#define vrpn_gettimeofday
Class from which all user-level (and other) classes that communicate with vrpn_Connections should der...
vrpn_int32 d_sender_id
Sender ID registered with the connection.
void call_handlers(const CALLBACK_STRUCT &info)
This will pass the referenced parameter as a const to all the callbacks.