Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# EventParameter Class Reference

An optional parameter associated with an event. More...

List of all members.

## Public Member Functions
| EventParameter ()
| Defines an EventParameter that stores nothing: the "empty" parameter.
| EventParameter (EventParameter const copy)
| EventParameter (TypedWritableReferenceCount const ptr)
| Defines an EventParameter that stores a pointer to any kind of TypedWritableReferenceCount object.
| EventParameter (int value)
| Defines an EventParameter that stores an integer value.
| EventParameter (string value)
| Defines an EventParameter that stores a string value.
| EventParameter (TypedReferenceCount const ptr)
| Defines an EventParameter that stores a pointer to a TypedReferenceCount object.
| EventParameter (string value)
| Defines an EventParameter that stores a wstring value.
| EventParameter (double value)
| Defines an EventParameter that stores a floating-point value.
double | getDoubleValue ()
| Retrieves the value stored in the EventParameter.
int | getIntValue ()
| Retrieves the value stored in the EventParameter.
TypedWritableReferenceCount | getPtr ()
| Retrieves a pointer to the actual value stored in the parameter.
string | getStringValue ()
| Retrieves the value stored in the EventParameter.
TypedReferenceCount | getTypedRefCountValue ()
| Retrieves the value stored in the EventParameter.
string | getWstringValue ()
| Retrieves the value stored in the EventParameter.
bool | isDouble ()
| Returns true if the EventParameter stores a double floating-point value, false otherwise.
bool | isEmpty ()
| Returns true if the EventParameter is the empty parameter, storing nothing, or false otherwise.
bool | isInt ()
| Returns true if the EventParameter stores an integer value, false otherwise.
bool | isString ()
| Returns true if the EventParameter stores a string value, false otherwise.
bool | isTypedRefCount ()
| Returns true if the EventParameter stores a TypedReferenceCount pointer, false otherwise.
bool | isWstring ()
| Returns true if the EventParameter stores a wstring value, false otherwise.
EventParameter | operator= (EventParameter const copy)
| output (ostream out)

## Detailed Description

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 EventStoreValue template class, defined below.

## Constructor & Destructor Documentation

EventParameter | ( |  | ) |

Defines an EventParameter that stores nothing: the "empty" parameter.

EventParameter | ( | EventParameter const | copy | ) |

EventParameter | ( | TypedReferenceCount const | ptr | ) |

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.

EventParameter | ( | TypedWritableReferenceCount const | ptr | ) |

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.

EventParameter | ( | string | value | ) |

Defines an EventParameter that stores a string value.

EventParameter | ( | string | value | ) |

Defines an EventParameter that stores a wstring value.

EventParameter | ( | double | value | ) |

Defines an EventParameter that stores a floating-point value.

EventParameter | ( | int | value | ) |

Defines an EventParameter that stores an integer value.

## Member Function Documentation

double getDoubleValue | ( |  | ) |

Retrieves the value stored in the EventParameter.

It is only valid to call this if is_double() has already returned true.

int getIntValue | ( |  | ) |

Retrieves the value stored in the EventParameter.

It is only valid to call this if is_int() has already returned true.

TypedWritableReferenceCount getPtr | ( |  | ) |

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.

string getStringValue | ( |  | ) |

Retrieves the value stored in the EventParameter.

It is only valid to call this if is_string() has already returned true.

TypedReferenceCount getTypedRefCountValue | ( |  | ) |

Retrieves the value stored in the EventParameter.

It is only valid to call this if is_typed_ref_count() has already returned true.

string getWstringValue | ( |  | ) |

Retrieves the value stored in the EventParameter.

It is only valid to call this if is_wstring() has already returned true.

bool isDouble | ( |  | ) |

Returns true if the EventParameter stores a double floating-point value, false otherwise.

bool isEmpty | ( |  | ) |

Returns true if the EventParameter is the empty parameter, storing nothing, or false otherwise.

bool isInt | ( |  | ) |

Returns true if the EventParameter stores an integer value, false otherwise.

bool isString | ( |  | ) |

Returns true if the EventParameter stores a string value, false otherwise.

bool isTypedRefCount | ( |  | ) |

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.

bool isWstring | ( |  | ) |

Returns true if the EventParameter stores a wstring value, false otherwise.

EventParameter operator= | ( | EventParameter const | copy | ) |

output | ( | ostream | out | ) |

All Classes Namespaces Functions Variables Enumerations Enumerator Properties