EventParameter¶
-
class EventParameter¶
An optional parameter associated with an event. Each event may have zero or more of these. Each parameter stores a pointer to a
TypedWritableReferenceCountobject, 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.Inheritance diagram
digraph inheritancee597f21f29 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "EventParameter" [URL="acron.core.EventParameter.html#acron.core.EventParameter",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "EventParameter" [arrowsize=0.75,style=""]; }- EventParameter.__init__()¶
Defines an
EventParameterthat stores a pointer to any kind ofTypedWritableReferenceCountobject. 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.
Defines an
EventParameterthat stores a pointer to aTypedReferenceCountobject. Note that aTypedReferenceCountis not the same kind of pointer as aTypedWritableReferenceCount, 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.
Defines an
EventParameterthat stores an integer value.Defines an
EventParameterthat stores a floating-point value.Defines an
EventParameterthat stores a string value.Defines an
EventParameterthat stores a wstring value.Defines an
EventParameterthat stores a bytes value.
- EventParameter.assign()¶
- EventParameter.get_bytes_value()¶
Retrieves the value stored in the
EventParameter. It is only valid to call this ifis_bytes()has already returned true.
- EventParameter.get_double_value()¶
Retrieves the value stored in the
EventParameter. It is only valid to call this ifis_double()has already returned true.
- EventParameter.get_int_value()¶
Retrieves the value stored in the
EventParameter. It is only valid to call this ifis_int()has already returned true.
- EventParameter.get_ptr()¶
Retrieves a pointer to the actual value stored in the parameter. The
TypeHandleof 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.
- EventParameter.get_string_value()¶
Retrieves the value stored in the
EventParameter. It is only valid to call this ifis_string()has already returned true.
- EventParameter.get_typed_ref_count_value()¶
Retrieves the value stored in the
EventParameter. It is only valid to call this ifis_typed_ref_count()has already returned true.
- EventParameter.get_wstring_value()¶
Retrieves the value stored in the
EventParameter. It is only valid to call this ifis_wstring()has already returned true.
- EventParameter.is_bytes()¶
Returns true if the
EventParameterstores a binary bytes value, false otherwise.
- EventParameter.is_double()¶
Returns true if the
EventParameterstores a double floating-point value, false otherwise.
- EventParameter.is_empty()¶
These functions are conveniences to easily determine if the
EventParameteris one of the predefined parameter types, and retrieve the corresponding value. Of course, it is possible that theEventParameteris some user-defined type, and is none of these.Returns true if the
EventParameteris the empty parameter, storing nothing, or false otherwise.
- EventParameter.is_int()¶
Returns true if the
EventParameterstores an integer value, false otherwise.
- EventParameter.is_string()¶
Returns true if the
EventParameterstores a string value, false otherwise.
- EventParameter.is_typed_ref_count()¶
Returns true if the
EventParameterstores aTypedReferenceCountpointer, false otherwise. Note that aTypedReferenceCountis not exactly the same kind of pointer as aTypedWritableReferenceCount, hence the need for this separate call.
- EventParameter.is_wstring()¶
Returns true if the
EventParameterstores a wstring value, false otherwise.
- EventParameter.output()¶