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

#include <vrpn_FunctionGenerator.h>

Inheritance diagram for vrpn_FunctionGenerator_Remote:
Collaboration diagram for vrpn_FunctionGenerator_Remote:

Public Member Functions

 vrpn_FunctionGenerator_Remote (const char *name, vrpn_Connection *c=NULL)
virtual ~vrpn_FunctionGenerator_Remote ()
int setChannel (const vrpn_uint32 channelNum, const vrpn_FunctionGenerator_channel *channel)
int requestChannel (const vrpn_uint32 channelNum)
int requestAllChannels ()
int requestStart ()
int requestStop ()
int requestSampleRate (const vrpn_float32 rate)
int requestInterpreterDescription ()
virtual void mainloop ()
 Called once through each main loop iteration to handle updates. Remote object mainloop() should call client_mainloop() and then call d_connection->mainloop(). Server object mainloop() should service the device and then call server_mainloop(), but should not normally call d_connection->mainloop().
virtual int register_channel_reply_handler (void *userdata, vrpn_FUNCTION_CHANGE_REPLY_HANDLER handler)
virtual int unregister_channel_reply_handler (void *userdata, vrpn_FUNCTION_CHANGE_REPLY_HANDLER handler)
virtual int register_start_reply_handler (void *userdata, vrpn_FUNCTION_START_REPLY_HANDLER handler)
virtual int unregister_start_reply_handler (void *userdata, vrpn_FUNCTION_START_REPLY_HANDLER handler)
virtual int register_stop_reply_handler (void *userdata, vrpn_FUNCTION_STOP_REPLY_HANDLER handler)
virtual int unregister_stop_reply_handler (void *userdata, vrpn_FUNCTION_STOP_REPLY_HANDLER handler)
virtual int register_sample_rate_reply_handler (void *userdata, vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER handler)
virtual int unregister_sample_rate_reply_handler (void *userdata, vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER handler)
virtual int register_interpreter_reply_handler (void *userdata, vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER handler)
virtual int unregister_interpreter_reply_handler (void *userdata, vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER handler)
virtual int register_error_handler (void *userdata, vrpn_FUNCTION_ERROR_HANDLER handler)
virtual int unregister_error_handler (void *userdata, vrpn_FUNCTION_ERROR_HANDLER handler)
Public Member Functions inherited from vrpn_FunctionGenerator
 vrpn_FunctionGenerator (const char *name, vrpn_Connection *c=NULL)
virtual ~vrpn_FunctionGenerator ()
const vrpn_FunctionGenerator_channelgetChannel (vrpn_uint32 channelNum)
vrpn_uint32 getNumChannels () const
vrpn_float32 getSampleRate ()
Public Member Functions inherited from vrpn_BaseClass
 vrpn_BaseClass (const char *name, vrpn_Connection *c=NULL)
 Names the device and assigns or opens connection, calls registration methods.
virtual ~vrpn_BaseClass ()
Public Member Functions inherited from vrpn_BaseClassUnique
 vrpn_BaseClassUnique ()
virtual ~vrpn_BaseClassUnique ()
 Unregister all of the message handlers that were to be autodeleted.
vrpn_ConnectionconnectionPtr ()
 Returns a pointer to the connection this object is using.

Static Public Member Functions

static int VRPN_CALLBACK handle_channelReply_message (void *userdata, vrpn_HANDLERPARAM p)
static int VRPN_CALLBACK handle_startReply_message (void *userdata, vrpn_HANDLERPARAM p)
static int VRPN_CALLBACK handle_stopReply_message (void *userdata, vrpn_HANDLERPARAM p)
static int VRPN_CALLBACK handle_sampleRateReply_message (void *userdata, vrpn_HANDLERPARAM p)
static int VRPN_CALLBACK handle_interpreterReply_message (void *userdata, vrpn_HANDLERPARAM p)
static int VRPN_CALLBACK handle_error_message (void *userdata, vrpn_HANDLERPARAM p)

Protected Member Functions

vrpn_int32 decode_channel_reply (const char *buf, const vrpn_int32 len, vrpn_uint32 &channelNum)
vrpn_int32 decode_start_reply (const char *buf, const vrpn_int32 len, vrpn_bool &isStarted)
vrpn_int32 decode_stop_reply (const char *buf, const vrpn_int32 len, vrpn_bool &isStopped)
vrpn_int32 decode_sampleRate_reply (const char *buf, const vrpn_int32 len)
vrpn_int32 decode_interpreterDescription_reply (const char *buf, const vrpn_int32 len, char **desc)
vrpn_int32 decode_error_reply (const char *buf, const vrpn_int32 len, FGError &error, vrpn_int32 &channel)
vrpn_int32 encode_channel (char **buf, vrpn_int32 &len, const vrpn_uint32 channelNum, const vrpn_FunctionGenerator_channel *channel)
vrpn_int32 encode_channel_request (char **buf, vrpn_int32 &len, const vrpn_uint32 channelNum)
vrpn_int32 encode_sampleRate_request (char **buf, vrpn_int32 &len, const vrpn_float32 sampleRate)
Protected Member Functions inherited from vrpn_FunctionGenerator
virtual int register_types ()
 Register the types of messages this device sends/receives. Return 0 on success, -1 on fail.
Protected Member Functions inherited from vrpn_BaseClass
virtual int init (void)
 Initialize things that the constructor can't. Returns 0 on success, -1 on failure.
virtual int register_senders (void)
 Register the sender for this device (by default, the name of the device). Return 0 on success, -1 on fail.
Protected Member Functions inherited from vrpn_BaseClassUnique
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.
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.
SendTextMessageBoundCall send_text_message (vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL)
 Returns an object you can stream into to send a text message from the device like send_text_message(vrpn_TEXT_WARNING) << "Value of i is: " << i; This use requires including vrpn_SendTextMessageStreamProxy.h.
void server_mainloop (void)
 Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should be called by all servers in their mainloop().
void client_mainloop (void)
 Handles functions that all clients should provide in their mainloop() (warning of no server, for example) Should be called by all clients in their mainloop().

Protected Attributes

vrpn_Callback_List< vrpn_FUNCTION_CHANNEL_REPLY_CBchannel_reply_list
vrpn_Callback_List< vrpn_FUNCTION_START_REPLY_CBstart_reply_list
vrpn_Callback_List< vrpn_FUNCTION_STOP_REPLY_CBstop_reply_list
vrpn_Callback_List< vrpn_FUNCTION_SAMPLE_RATE_REPLY_CBsample_rate_reply_list
vrpn_Callback_List< vrpn_FUNCTION_INTERPRETER_REPLY_CBinterpreter_reply_list
vrpn_Callback_List< vrpn_FUNCTION_ERROR_CBerror_list
Protected Attributes inherited from vrpn_FunctionGenerator
vrpn_float32 sampleRate
vrpn_uint32 numChannels
vrpn_FunctionGenerator_channelchannels [vrpn_FUNCTION_CHANNELS_MAX]
vrpn_int32 channelMessageID
vrpn_int32 requestChannelMessageID
vrpn_int32 requestAllChannelsMessageID
vrpn_int32 sampleRateMessageID
vrpn_int32 startFunctionMessageID
vrpn_int32 stopFunctionMessageID
vrpn_int32 requestInterpreterMessageID
vrpn_int32 channelReplyMessageID
vrpn_int32 startFunctionReplyMessageID
vrpn_int32 stopFunctionReplyMessageID
vrpn_int32 sampleRateReplyMessageID
vrpn_int32 interpreterReplyMessageID
vrpn_int32 errorMessageID
vrpn_int32 gotConnectionMessageID
char msgbuf [vrpn_CONNECTION_TCP_BUFLEN]
struct timeval timestamp
Protected Attributes inherited from vrpn_BaseClassUnique
vrpn_Connectiond_connection
 Connection that this object talks to.
char * d_servicename
 Name of this device, not including the connection part.
vrpn_int32 d_sender_id
 Sender ID registered with the connection.
vrpn_int32 d_text_message_id
 ID for text messages.
vrpn_int32 d_ping_message_id
 Ask the server if they are there.
vrpn_int32 d_pong_message_id
 Server telling that it is there.

Additional Inherited Members

Public Types inherited from vrpn_FunctionGenerator
enum  FGError {
  NO_FG_ERROR = 0 , INTERPRETER_ERROR = 1 , TAKING_TOO_LONG = 2 , INVALID_RESULT_QUANTITY = 3 ,
  INVALID_RESULT_RANGE = 4
}
Public Attributes inherited from vrpn_BaseClassUnique
bool shutup
Static Protected Member Functions inherited from vrpn_BaseClassUnique
static int encode_text_message_to_buffer (char *buf, vrpn_TEXT_SEVERITY severity, vrpn_uint32 level, const char *msg)
 Encodes the body of the text message into a buffer, preparing for sending.
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.

Detailed Description

Definition at line 347 of file vrpn_FunctionGenerator.h.

Constructor & Destructor Documentation

◆ vrpn_FunctionGenerator_Remote()

◆ ~vrpn_FunctionGenerator_Remote()

virtual vrpn_FunctionGenerator_Remote::~vrpn_FunctionGenerator_Remote ( )
inlinevirtual

Definition at line 351 of file vrpn_FunctionGenerator.h.

Member Function Documentation

◆ decode_channel_reply()

vrpn_int32 vrpn_FunctionGenerator_Remote::decode_channel_reply ( const char * buf,
const vrpn_int32 len,
vrpn_uint32 & channelNum )
protected

Definition at line 1678 of file vrpn_FunctionGenerator.C.

References vrpn_FunctionGenerator::channels, vrpn_FUNCTION_CHANNELS_MAX, and vrpn_unbuffer().

Referenced by handle_channelReply_message().

Here is the call graph for this function:

◆ decode_error_reply()

vrpn_int32 vrpn_FunctionGenerator_Remote::decode_error_reply ( const char * buf,
const vrpn_int32 len,
FGError & error,
vrpn_int32 & channel )
protected

Definition at line 2062 of file vrpn_FunctionGenerator.C.

References vrpn_FunctionGenerator::NO_FG_ERROR, and vrpn_unbuffer().

Referenced by handle_error_message().

Here is the call graph for this function:

◆ decode_interpreterDescription_reply()

vrpn_int32 vrpn_FunctionGenerator_Remote::decode_interpreterDescription_reply ( const char * buf,
const vrpn_int32 len,
char ** desc )
protected

Definition at line 1998 of file vrpn_FunctionGenerator.C.

References vrpn_unbuffer().

Referenced by handle_interpreterReply_message().

Here is the call graph for this function:

◆ decode_sampleRate_reply()

vrpn_int32 vrpn_FunctionGenerator_Remote::decode_sampleRate_reply ( const char * buf,
const vrpn_int32 len )
protected

Definition at line 1942 of file vrpn_FunctionGenerator.C.

References vrpn_FunctionGenerator::sampleRate, and vrpn_unbuffer().

Referenced by handle_sampleRateReply_message().

Here is the call graph for this function:

◆ decode_start_reply()

vrpn_int32 vrpn_FunctionGenerator_Remote::decode_start_reply ( const char * buf,
const vrpn_int32 len,
vrpn_bool & isStarted )
protected

Definition at line 1851 of file vrpn_FunctionGenerator.C.

References vrpn_unbuffer().

Referenced by handle_startReply_message().

Here is the call graph for this function:

◆ decode_stop_reply()

vrpn_int32 vrpn_FunctionGenerator_Remote::decode_stop_reply ( const char * buf,
const vrpn_int32 len,
vrpn_bool & isStopped )
protected

Definition at line 1897 of file vrpn_FunctionGenerator.C.

References vrpn_unbuffer().

Referenced by handle_stopReply_message().

Here is the call graph for this function:

◆ encode_channel()

vrpn_int32 vrpn_FunctionGenerator_Remote::encode_channel ( char ** buf,
vrpn_int32 & len,
const vrpn_uint32 channelNum,
const vrpn_FunctionGenerator_channel * channel )
protected

Definition at line 1548 of file vrpn_FunctionGenerator.C.

References vrpn_FunctionGenerator_channel::encode_to(), vrpn_buffer(), and vrpn_FUNCTION_CHANNELS_MAX.

Referenced by setChannel().

Here is the call graph for this function:

◆ encode_channel_request()

vrpn_int32 vrpn_FunctionGenerator_Remote::encode_channel_request ( char ** buf,
vrpn_int32 & len,
const vrpn_uint32 channelNum )
protected

Definition at line 1719 of file vrpn_FunctionGenerator.C.

References vrpn_buffer().

Referenced by requestChannel().

Here is the call graph for this function:

◆ encode_sampleRate_request()

vrpn_int32 vrpn_FunctionGenerator_Remote::encode_sampleRate_request ( char ** buf,
vrpn_int32 & len,
const vrpn_float32 sampleRate )
protected

Definition at line 1777 of file vrpn_FunctionGenerator.C.

References vrpn_FunctionGenerator::sampleRate, and vrpn_buffer().

Referenced by requestSampleRate().

Here is the call graph for this function:

◆ handle_channelReply_message()

◆ handle_error_message()

◆ handle_interpreterReply_message()

◆ handle_sampleRateReply_message()

◆ handle_startReply_message()

◆ handle_stopReply_message()

◆ mainloop()

void vrpn_FunctionGenerator_Remote::mainloop ( )
virtual

Called once through each main loop iteration to handle updates. Remote object mainloop() should call client_mainloop() and then call d_connection->mainloop(). Server object mainloop() should service the device and then call server_mainloop(), but should not normally call d_connection->mainloop().

Implements vrpn_BaseClass.

Definition at line 1255 of file vrpn_FunctionGenerator.C.

References vrpn_BaseClassUnique::client_mainloop(), and vrpn_BaseClassUnique::d_connection.

Here is the call graph for this function:

◆ register_channel_reply_handler()

int vrpn_FunctionGenerator_Remote::register_channel_reply_handler ( void * userdata,
vrpn_FUNCTION_CHANGE_REPLY_HANDLER handler )
virtual

◆ register_error_handler()

int vrpn_FunctionGenerator_Remote::register_error_handler ( void * userdata,
vrpn_FUNCTION_ERROR_HANDLER handler )
virtual

◆ register_interpreter_reply_handler()

int vrpn_FunctionGenerator_Remote::register_interpreter_reply_handler ( void * userdata,
vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER handler )
virtual

◆ register_sample_rate_reply_handler()

int vrpn_FunctionGenerator_Remote::register_sample_rate_reply_handler ( void * userdata,
vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER handler )
virtual

◆ register_start_reply_handler()

int vrpn_FunctionGenerator_Remote::register_start_reply_handler ( void * userdata,
vrpn_FUNCTION_START_REPLY_HANDLER handler )
virtual

◆ register_stop_reply_handler()

int vrpn_FunctionGenerator_Remote::register_stop_reply_handler ( void * userdata,
vrpn_FUNCTION_STOP_REPLY_HANDLER handler )
virtual

◆ requestAllChannels()

◆ requestChannel()

int vrpn_FunctionGenerator_Remote::requestChannel ( const vrpn_uint32 channelNum)

◆ requestInterpreterDescription()

◆ requestSampleRate()

int vrpn_FunctionGenerator_Remote::requestSampleRate ( const vrpn_float32 rate)

◆ requestStart()

◆ requestStop()

◆ setChannel()

int vrpn_FunctionGenerator_Remote::setChannel ( const vrpn_uint32 channelNum,
const vrpn_FunctionGenerator_channel * channel )

◆ unregister_channel_reply_handler()

int vrpn_FunctionGenerator_Remote::unregister_channel_reply_handler ( void * userdata,
vrpn_FUNCTION_CHANGE_REPLY_HANDLER handler )
virtual

◆ unregister_error_handler()

int vrpn_FunctionGenerator_Remote::unregister_error_handler ( void * userdata,
vrpn_FUNCTION_ERROR_HANDLER handler )
virtual

◆ unregister_interpreter_reply_handler()

int vrpn_FunctionGenerator_Remote::unregister_interpreter_reply_handler ( void * userdata,
vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER handler )
virtual

◆ unregister_sample_rate_reply_handler()

int vrpn_FunctionGenerator_Remote::unregister_sample_rate_reply_handler ( void * userdata,
vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER handler )
virtual

◆ unregister_start_reply_handler()

int vrpn_FunctionGenerator_Remote::unregister_start_reply_handler ( void * userdata,
vrpn_FUNCTION_START_REPLY_HANDLER handler )
virtual

◆ unregister_stop_reply_handler()

int vrpn_FunctionGenerator_Remote::unregister_stop_reply_handler ( void * userdata,
vrpn_FUNCTION_STOP_REPLY_HANDLER handler )
virtual

Member Data Documentation

◆ channel_reply_list

vrpn_Callback_List<vrpn_FUNCTION_CHANNEL_REPLY_CB> vrpn_FunctionGenerator_Remote::channel_reply_list
protected

◆ error_list

vrpn_Callback_List<vrpn_FUNCTION_ERROR_CB> vrpn_FunctionGenerator_Remote::error_list
protected

◆ interpreter_reply_list

◆ sample_rate_reply_list

◆ start_reply_list

vrpn_Callback_List<vrpn_FUNCTION_START_REPLY_CB> vrpn_FunctionGenerator_Remote::start_reply_list
protected

◆ stop_reply_list

vrpn_Callback_List<vrpn_FUNCTION_STOP_REPLY_CB> vrpn_FunctionGenerator_Remote::stop_reply_list
protected

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