Program Listing for File types.h

Return to documentation for file (include/rcl_yaml_param_parser/types.h)

// Copyright 2018 Apex.AI, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef RCL_YAML_PARAM_PARSER__TYPES_H_
#define RCL_YAML_PARAM_PARSER__TYPES_H_

#include "rcutils/allocator.h"
#include "rcutils/types/string_array.h"

/*
 * \typedef rcl_bool_array_t
 */
typedef struct rcl_bool_array_s
{
  bool * values;
  size_t size;
} rcl_bool_array_t;

/*
 * \typedef rcl_int64_array_t
 */
typedef struct rcl_int64_array_s
{
  int64_t * values;
  size_t size;
} rcl_int64_array_t;

/*
 * \typedef rcl_double_array_t
 */
typedef struct rcl_double_array_s
{
  double * values;
  size_t size;
} rcl_double_array_t;

/*
 * \typedef rcl_byte_array_t
 */
typedef struct rcl_byte_array_s
{
  uint8_t * values;
  size_t size;
} rcl_byte_array_t;

/*
 * Only one pointer in this struct will store the value
 * \typedef rcl_variant_t
 */
typedef struct rcl_variant_s
{
  bool * bool_value;
  int64_t * integer_value;
  double * double_value;
  char * string_value;
  rcl_byte_array_t * byte_array_value;
  rcl_bool_array_t * bool_array_value;
  rcl_int64_array_t * integer_array_value;
  rcl_double_array_t * double_array_value;
  rcutils_string_array_t * string_array_value;
} rcl_variant_t;

/*
* \typedef rcl_node_params_t
*/
typedef struct rcl_node_params_s
{
  char ** parameter_names;
  rcl_variant_t * parameter_values;
  size_t num_params;
  size_t capacity_params;
} rcl_node_params_t;

/*
* \typedef rcl_params_t
*/
typedef struct rcl_params_s
{
  char ** node_names;
  rcl_node_params_t * params;
  size_t num_nodes;
  size_t capacity_nodes;
  rcutils_allocator_t allocator;
} rcl_params_t;

#endif  // RCL_YAML_PARAM_PARSER__TYPES_H_