Function rcl_lifecycle_transition_init
Defined in File rcl_lifecycle.h
Function Documentation
-
rcl_ret_t rcl_lifecycle_transition_init(rcl_lifecycle_transition_t *transition, unsigned int id, const char *label, rcl_lifecycle_state_t *start, rcl_lifecycle_state_t *goal, const rcl_allocator_t *allocator)
Initialize a transition from a start state to the goal state.
The given
rcl_lifecycle_transition_t
must be zero initialized with the functionrcl_lifecycle_get_zero_initialized_transition()
and must not be already initialized by this function. The allocator will be used to allocate the label string and the rcl_lifecycle_state_t structs.Note: the transition pointer will take ownership of the start and goal state. When calling rcl_lifecycle_transition_fini(), the two states will be freed.
Attribute
Adherence
Allocates Memory
Yes
Thread-Safe
No
Uses Atomics
No
Lock-Free
Yes
- Parameters:
transition – [in] to a preallocated, zero-initialized transition structure to be initialized.
id – [in] identifier of the transition
label – [in] label of the transition
start – [in] the value where the transition is initialized
goal – [in] the objetive of the transition
allocator – [in] a valid allocator used to finalize the lifecycle state
- Returns:
RCL_RET_OK
if the transition is initialized successfully, or- Returns:
RCL_RET_INVALID_ARGUMENT
if any arguments are invalid, or- Returns:
RCL_RET_ERROR
if an unspecified error occurs.