Panda3D
|
An optional parameter associated with an event. More...
#include "eventParameter.h"
Public Member Functions | |
EventParameter (const EventParameter ©) | |
EventParameter (const std::string &value) | |
Defines an EventParameter that stores a string value. More... | |
EventParameter (const std::wstring &value) | |
Defines an EventParameter that stores a wstring value. More... | |
EventParameter (const TypedReferenceCount *ptr) | |
Defines an EventParameter that stores a pointer to a TypedReferenceCount object. More... | |
EventParameter (const TypedWritableReferenceCount *ptr) | |
Defines an EventParameter that stores a pointer to any kind of TypedWritableReferenceCount object. More... | |
EventParameter (double value) | |
Defines an EventParameter that stores a floating-point value. More... | |
EventParameter (int value) | |
Defines an EventParameter that stores an integer value. More... | |
EventParameter (std::nullptr_t) | |
double | get_double_value () const |
Retrieves the value stored in the EventParameter. More... | |
int | get_int_value () const |
Retrieves the value stored in the EventParameter. More... | |
TypedWritableReferenceCount * | get_ptr () const |
Retrieves a pointer to the actual value stored in the parameter. More... | |
std::string | get_string_value () const |
Retrieves the value stored in the EventParameter. More... | |
TypedReferenceCount * | get_typed_ref_count_value () const |
Retrieves the value stored in the EventParameter. More... | |
std::wstring | get_wstring_value () const |
Retrieves the value stored in the EventParameter. More... | |
bool | is_double () const |
Returns true if the EventParameter stores a double floating-point value, false otherwise. More... | |
bool | is_empty () const |
Returns true if the EventParameter is the empty parameter, storing nothing, or false otherwise. More... | |
bool | is_int () const |
Returns true if the EventParameter stores an integer value, false otherwise. More... | |
bool | is_string () const |
Returns true if the EventParameter stores a string value, false otherwise. More... | |
bool | is_typed_ref_count () const |
Returns true if the EventParameter stores a TypedReferenceCount pointer, false otherwise. More... | |
bool | is_wstring () const |
Returns true if the EventParameter stores a wstring value, false otherwise. More... | |
EventParameter & | operator= (const EventParameter ©) |
void | output (std::ostream &out) const |
An optional parameter associated with an event.
Each event may have zero or more of these. Each parameter stores a pointer to a TypedWritableReferenceCount 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 ParamValue template class from paramValue.h.
Definition at line 35 of file eventParameter.h.
|
inline |
Defines an EventParameter that stores a pointer to any kind of TypedWritableReferenceCount 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 23 of file eventParameter.I.
|
inline |
Defines an EventParameter that stores a pointer to a TypedReferenceCount object.
Note that a TypedReferenceCount is not the same kind of pointer as a TypedWritableReferenceCount, hence we require both constructors.
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 36 of file eventParameter.I.
|
inline |
Defines an EventParameter that stores an integer value.
Definition at line 43 of file eventParameter.I.
|
inline |
Defines an EventParameter that stores a floating-point value.
Definition at line 50 of file eventParameter.I.
|
inline |
Defines an EventParameter that stores a string value.
Definition at line 57 of file eventParameter.I.
|
inline |
Defines an EventParameter that stores a wstring value.
Definition at line 63 of file eventParameter.I.
|
inline |
Retrieves the value stored in the EventParameter.
It is only valid to call this if is_double() has already returned true.
Definition at line 140 of file eventParameter.I.
|
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 115 of file eventParameter.I.
|
inline |
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 218 of file eventParameter.I.
Referenced by DataNodeTransmit::write_datagram().
|
inline |
Retrieves the value stored in the EventParameter.
It is only valid to call this if is_string() has already returned true.
Definition at line 161 of file eventParameter.I.
|
inline |
Retrieves the value stored in the EventParameter.
It is only valid to call this if is_typed_ref_count() has already returned true.
Definition at line 206 of file eventParameter.I.
|
inline |
Retrieves the value stored in the EventParameter.
It is only valid to call this if is_wstring() has already returned true.
Definition at line 182 of file eventParameter.I.
|
inline |
Returns true if the EventParameter stores a double floating-point value, false otherwise.
Definition at line 128 of file eventParameter.I.
|
inline |
Returns true if the EventParameter is the empty parameter, storing nothing, or false otherwise.
Definition at line 94 of file eventParameter.I.
|
inline |
Returns true if the EventParameter stores an integer value, false otherwise.
Definition at line 103 of file eventParameter.I.
|
inline |
Returns true if the EventParameter stores a string value, false otherwise.
Definition at line 149 of file eventParameter.I.
|
inline |
Returns true if the EventParameter stores a TypedReferenceCount pointer, false otherwise.
Note that a TypedReferenceCount is not exactly the same kind of pointer as a TypedWritableReferenceCount, hence the need for this separate call.
Definition at line 194 of file eventParameter.I.
|
inline |
Returns true if the EventParameter stores a wstring value, false otherwise.
Definition at line 170 of file eventParameter.I.