Class State

Class Documentation

class State

Abstract class for the Lifecycle’s states.

There are 4 primary states: Unconfigured, Inactive, Active and Finalized.

Public Functions

explicit State(rcutils_allocator_t allocator = rcutils_get_default_allocator())
State(uint8_t id, const std::string &label, rcutils_allocator_t allocator = rcutils_get_default_allocator())

State constructor.

Parameters:
  • id[in] of the state

  • label[in] of the state

  • allocator[in] a valid allocator used to initialized the state.

explicit State(const rcl_lifecycle_state_t *rcl_lifecycle_state_handle, rcutils_allocator_t allocator = rcutils_get_default_allocator())

State constructor.

Parameters:
  • rcl_lifecycle_state_handle[in] structure with the state details

  • allocator[in] a valid allocator used to initialized the state.

State(const State &rhs)
virtual ~State()
State &operator=(const State &rhs)
uint8_t id() const

Return the id.

Returns:

id of the state

std::string label() const

Return the label.

Returns:

label of state

Protected Functions

void reset() noexcept

Protected Attributes

rcutils_allocator_t allocator_
bool owns_rcl_state_handle_
mutable std::recursive_mutex state_handle_mutex_
rcl_lifecycle_state_t *state_handle_