forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclientDevice.I
More file actions
94 lines (87 loc) · 3.45 KB
/
clientDevice.I
File metadata and controls
94 lines (87 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Filename: clientDevice.I
// Created by: drose (25Jan01)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: ClientDevice::get_client
// Access: Public
// Description: Returns the ClientBase this device is associated
// with.
////////////////////////////////////////////////////////////////////
INLINE ClientBase *ClientDevice::
get_client() const {
return _client;
}
////////////////////////////////////////////////////////////////////
// Function: ClientDevice::is_connected
// Access: Public
// Description: Returns true if the device is still connected to its
// ClientBase, false otherwise.
////////////////////////////////////////////////////////////////////
INLINE bool ClientDevice::
is_connected() const {
return _is_connected;
}
////////////////////////////////////////////////////////////////////
// Function: ClientDevice::get_device_type
// Access: Public
// Description: Returns the type of device this is considered to be
// to the ClientBase: a ClientTrackerDevice,
// ClientAnalogDevice, or what have you. This is not
// exactly the same thing as get_type(), because it does
// not return the exact type of the ClientDevice
// (e.g. it reports ClientTrackerDevice, not
// VrpnTrackerDevice).
////////////////////////////////////////////////////////////////////
INLINE TypeHandle ClientDevice::
get_device_type() const {
return _device_type;
}
////////////////////////////////////////////////////////////////////
// Function: ClientDevice::get_device_name
// Access: Public
// Description: Returns the device name reported to the ClientBase.
// This has some implementation-defined meaning to
// identify particular devices.
////////////////////////////////////////////////////////////////////
INLINE const string &ClientDevice::
get_device_name() const {
return _device_name;
}
////////////////////////////////////////////////////////////////////
// Function: ClientDevice::acquire
// Access: Public
// Description: Grabs the mutex associated with this particular
// device. The device will not update asynchronously
// while the mutex is held, allowing the user to copy
// the data out without fear of getting a partial update
// during the copy.
////////////////////////////////////////////////////////////////////
INLINE void ClientDevice::
acquire() {
#ifdef OLD_HAVE_IPC
_lock.acquire();
#endif
}
////////////////////////////////////////////////////////////////////
// Function: ClientDevice::unlock
// Access: Public
// Description: Releases the mutex associated with this particular
// device. This should be called after all the data has
// been successfully copied out. See acquire().
////////////////////////////////////////////////////////////////////
INLINE void ClientDevice::
unlock() {
#ifdef OLD_HAVE_IPC
_lock.unlock();
#endif
}