rmw_cyclonedds/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/macros.hpp

37 lines
1.2 KiB
C++
Raw Normal View History

2018-07-09 13:22:25 +02:00
// Copyright 2016 Open Source Robotics Foundation, 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 RMW_CYCLONEDDS_CPP__MACROS_HPP_
#define RMW_CYCLONEDDS_CPP__MACROS_HPP_
#include <limits>
#include <string>
#define SPECIALIZE_GENERIC_C_SEQUENCE(C_NAME, C_TYPE) \
2018-07-09 13:22:25 +02:00
template<> \
struct GenericCSequence<C_TYPE> \
2018-07-09 13:22:25 +02:00
{ \
using type = rosidl_generator_c__ ## C_NAME ## __Sequence; \
2018-07-09 13:22:25 +02:00
\
static void fini(type * array) { \
rosidl_generator_c__ ## C_NAME ## __Sequence__fini(array); \
2018-07-09 13:22:25 +02:00
} \
\
static bool init(type * array, size_t size) { \
return rosidl_generator_c__ ## C_NAME ## __Sequence__init(array, size); \
2018-07-09 13:22:25 +02:00
} \
};
#endif // RMW_CYCLONEDDS_CPP__MACROS_HPP_