Class Transition

Class Documentation

class Transition

The Transition class abstract the Lifecycle’s states.

There are 7 transitions exposed to a supervisory process, they are: create, configure, cleanup, activate, deactivate, shutdown and destroy.

Public Functions

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

Transition constructor.

Parameters:
  • id[in] of the transition

  • label[in] of the transition

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

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

Transition constructor.

Parameters:
  • id[in] of the transition

  • label[in] of the transition

  • start[in] state of the transition

  • goal[in] state of the transition

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

explicit Transition(const rcl_lifecycle_transition_t *rcl_lifecycle_transition_handle, rcutils_allocator_t allocator = rcutils_get_default_allocator())

Transition constructor.

Parameters:
  • rcl_lifecycle_transition_handle[in] structure with the transition details

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

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

Return the id.

Returns:

id of the state

std::string label() const

Return the label.

Returns:

label of the transition

State start_state() const

Return the start state of the transition.

Returns:

start state of the transition.

State goal_state() const

Return the goal state of the transition.

Returns:

goal state of the transition.

Protected Functions

void reset() noexcept

Protected Attributes

rcutils_allocator_t allocator_
bool owns_rcl_transition_handle_
rcl_lifecycle_transition_t *transition_handle_