~hitmuri/vjpirate/trunk

« back to all changes in this revision

Viewing changes to os/mac/include/vrpn/vrpn_Event_Analog.h

  • Committer: Florent Berthaut
  • Date: 2014-07-26 18:53:16 UTC
  • mfrom: (5.1.12 mac)
  • Revision ID: flo@localhost.localdomain-20140726185316-c2ucnwmgm5kij4e2
Merged mac branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************************************/
 
2
/*                                                                                                */
 
3
/* Copyright (C) 2004 Bauhaus University Weimar                                                   */
 
4
/* Released into the public domain on 6/23/2007 as part of the VRPN project                        */
 
5
/* by Jan P. Springer.                                                                             */
 
6
/*                                                                                                */
 
7
/**************************************************************************************************/
 
8
/*                                                                                                */
 
9
/* module     :  vrpn_Event_Analog.h                                                              */
 
10
/* project    :                                                                                   */
 
11
/* description:  base class for devices using event interface                                     */
 
12
/*                                                                                                */
 
13
/**************************************************************************************************/
 
14
 
 
15
#ifndef _VRPN_EVENT_ANALOG_H_
 
16
#define _VRPN_EVENT_ANALOG_H_
 
17
 
 
18
// includes, system
 
19
#include <vector>
 
20
 
 
21
// includes, project
 
22
#include "vrpn_Analog.h"
 
23
#include "vrpn_Event.h"
 
24
 
 
25
class VRPN_API vrpn_Event_Analog: public vrpn_Analog {
 
26
 
 
27
public:
 
28
 
 
29
  // constructor
 
30
  // evdev is the event file name
 
31
  vrpn_Event_Analog( const char * name,
 
32
                     vrpn_Connection * connection,
 
33
                     const char * evdev_name);
 
34
 
 
35
  ~vrpn_Event_Analog();
 
36
 
 
37
protected:
 
38
 
 
39
  // read available events
 
40
  // returns number of structs read succesfully
 
41
  int read_available_data();
 
42
 
 
43
protected:
 
44
 
 
45
  // typedefs for convenience
 
46
  typedef std::vector<struct vrpn_Event::input_event> event_vector_t;
 
47
  typedef event_vector_t::iterator event_iter_t;
 
48
 
 
49
  // handle to the event interface
 
50
  int fd;
 
51
 
 
52
  // maximal number of event structs read at once
 
53
  int max_num_events;
 
54
 
 
55
  // container for the event structs read
 
56
  event_vector_t  event_data;
 
57
 
 
58
};
 
59
 
 
60
#endif // _VRPN_EVENT_ANALOG_H_