Tesseract 0.28.4
Loading...
Searching...
No Matches
serialization_extensions.h File Reference

Serialization class extension macros and helpers. More...

#include <tesseract/common/macros.h>
#include <boost/mpl/string.hpp>
#include <tesseract/common/sfinae_utils.h>

Classes

struct  tesseract::common::serialization::xml::extension< T >
 
struct  tesseract::common::serialization::xml::extension< T >::traits_class_extension< U >
 
struct  tesseract::common::serialization::json::extension< T >
 
struct  tesseract::common::serialization::json::extension< T >::traits_class_extension< U >
 
struct  tesseract::common::serialization::binary::extension< T >
 
struct  tesseract::common::serialization::binary::extension< T >::traits_class_extension< U >
 

Macros

#define TESSERACT_CLASS_EXTENSION(T, X, J, B)
 A macro for defining serialization extension for classes.
 

Functions

TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP CREATE_MEMBER_CHECK (extension_type)
 

Detailed Description

Serialization class extension macros and helpers.

Author
Levi Armstrong
Date
July 24, 2022
License
Software License Agreement (Apache License)
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.

Macro Definition Documentation

◆ TESSERACT_CLASS_EXTENSION

#define TESSERACT_CLASS_EXTENSION (   T,
  X,
  J,
 
)
Value:
namespace tesseract::common \
{ \
namespace serialization::xml \
{ \
template <> \
struct extension<T> \
{ \
static constexpr const char* value = X; \
static_assert(value[0] == '.', "XML extension value must start with a '.'"); \
}; \
} \
namespace serialization::json \
{ \
template <> \
struct extension<T> \
{ \
static constexpr const char* value = J; \
static_assert(value[0] == '.', "JSON extension value must start with a '.'"); \
}; \
} \
namespace serialization::binary \
{ \
template <> \
struct extension<T> \
{ \
static constexpr const char* value = B; \
static_assert(value[0] == '.', "Binary extension value must start with a '.'"); \
}; \
} \
}
Definition polygon_mesh.h:47

A macro for defining serialization extension for classes.

The extension should include the '.', for example .yaml

Parameters
Tthe class to define extensions for
Xthe xml serialziation extension for the provided class
Jthe json serialziation extension for the provided class
Bthe binary serialzation extension for the provided class