Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 3.69 KB

ControllerElementHandle.md

File metadata and controls

29 lines (23 loc) · 3.69 KB

class ControllerElementHandle

Member values

Member name Data type Description
controller_handle ControllerHandle Controller handle
button oneof:identifier uint32 Button identifier (only set if 'button' controller event, otherwise zero)
axis oneof:identifier uint32 Axis identifier (only set if 'axis' controller event, otherwise zero)

Member functions

Function name Return type Input type Description
has_controller_handle() const bool void Returns true if controller_handle is set.
controller_handle() const ControllerHandle& void Returns the current value of controller_handle. If controller_handle is not set, returns a ControllerHandle with none of its fields set (possibly controller_handle::default_instance()).
mutable_controller_handle() ControllerHandle * void Returns a pointer to the mutable ControllerHandle object that stores the field's value. If the field was not set prior to the call, then the returned ControllerHandle will have none of its fields set (i.e. it will be identical to a newly-allocated ControllerHandle). After calling this, has_controller_handle() will return true and controller_handle() will return a reference to the same instance of ControllerHandle.
clear_controller_handle() void void Clears the value of the field. After calling this, has_controller_handle() will return false and controller_handle() will return the default value.
set_allocated_controller_handle() void ControllerHandle * Sets the ControllerHandle object to the field and frees the previous field value if it exists. If the ControllerHandle pointer is not NULL, the message takes ownership of the allocated ControllerHandle object and has_ ControllerHandle() will return true. Otherwise, if the controller_handle is NULL, the behavior is the same as calling clear_controller_handle().
release_controller_handle() ControllerHandle * void Releases the ownership of the field and returns the pointer of the ControllerHandle object. After calling this, caller takes the ownership of the allocated ControllerHandle object, has_controller_handle() will return false, and controller_handle() will return the default value.
set_button() void oneof:identifier uint32 If any other oneof field in the same oneof is set, calls clear_identifier(). Sets the value of this field and sets the oneof case to kButton.
button() const oneof:identifier uint32 void Returns the current value of the field if oneof case is kButton. Otherwise, returns the default value.
clear_button() void void Nothing will be changed if the oneof case is not kButton. If the oneof case is kButton, clears the value of the field and the oneof case
set_axis() void oneof:identifier uint32 If any other oneof field in the same oneof is set, calls clear_identifier(). Sets the value of this field and sets the oneof case to kAxis.
axis() const oneof:identifier uint32 void Returns the current value of the field if oneof case is kAxis. Otherwise, returns the default value.
clear_axis() void void Nothing will be changed if the oneof case is not kAxis. If the oneof case is kAxis, clears the value of the field and the oneof case

Parent topic: Base (C++)