rosidl_runtime_c  master
Generate the rosidl interfaces in C.
primitives_sequence.h
Go to the documentation of this file.
1 // Copyright 2015 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef ROSIDL_RUNTIME_C__PRIMITIVES_SEQUENCE_H_
16 #define ROSIDL_RUNTIME_C__PRIMITIVES_SEQUENCE_H_
17 
18 #include <stdbool.h>
19 #include <stddef.h>
20 #include <stdint.h>
21 
22 #define ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(STRUCT_NAME, TYPE_NAME) \
23  typedef struct rosidl_runtime_c__ ## STRUCT_NAME ## __Sequence \
24  { \
25  TYPE_NAME * data; \
26  size_t size; \
27  size_t capacity; \
28  } rosidl_runtime_c__ ## STRUCT_NAME ## __Sequence;
29 
30 // sequence types for all basic types
33 ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(long_double, long double)
34 ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(char, signed char)
46 
47 // emulate legacy API
48 typedef rosidl_runtime_c__boolean__Sequence
50 typedef rosidl_runtime_c__octet__Sequence
52 typedef rosidl_runtime_c__float__Sequence
54 typedef rosidl_runtime_c__double__Sequence
56 
57 #endif // ROSIDL_RUNTIME_C__PRIMITIVES_SEQUENCE_H_
rosidl_runtime_c__byte__Sequence
rosidl_runtime_c__octet__Sequence rosidl_runtime_c__byte__Sequence
Definition: primitives_sequence.h:51
rosidl_runtime_c__float64__Sequence
rosidl_runtime_c__double__Sequence rosidl_runtime_c__float64__Sequence
Definition: primitives_sequence.h:55
rosidl_runtime_c__float32__Sequence
rosidl_runtime_c__float__Sequence rosidl_runtime_c__float32__Sequence
Definition: primitives_sequence.h:53
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE
#define ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(STRUCT_NAME, TYPE_NAME)
Definition: primitives_sequence.h:22
rosidl_runtime_c__bool__Sequence
rosidl_runtime_c__boolean__Sequence rosidl_runtime_c__bool__Sequence
Definition: primitives_sequence.h:49