remove const qualifier for transition states (#197)
* remove const qualifier for transition states * remove unnecessary const_casts * init and fini function for state and transition
This commit is contained in:
parent
77e6979d9f
commit
c25d227ce9
6 changed files with 216 additions and 27 deletions
|
@ -51,8 +51,8 @@ typedef struct rcl_lifecycle_transition_t
|
|||
{
|
||||
const char * label;
|
||||
unsigned int id;
|
||||
const rcl_lifecycle_state_t * start;
|
||||
const rcl_lifecycle_state_t * goal;
|
||||
rcl_lifecycle_state_t * start;
|
||||
rcl_lifecycle_state_t * goal;
|
||||
} rcl_lifecycle_transition_t;
|
||||
|
||||
typedef struct rcl_lifecycle_transition_map_t
|
||||
|
|
|
@ -25,6 +25,55 @@ extern "C"
|
|||
#include "rcl_lifecycle/data_types.h"
|
||||
#include "rcl_lifecycle/visibility_control.h"
|
||||
|
||||
RCL_LIFECYCLE_PUBLIC
|
||||
rcl_lifecycle_state_t
|
||||
rcl_lifecycle_get_zero_initialized_state();
|
||||
|
||||
RCL_LIFECYCLE_PUBLIC
|
||||
RCL_WARN_UNUSED
|
||||
rcl_ret_t
|
||||
rcl_lifecycle_state_init(
|
||||
rcl_lifecycle_state_t * state,
|
||||
unsigned int id,
|
||||
const char * label,
|
||||
const rcl_allocator_t * allocator);
|
||||
|
||||
RCL_LIFECYCLE_PUBLIC
|
||||
RCL_WARN_UNUSED
|
||||
rcl_ret_t
|
||||
rcl_lifecycle_state_fini(
|
||||
rcl_lifecycle_state_t * state,
|
||||
const rcl_allocator_t * allocator);
|
||||
|
||||
RCL_LIFECYCLE_PUBLIC
|
||||
rcl_lifecycle_transition_t
|
||||
rcl_lifecycle_get_zero_initialized_transition();
|
||||
|
||||
/// Initialize transition with existing states
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
RCL_LIFECYCLE_PUBLIC
|
||||
RCL_WARN_UNUSED
|
||||
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);
|
||||
|
||||
RCL_LIFECYCLE_PUBLIC
|
||||
RCL_WARN_UNUSED
|
||||
rcl_ret_t
|
||||
rcl_lifecycle_transition_fini(
|
||||
rcl_lifecycle_transition_t * transition,
|
||||
const rcl_allocator_t * allocator);
|
||||
|
||||
RCL_LIFECYCLE_PUBLIC
|
||||
rcl_lifecycle_state_machine_t
|
||||
rcl_lifecycle_get_zero_initialized_state_machine();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue