Panda3D
clientButtonDevice.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file clientButtonDevice.h
10  * @author drose
11  * @date 2001-01-26
12  */
13 
14 #ifndef CLIENTBUTTONDEVICE_H
15 #define CLIENTBUTTONDEVICE_H
16 
17 #include "pandabase.h"
18 
19 #include "clientDevice.h"
20 
21 #include "buttonHandle.h"
22 #include "buttonEvent.h"
23 #include "buttonEventList.h"
24 #include "pointerTo.h"
25 
26 /**
27  * A device, attached to the ClientBase by a ButtonNode, that records the data
28  * from a single named button device. The named device can contain any number
29  * of up/down style buttons, numbered in sequence beginning at zero; these are
30  * mapped by this class to a sequence of ButtonHandles specified by the user.
31  */
32 class EXPCL_PANDA_DEVICE ClientButtonDevice : public ClientDevice {
33 protected:
34  ClientButtonDevice(ClientBase *client, const std::string &device_name);
35 
36 public:
37  virtual void output(std::ostream &out) const;
38  virtual void write(std::ostream &out, int indent_level = 0) const;
39 
40 public:
41  static TypeHandle get_class_type() {
42  return _type_handle;
43  }
44  static void init_type() {
45  ClientDevice::init_type();
46  register_type(_type_handle, "ClientButtonDevice",
47  ClientDevice::get_class_type());
48  }
49  virtual TypeHandle get_type() const {
50  return get_class_type();
51  }
52  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
53 
54 private:
55  static TypeHandle _type_handle;
56 };
57 
58 #include "clientButtonDevice.I"
59 
60 #endif
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A device, attached to the ClientBase by a ButtonNode, that records the data from a single named butto...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void output(std::ostream &out) const
Writes a one-line string describing the device.
An abstract base class for a family of client device interfaces–including trackers,...
Definition: clientBase.h:43
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Any of a number of different devices that might be attached to a ClientBase, including trackers,...
Definition: clientDevice.h:27