#include <eventParameter.h>
Public Member Functions | |
EventParameter () | |
Defines an EventParameter that stores nothing: the "empty" parameter. | |
EventParameter (const TypedReferenceCount *ptr) | |
Defines an EventParameter that stores a pointer to any kind of TypedReferenceCount object. | |
EventParameter (int value) | |
Defines an EventParameter that stores an integer value. | |
EventParameter (double value) | |
Defines an EventParameter that stores a floating-point value. | |
EventParameter (const string &value) | |
Defines an EventParameter that stores a string value. | |
EventParameter (const EventParameter ©) | |
EventParameter & | operator= (const EventParameter ©) |
bool | is_empty () const |
Returns true if the EventParameter is the empty parameter, storing nothing, or false otherwise. | |
bool | is_int () const |
Returns true if the EventParameter stores an integer value, false otherwise. | |
int | get_int_value () const |
Retrieves the value stored in the EventParameter. | |
bool | is_double () const |
Returns true if the EventParameter stores a double floating-point value, false otherwise. | |
double | get_double_value () const |
Retrieves the value stored in the EventParameter. | |
bool | is_string () const |
Returns true if the EventParameter stores a string value, false otherwise. | |
string | get_string_value () const |
Retrieves the value stored in the EventParameter. | |
TypedReferenceCount * | get_ptr () const |
Retrieves a pointer to the actual value stored in the parameter. | |
void | output (ostream &out) const |
Private Attributes | |
PointerTo< TypedReferenceCount > | _ptr |
Each event may have zero or more of these. Each parameter stores a pointer to a TypedReferenceCount object, which of course could be pretty much anything. To store a simple value like a double or a string, the EventParameter constructors transparently use the EventStoreValue template class, defined below.
Definition at line 51 of file eventParameter.h.
|
Defines an EventParameter that stores nothing: the "empty" parameter.
Definition at line 38 of file eventParameter.I. References INLINE. |
|
Defines an EventParameter that stores a pointer to any kind of TypedReferenceCount object. This is the most general constructor. This accepts a const pointer, even though it stores (and eventually returns) a non-const pointer. This is just the simplest way to allow both const and non-const pointers to be stored, but it does lose the constness. Be careful. Definition at line 66 of file eventParameter.I. References INLINE. |
|
Defines an EventParameter that stores an integer value.
Definition at line 80 of file eventParameter.I. References INLINE. |
|
Defines an EventParameter that stores a floating-point value.
Definition at line 94 of file eventParameter.I. |
|
Defines an EventParameter that stores a string value.
Definition at line 106 of file eventParameter.I. |
|
Definition at line 117 of file eventParameter.I. References _ptr, INLINE, and is_empty(). |
|
Retrieves the value stored in the EventParameter. It is only valid to call this if is_double() has already returned true. Definition at line 218 of file eventParameter.I. References INLINE. |
|
Retrieves the value stored in the EventParameter. It is only valid to call this if is_int() has already returned true. Definition at line 179 of file eventParameter.I. References _ptr. |
|
Retrieves a pointer to the actual value stored in the parameter. The TypeHandle of this pointer may be examined to determine the actual type of parameter it contains. This is the only way to retrieve the value when it is not one of the above predefined types. Definition at line 276 of file eventParameter.I. Referenced by Trackball::apply(), PandaFramework::clear_highlight(), PandaFramework::do_enable_default_keys(), MouseWatcher::global_keyboard_press(), ButtonThrower::has_throw_button(), PandaFramework::main_loop(), PandaFramework::make_default_pipe(), PandaFramework::make_window_framework(), and Transform2SG::set_velocity_node(). |
|
Retrieves the value stored in the EventParameter. It is only valid to call this if is_string() has already returned true. Definition at line 254 of file eventParameter.I. |
|
Returns true if the EventParameter stores a double floating-point value, false otherwise.
Definition at line 198 of file eventParameter.I. Referenced by is_int(). |
|
Returns true if the EventParameter is the empty parameter, storing nothing, or false otherwise.
Definition at line 144 of file eventParameter.I. Referenced by EventParameter(). |
|
Returns true if the EventParameter stores an integer value, false otherwise.
Definition at line 159 of file eventParameter.I. References _ptr, INLINE, is_double(), nassertr, and PointerTo< TypedReferenceCount >::p(). Referenced by operator=(). |
|
Returns true if the EventParameter stores a string value, false otherwise.
Definition at line 234 of file eventParameter.I. References INLINE. |
|
Definition at line 128 of file eventParameter.I. References _ptr, INLINE, is_int(), nassertr, and PointerTo< TypedReferenceCount >::p(). |
|
Definition at line 41 of file eventParameter.cxx. |
|
Definition at line 80 of file eventParameter.h. Referenced by EventParameter(), get_int_value(), is_double(), is_empty(), is_int(), and operator=(). |