vrpn  07.33
Virtual Reality Peripheral Network
vrpn_FunctionGenerator.h
Go to the documentation of this file.
1 #ifndef VRPN_FUNCTIONGENERATOR_H
2 #define VRPN_FUNCTIONGENERATOR_H
3 
4 #include <stddef.h> // for NULL
5 
6 #include "vrpn_Analog.h" // for vrpn_CHANNEL_MAX
7 #include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc
8 #include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API
9 #include "vrpn_Connection.h"
10 #include "vrpn_Shared.h" // for timeval
11 #include "vrpn_Types.h" // for vrpn_int32, vrpn_uint32, etc
12 
13 
15 
16 extern const char* vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL;
20 extern const char* vrpn_FUNCTION_MESSAGE_TYPE_START;
21 extern const char* vrpn_FUNCTION_MESSAGE_TYPE_STOP;
24 extern const char* vrpn_FUNCTION_MESSAGE_TYPE_STOP_REPLY;
29 
31 
32 // a base class for all functions that vrpn_FunctionGenerator
33 // can generate
35 {
36 public:
37  virtual ~vrpn_FunctionGenerator_function() = 0;
38 
39  // concrete classes should implement this to generate the appropriate
40  // values for the function the class represents. nValue samples should be
41  // generated beginning at time startTime, and these samples should be placed
42  // in the provided buffer. several data members of 'channel' can modify the
43  // times for which values are generated.
44  // returns the time of the last sample generated.
45  virtual vrpn_float32 generateValues( vrpn_float32* buf, vrpn_uint32 nValues,
46  vrpn_float32 startTime, vrpn_float32 sampleRate,
47  vrpn_FunctionGenerator_channel* channel ) const = 0;
48 
49  // concrete classes should implement this to encode their
50  // function information into the specified buffer 'buf'. The
51  // remaining length in the buffer is stored in 'len'. At return,
52  // 'len' should be set to the number of characters remaining in the
53  // buffer and the number of characters written should be returned,
54  // save in case of failure, when negative should be returned.
55  virtual vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const = 0;
56 
57  // concrete classes should implement this to decode their
58  // function information from the specified buffer. The remaining
59  // length in the buffer is stored in 'len'. At return, 'len' should
60  // be set to the number of characters remaining in the the buffer
61  // and the number of characters read should be returned, save in case
62  // of failure, when negative should be returned
63  virtual vrpn_int32 decode_from( const char** buf, vrpn_int32& len ) = 0;
64 
65  virtual vrpn_FunctionGenerator_function* clone( ) const = 0;
66 
67  // used when encoding/decoding to specify function type
69  {
70  FUNCTION_NULL = 0,
71  FUNCTION_SCRIPT = 1
72  };
73 
74  // concrete classes should implement this to return the
75  // appropriate FunctionCode, from above
76  virtual FunctionCode getFunctionCode( ) const = 0;
77 
78 
79 };
80 
81 
82 // the NULL function: generate all zeros
84 : public virtual vrpn_FunctionGenerator_function
85 {
86 public:
89 
90  vrpn_float32 generateValues( vrpn_float32* buf, vrpn_uint32 nValues,
91  vrpn_float32 startTime, vrpn_float32 sampleRate,
92  vrpn_FunctionGenerator_channel* channel ) const;
93 
94  vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const;
95  vrpn_int32 decode_from( const char** buf, vrpn_int32& len );
97 protected:
99 
100 };
101 
102 
104 : public virtual vrpn_FunctionGenerator_function
105 {
106 public:
108  vrpn_FunctionGenerator_function_script( const char* script );
111 
112  virtual vrpn_float32 generateValues( vrpn_float32* buf, vrpn_uint32 nValues,
113  vrpn_float32 startTime, vrpn_float32 sampleRate,
114  vrpn_FunctionGenerator_channel* channel ) const;
115 
116  vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const;
117  vrpn_int32 decode_from( const char** buf, vrpn_int32& len );
119 
120  // returns a copy of the script. caller is responsible for
121  // calling 'delete []' to free the returned string.
122  char* getScript( ) const;
123 
124  const char* getConstScript( ) const
125  { return script; }
126 
127  vrpn_bool setScript( char* script );
128 
129 protected:
131  char* script;
132 
133 };
134 
135 
137 {
138  // note: the channel will delete its function when the function is
139  // no longer needed (e.g., when the channel is destroyed or the function changed)
140 public:
143  virtual ~vrpn_FunctionGenerator_channel( );
144 
145  const vrpn_FunctionGenerator_function* getFunction( ) const { return function; }
146  void setFunction( vrpn_FunctionGenerator_function* function );
147 
148  // these return zero on success and negative on some failure.
149  vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const;
150  vrpn_int32 decode_from( const char** buf, vrpn_int32& len );
151 
152 protected:
154 
155 };
156 
157 
159 {
160 public:
161  vrpn_FunctionGenerator( const char* name, vrpn_Connection* c = NULL );
162  virtual ~vrpn_FunctionGenerator( );
163 
164  // returns the requested channel, or null if channelNum is
165  // greater than the maximum number of channels.
166  const vrpn_FunctionGenerator_channel* getChannel( vrpn_uint32 channelNum );
167 
168  vrpn_uint32 getNumChannels( ) const { return numChannels; }
169 
170  vrpn_float32 getSampleRate( )
171  { return sampleRate; }
172 
173  enum FGError
174  {
175  NO_FG_ERROR = 0,
176  INTERPRETER_ERROR = 1, // the interpreter (for script) had some problem
177  TAKING_TOO_LONG = 2, // samples were not generated quickly enough
178  INVALID_RESULT_QUANTITY = 3, // an incorrect number of values was generated
179  INVALID_RESULT_RANGE = 4 // generated values were out of range
180  };
181 
182 protected:
183  vrpn_float32 sampleRate; // samples per second
184  vrpn_uint32 numChannels;
186 
187  vrpn_int32 channelMessageID; // id for channel message (remote -> server)
188  vrpn_int32 requestChannelMessageID; // id for messages requesting channel info be sent (remote -> server)
189  vrpn_int32 requestAllChannelsMessageID; // id for messages requesting channel info of all channels be sent (remote -> server)
190  vrpn_int32 sampleRateMessageID; // id for message to request a sampling rate (remote -> server)
191  vrpn_int32 startFunctionMessageID; // id for message to start generating the function (remote -> server)
192  vrpn_int32 stopFunctionMessageID; // id for message to stop generating the function (remote -> server)
193  vrpn_int32 requestInterpreterMessageID; // id for message to request interpreter description (remote -> server)
194 
195  vrpn_int32 channelReplyMessageID; // id for reply for channel message (server -> remote)
196  vrpn_int32 startFunctionReplyMessageID; // id for reply to start-function message (server -> remote)
197  vrpn_int32 stopFunctionReplyMessageID; // id for reply to stop-function message (server -> remote)
198  vrpn_int32 sampleRateReplyMessageID; // id for reply to request-sample-rate message (server -> remote)
199  vrpn_int32 interpreterReplyMessageID; // id for reply to request-interpreter message (server -> remote)
200  vrpn_int32 errorMessageID; // id for error reports
201 
202  vrpn_int32 gotConnectionMessageID; // for new-connection message
203 
204  virtual int register_types( );
205 
207  struct timeval timestamp;
208 }; // end class vrpn_FunctionGenerator
209 
210 
212 {
213 public:
214  vrpn_FunctionGenerator_Server( const char* name, vrpn_uint32 numChannels = vrpn_FUNCTION_CHANNELS_MAX, vrpn_Connection* c = NULL );
215  virtual ~vrpn_FunctionGenerator_Server( );
216 
217  virtual void mainloop( );
218 
219  // sub-classes should implement these functions. they will be called when messages
220  // are received for the particular request. at the end of these functions, servers
221  // should call the appropriate send*Reply function, even (especially!) if the requested
222  // change was rejected.
223  virtual void setChannel( vrpn_uint32 channelNum, vrpn_FunctionGenerator_channel* channel ) = 0;
224  virtual void start( ) = 0;
225  virtual void stop( ) = 0;
226  virtual void setSampleRate( vrpn_float32 rate ) = 0;
227 
228  vrpn_uint32 setNumChannels( vrpn_uint32 numChannels );
229 
230  // sub-classes should implement this function to provide a description of the type
231  // of interpreter used to interpret vrpn_FunctionGenerator_function_script
232  virtual const char* getInterpreterDescription( ) = 0;
233 
234  // sub-classes should not override these methods; these take care of
235  // receiving requests
236  static int VRPN_CALLBACK handle_channel_message( void* userdata, vrpn_HANDLERPARAM p );
237  static int VRPN_CALLBACK handle_channelRequest_message( void* userdata, vrpn_HANDLERPARAM p );
238  static int VRPN_CALLBACK handle_allChannelRequest_message( void* userdata, vrpn_HANDLERPARAM p );
239  static int VRPN_CALLBACK handle_start_message( void* userdata, vrpn_HANDLERPARAM p );
240  static int VRPN_CALLBACK handle_stop_message( void* userdata, vrpn_HANDLERPARAM p );
241  static int VRPN_CALLBACK handle_sample_rate_message( void* userdata, vrpn_HANDLERPARAM p );
242  static int VRPN_CALLBACK handle_interpreter_request_message( void* userdata, vrpn_HANDLERPARAM p );
243 
244 protected:
245 
246  // sub-classes should call these functions to inform the remote side of
247  // changes (or of non-changes, when a requested change cannot be accepted).
248  // returns 0 on success and negative on failure.
249  int sendChannelReply( vrpn_uint32 channelNum );
250  int sendSampleRateReply( );
251  int sendStartReply( vrpn_bool started );
252  int sendStopReply( vrpn_bool stopped );
253  int sendInterpreterDescription( );
254 
255  // sub-classes should use this function to report an error in function generation
256  int sendError( FGError error, vrpn_int32 channel );
257 
258  vrpn_int32 decode_channel( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum,
260  vrpn_int32 decode_channel_request( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum );
261  vrpn_int32 decode_sampleRate_request( const char* buf, const vrpn_int32 len, vrpn_float32& sampleRate );
262 
263  vrpn_int32 encode_channel_reply( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum );
264  vrpn_int32 encode_start_reply( char** buf, vrpn_int32& len, const vrpn_bool isStarted );
265  vrpn_int32 encode_stop_reply( char** buf, vrpn_int32& len, const vrpn_bool isStopped );
266  vrpn_int32 encode_sampleRate_reply( char** buf, vrpn_int32& len, const vrpn_float32 sampleRate );
267  vrpn_int32 encode_interpreterDescription_reply( char** buf, vrpn_int32& len, const char* desc );
268  vrpn_int32 encode_error_report( char** buf, vrpn_int32& len, const FGError err, const vrpn_int32 channel );
269 
270 }; // end class vrpn_FunctionGenerator_Server
271 
272 
273 //----------------------------------------------------------
274 // ************** Users deal with the following *************
275 
276 // User routine to handle function-generator channel replies. This
277 // is called when the function-generator server replies with new
278 // setting for some channel.
279 typedef struct _vrpn_FUNCTION_CHANNEL_REPLY_CB
280 {
281  struct timeval msg_time; // Time of the report
282  vrpn_uint32 channelNum; // Which channel is being reported
285 typedef void (VRPN_CALLBACK *vrpn_FUNCTION_CHANGE_REPLY_HANDLER)( void *userdata,
286  const vrpn_FUNCTION_CHANNEL_REPLY_CB info );
287 
288 // User routine to handle function-generator start replies. This
289 // is called when the function-generator server reports that it
290 // has started generating functions.
291 typedef struct _vrpn_FUNCTION_START_REPLY_CB
292 {
293  struct timeval msg_time; // Time of the report
294  vrpn_bool isStarted; // did the function generation start?
296 typedef void (VRPN_CALLBACK *vrpn_FUNCTION_START_REPLY_HANDLER)( void *userdata,
297  const vrpn_FUNCTION_START_REPLY_CB info );
298 
299 // User routine to handle function-generator stop replies. This
300 // is called when the function-generator server reports that it
301 // has stopped generating functions.
302 typedef struct _vrpn_FUNCTION_STOP_REPLY_CB
303 {
304  struct timeval msg_time; // Time of the report
305  vrpn_bool isStopped; // did the function generation stop?
307 typedef void (VRPN_CALLBACK *vrpn_FUNCTION_STOP_REPLY_HANDLER)( void *userdata,
308  const vrpn_FUNCTION_STOP_REPLY_CB info );
309 
310 // User routine to handle function-generator sample-rate replies.
311 // This is called when the function-generator server reports that
312 // the function-generation sample rate has changed.
313 typedef struct _vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB
314 {
315  struct timeval msg_time; // Time of the report
316  vrpn_float32 sampleRate;
320 
321 
322 // User routine to handle function-generator interpreter-description replies.
323 // This is called when the function-generator server reports the description
324 // of its interpreter.
325 typedef struct _vrpn_FUNCTION_INTERPRETER_REPLY_CB
326 {
327  struct timeval msg_time; // Time of the report
328  char* description;
332 
333 
334 // User routine to handle function-generator error notifications.
335 // This is called when the function-generator server reports some
336 // error in the generation of a function.
337 typedef struct _vrpn_FUNCTION_ERROR_CB
338 {
339  struct timeval msg_time; // Time of the report
341  vrpn_int32 channel;
343 typedef void (VRPN_CALLBACK *vrpn_FUNCTION_ERROR_HANDLER)( void *userdata,
344  const vrpn_FUNCTION_ERROR_CB info );
345 
346 
348 {
349 public:
350  vrpn_FunctionGenerator_Remote( const char* name, vrpn_Connection* c = NULL );
352 
353  int setChannel( const vrpn_uint32 channelNum, const vrpn_FunctionGenerator_channel* channel );
354  int requestChannel( const vrpn_uint32 channelNum );
355  int requestAllChannels( );
356  int requestStart( );
357  int requestStop( );
358  int requestSampleRate( const vrpn_float32 rate );
359  int requestInterpreterDescription( );
360 
361  virtual void mainloop( );
362 
363  // (un)Register a callback handler to handle a channel reply
364  virtual int register_channel_reply_handler( void *userdata,
366  virtual int unregister_channel_reply_handler( void *userdata,
368 
369  // (un)Register a callback handler to handle a start reply
370  virtual int register_start_reply_handler( void *userdata,
372  virtual int unregister_start_reply_handler( void *userdata,
374 
375  // (un)Register a callback handler to handle a stop reply
376  virtual int register_stop_reply_handler( void *userdata,
378  virtual int unregister_stop_reply_handler( void *userdata,
380 
381  // (un)Register a callback handler to handle a sample-rate reply
382  virtual int register_sample_rate_reply_handler( void *userdata,
384  virtual int unregister_sample_rate_reply_handler( void *userdata,
386 
387  // (un)Register a callback handler to handle an interpreter message
388  virtual int register_interpreter_reply_handler( void *userdata,
390  virtual int unregister_interpreter_reply_handler( void *userdata,
392 
393  virtual int register_error_handler( void* userdata,
394  vrpn_FUNCTION_ERROR_HANDLER handler );
395  virtual int unregister_error_handler( void* userdata,
396  vrpn_FUNCTION_ERROR_HANDLER handler );
397 
398  static int VRPN_CALLBACK handle_channelReply_message( void* userdata, vrpn_HANDLERPARAM p );
399  static int VRPN_CALLBACK handle_startReply_message( void* userdata, vrpn_HANDLERPARAM p );
400  static int VRPN_CALLBACK handle_stopReply_message( void* userdata, vrpn_HANDLERPARAM p );
401  static int VRPN_CALLBACK handle_sampleRateReply_message( void* userdata, vrpn_HANDLERPARAM p );
402  static int VRPN_CALLBACK handle_interpreterReply_message( void* userdata, vrpn_HANDLERPARAM p );
403  static int VRPN_CALLBACK handle_error_message( void* userdata, vrpn_HANDLERPARAM p );
404 
405 protected:
412 
413 
414  vrpn_int32 decode_channel_reply( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum );
415  vrpn_int32 decode_start_reply( const char* buf, const vrpn_int32 len, vrpn_bool& isStarted );
416  vrpn_int32 decode_stop_reply( const char* buf, const vrpn_int32 len, vrpn_bool& isStopped );
417  vrpn_int32 decode_sampleRate_reply( const char* buf, const vrpn_int32 len );
418  vrpn_int32 decode_interpreterDescription_reply( const char* buf, const vrpn_int32 len, char** desc );
419  vrpn_int32 decode_error_reply( const char* buf, const vrpn_int32 len, FGError& error, vrpn_int32& channel );
420 
421  vrpn_int32 encode_channel( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum,
422  const vrpn_FunctionGenerator_channel* channel );
423  vrpn_int32 encode_channel_request( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum );
424  vrpn_int32 encode_sampleRate_request( char** buf, vrpn_int32& len, const vrpn_float32 sampleRate );
425 
426 }; // end class vrpn_FunctionGenerator_Remote
427 
428 
429 #endif // VRPN_FUNCTIONGENERATOR_H
vrpn_FunctionGenerator_function_script::getConstScript
const char * getConstScript() const
Definition: vrpn_FunctionGenerator.h:124
vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE_REPLY
const char * vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE_REPLY
Definition: vrpn_FunctionGenerator.C:18
vrpn_FunctionGenerator::FGError
FGError
Definition: vrpn_FunctionGenerator.h:174
vrpn_FunctionGenerator_Remote::sample_rate_reply_list
vrpn_Callback_List< vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB > sample_rate_reply_list
Definition: vrpn_FunctionGenerator.h:409
vrpn_FunctionGenerator::errorMessageID
vrpn_int32 errorMessageID
Definition: vrpn_FunctionGenerator.h:200
vrpn_FunctionGenerator_function::generateValues
virtual vrpn_float32 generateValues(vrpn_float32 *buf, vrpn_uint32 nValues, vrpn_float32 startTime, vrpn_float32 sampleRate, vrpn_FunctionGenerator_channel *channel) const =0
vrpn_BaseClass.h
vrpn_FUNCTION_ERROR_CB::channel
vrpn_int32 channel
Definition: vrpn_FunctionGenerator.h:341
vrpn_FunctionGenerator::requestInterpreterMessageID
vrpn_int32 requestInterpreterMessageID
Definition: vrpn_FunctionGenerator.h:193
vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER
void(VRPN_CALLBACK * vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER)(void *userdata, const vrpn_FUNCTION_INTERPRETER_REPLY_CB info)
Definition: vrpn_FunctionGenerator.h:330
vrpn_FUNCTION_START_REPLY_CB
Definition: vrpn_FunctionGenerator.h:292
vrpn_Types.h
vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REQUEST
const char * vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REQUEST
Definition: vrpn_FunctionGenerator.C:19
vrpn_FunctionGenerator::sampleRateReplyMessageID
vrpn_int32 sampleRateReplyMessageID
Definition: vrpn_FunctionGenerator.h:198
vrpn_FunctionGenerator::getSampleRate
vrpn_float32 getSampleRate()
Definition: vrpn_FunctionGenerator.h:170
vrpn_FUNCTION_STOP_REPLY_CB
Definition: vrpn_FunctionGenerator.h:303
vrpn_FunctionGenerator
Definition: vrpn_FunctionGenerator.h:159
vrpn_FunctionGenerator_function_script::getFunctionCode
FunctionCode getFunctionCode() const
Definition: vrpn_FunctionGenerator.h:130
vrpn_FunctionGenerator_function::FUNCTION_SCRIPT
@ FUNCTION_SCRIPT
Definition: vrpn_FunctionGenerator.h:71
vrpn_FunctionGenerator_Remote::channel_reply_list
vrpn_Callback_List< vrpn_FUNCTION_CHANNEL_REPLY_CB > channel_reply_list
Definition: vrpn_FunctionGenerator.h:406
vrpn_FunctionGenerator_function::FunctionCode
FunctionCode
Definition: vrpn_FunctionGenerator.h:69
vrpn_FunctionGenerator::requestChannelMessageID
vrpn_int32 requestChannelMessageID
Definition: vrpn_FunctionGenerator.h:188
vrpn_FunctionGenerator_Remote::interpreter_reply_list
vrpn_Callback_List< vrpn_FUNCTION_INTERPRETER_REPLY_CB > interpreter_reply_list
Definition: vrpn_FunctionGenerator.h:410
vrpn_FUNCTION_MESSAGE_TYPE_ERROR
const char * vrpn_FUNCTION_MESSAGE_TYPE_ERROR
Definition: vrpn_FunctionGenerator.C:21
vrpn_Callback_List< vrpn_FUNCTION_CHANNEL_REPLY_CB >
vrpn_CHANNEL_MAX
#define vrpn_CHANNEL_MAX
Definition: vrpn_Analog.h:16
vrpn_FunctionGenerator::startFunctionMessageID
vrpn_int32 startFunctionMessageID
Definition: vrpn_FunctionGenerator.h:191
vrpn_FunctionGenerator_Remote::stop_reply_list
vrpn_Callback_List< vrpn_FUNCTION_STOP_REPLY_CB > stop_reply_list
Definition: vrpn_FunctionGenerator.h:408
vrpn_FunctionGenerator::sampleRateMessageID
vrpn_int32 sampleRateMessageID
Definition: vrpn_FunctionGenerator.h:190
vrpn_FunctionGenerator_function::getFunctionCode
virtual FunctionCode getFunctionCode() const =0
vrpn_FUNCTION_ERROR_HANDLER
void(VRPN_CALLBACK * vrpn_FUNCTION_ERROR_HANDLER)(void *userdata, const vrpn_FUNCTION_ERROR_CB info)
Definition: vrpn_FunctionGenerator.h:343
vrpn_FunctionGenerator_Server::setSampleRate
virtual void setSampleRate(vrpn_float32 rate)=0
vrpn_CONNECTION_TCP_BUFLEN
const int vrpn_CONNECTION_TCP_BUFLEN
Definition: vrpn_Connection.h:95
vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REPLY
const char * vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REPLY
Definition: vrpn_FunctionGenerator.C:20
vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB::sampleRate
vrpn_float32 sampleRate
Definition: vrpn_FunctionGenerator.h:316
vrpn_FUNCTION_INTERPRETER_REPLY_CB
Definition: vrpn_FunctionGenerator.h:326
vrpn_FunctionGenerator_function
Definition: vrpn_FunctionGenerator.h:35
vrpn_FunctionGenerator::requestAllChannelsMessageID
vrpn_int32 requestAllChannelsMessageID
Definition: vrpn_FunctionGenerator.h:189
vrpn_FUNCTION_CHANNEL_REPLY_CB
Definition: vrpn_FunctionGenerator.h:280
vrpn_FunctionGenerator_Remote
Definition: vrpn_FunctionGenerator.h:348
vrpn_FunctionGenerator::gotConnectionMessageID
vrpn_int32 gotConnectionMessageID
Definition: vrpn_FunctionGenerator.h:202
vrpn_FunctionGenerator_function::clone
virtual vrpn_FunctionGenerator_function * clone() const =0
vrpn_HANDLERPARAM
This structure is what is passed to a vrpn_Connection message callback.
Definition: vrpn_Connection.h:44
vrpn_Shared.h
vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE
const char * vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE
Definition: vrpn_FunctionGenerator.C:12
vrpn_FUNCTION_STOP_REPLY_HANDLER
void(VRPN_CALLBACK * vrpn_FUNCTION_STOP_REPLY_HANDLER)(void *userdata, const vrpn_FUNCTION_STOP_REPLY_CB info)
Definition: vrpn_FunctionGenerator.h:307
vrpn_FunctionGenerator_function::encode_to
virtual vrpn_int32 encode_to(char **buf, vrpn_int32 &len) const =0
vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB
Definition: vrpn_FunctionGenerator.h:314
vrpn_FunctionGenerator_channel
Definition: vrpn_FunctionGenerator.h:137
vrpn_FUNCTION_ERROR_CB
Definition: vrpn_FunctionGenerator.h:338
vrpn_FunctionGenerator_Remote::~vrpn_FunctionGenerator_Remote
virtual ~vrpn_FunctionGenerator_Remote()
Definition: vrpn_FunctionGenerator.h:351
vrpn_FUNCTION_MESSAGE_TYPE_START
const char * vrpn_FUNCTION_MESSAGE_TYPE_START
Definition: vrpn_FunctionGenerator.C:13
vrpn_BaseClass::mainloop
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_FunctionGenerator_Server
Definition: vrpn_FunctionGenerator.h:212
vrpn_FunctionGenerator::numChannels
vrpn_uint32 numChannels
Definition: vrpn_FunctionGenerator.h:184
vrpn_FunctionGenerator_Server::start
virtual void start()=0
vrpn_FunctionGenerator_function_NULL::~vrpn_FunctionGenerator_function_NULL
virtual ~vrpn_FunctionGenerator_function_NULL()
Definition: vrpn_FunctionGenerator.h:88
vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER
void(VRPN_CALLBACK * vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER)(void *userdata, const vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB info)
Definition: vrpn_FunctionGenerator.h:318
vrpn_FunctionGenerator_function_NULL::getFunctionCode
FunctionCode getFunctionCode() const
Definition: vrpn_FunctionGenerator.h:98
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition: vrpn_Connection.h:510
vrpn_FUNCTION_MESSAGE_TYPE_STOP_REPLY
const char * vrpn_FUNCTION_MESSAGE_TYPE_STOP_REPLY
Definition: vrpn_FunctionGenerator.C:17
vrpn_Connection.h
vrpn_FunctionGenerator_Remote::error_list
vrpn_Callback_List< vrpn_FUNCTION_ERROR_CB > error_list
Definition: vrpn_FunctionGenerator.h:411
vrpn_FunctionGenerator::interpreterReplyMessageID
vrpn_int32 interpreterReplyMessageID
Definition: vrpn_FunctionGenerator.h:199
vrpn_FunctionGenerator::stopFunctionReplyMessageID
vrpn_int32 stopFunctionReplyMessageID
Definition: vrpn_FunctionGenerator.h:197
vrpn_FunctionGenerator_Server::getInterpreterDescription
virtual const char * getInterpreterDescription()=0
vrpn_FUNCTION_CHANGE_REPLY_HANDLER
void(VRPN_CALLBACK * vrpn_FUNCTION_CHANGE_REPLY_HANDLER)(void *userdata, const vrpn_FUNCTION_CHANNEL_REPLY_CB info)
Definition: vrpn_FunctionGenerator.h:285
vrpn_FUNCTION_ERROR_CB::err
vrpn_FunctionGenerator::FGError err
Definition: vrpn_FunctionGenerator.h:340
vrpn_FunctionGenerator_function_script::script
char * script
Definition: vrpn_FunctionGenerator.h:131
vrpn_FunctionGenerator::channelMessageID
vrpn_int32 channelMessageID
Definition: vrpn_FunctionGenerator.h:187
vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REQUEST
const char * vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REQUEST
Definition: vrpn_FunctionGenerator.C:10
vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL
const char * vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL
Definition: vrpn_FunctionGenerator.C:9
vrpn_FUNCTION_MESSAGE_TYPE_START_REPLY
const char * vrpn_FUNCTION_MESSAGE_TYPE_START_REPLY
Definition: vrpn_FunctionGenerator.C:16
vrpn_BaseClass::register_types
virtual int register_types(void)=0
Register the types of messages this device sends/receives. Return 0 on success, -1 on fail.
vrpn_FUNCTION_CHANNELS_MAX
const vrpn_uint32 vrpn_FUNCTION_CHANNELS_MAX
Definition: vrpn_FunctionGenerator.h:14
vrpn_FunctionGenerator_function::FUNCTION_NULL
@ FUNCTION_NULL
Definition: vrpn_FunctionGenerator.h:70
vrpn_FunctionGenerator::channelReplyMessageID
vrpn_int32 channelReplyMessageID
Definition: vrpn_FunctionGenerator.h:195
vrpn_Analog.h
vrpn_FunctionGenerator_function::decode_from
virtual vrpn_int32 decode_from(const char **buf, vrpn_int32 &len)=0
VRPN_CALLBACK
#define VRPN_CALLBACK
Definition: vrpn_Configure.h:647
vrpn_FunctionGenerator::startFunctionReplyMessageID
vrpn_int32 startFunctionReplyMessageID
Definition: vrpn_FunctionGenerator.h:196
vrpn_FunctionGenerator_function_NULL
Definition: vrpn_FunctionGenerator.h:85
vrpn_FunctionGenerator::getNumChannels
vrpn_uint32 getNumChannels() const
Definition: vrpn_FunctionGenerator.h:168
vrpn_FUNCTION_MESSAGE_TYPE_STOP
const char * vrpn_FUNCTION_MESSAGE_TYPE_STOP
Definition: vrpn_FunctionGenerator.C:14
vrpn_FUNCTION_MESSAGE_TYPE_ALL_CHANNEL_REQUEST
const char * vrpn_FUNCTION_MESSAGE_TYPE_ALL_CHANNEL_REQUEST
Definition: vrpn_FunctionGenerator.C:11
vrpn_FunctionGenerator::stopFunctionMessageID
vrpn_int32 stopFunctionMessageID
Definition: vrpn_FunctionGenerator.h:192
vrpn_FunctionGenerator::sampleRate
vrpn_float32 sampleRate
Definition: vrpn_FunctionGenerator.h:183
vrpn_FunctionGenerator_Server::stop
virtual void stop()=0
vrpn_FUNCTION_START_REPLY_HANDLER
void(VRPN_CALLBACK * vrpn_FUNCTION_START_REPLY_HANDLER)(void *userdata, const vrpn_FUNCTION_START_REPLY_CB info)
Definition: vrpn_FunctionGenerator.h:296
vrpn_Configure.h
vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REPLY
const char * vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REPLY
Definition: vrpn_FunctionGenerator.C:15
vrpn_FunctionGenerator_channel::getFunction
const vrpn_FunctionGenerator_function * getFunction() const
Definition: vrpn_FunctionGenerator.h:145
vrpn_FunctionGenerator_function_script
Definition: vrpn_FunctionGenerator.h:105
vrpn_FunctionGenerator_Server::setChannel
virtual void setChannel(vrpn_uint32 channelNum, vrpn_FunctionGenerator_channel *channel)=0
vrpn_FunctionGenerator_Remote::start_reply_list
vrpn_Callback_List< vrpn_FUNCTION_START_REPLY_CB > start_reply_list
Definition: vrpn_FunctionGenerator.h:407
vrpn_FunctionGenerator_function_NULL::vrpn_FunctionGenerator_function_NULL
vrpn_FunctionGenerator_function_NULL()
Definition: vrpn_FunctionGenerator.h:87
VRPN_API
#define VRPN_API
Definition: vrpn_Configure.h:646
vrpn_BaseClass
Class from which all user-level (and other) classes that communicate with vrpn_Connections should der...
Definition: vrpn_BaseClass.h:313
vrpn_FunctionGenerator_channel
class VRPN_API vrpn_FunctionGenerator_channel
Definition: vrpn_FunctionGenerator.h:30
vrpn_FUNCTION_CHANNEL_REPLY_CB::channelNum
vrpn_uint32 channelNum
Definition: vrpn_FunctionGenerator.h:282