Classes | Namespaces | Macros | Functions
json_export.h File Reference
#include "behaviortree_cpp/basic_types.h"
#include "behaviortree_cpp/utils/safe_any.hpp"
#include "behaviortree_cpp/contrib/json.hpp"
Include dependency graph for json_export.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  BT::JsonExporter
 

Namespaces

 BT
 

Macros

#define BT_JSON_CONVERTER(Type, value)
 

Functions

template<typename T >
void BT::RegisterJsonDefinition ()
 

Macro Definition Documentation

◆ BT_JSON_CONVERTER

#define BT_JSON_CONVERTER (   Type,
  value 
)
Value:
template <class AddField> \
void _JsonTypeDefinition(Type&, AddField&); \
\
inline void to_json(nlohmann::json& js, const Type& p) \
{ \
auto op = [&js](const char* name, auto* val) { js[name] = *val; }; \
_JsonTypeDefinition(const_cast<Type&>(p), op); \
js["__type"] = #Type; \
} \
\
inline void from_json(const nlohmann::json& js, Type& p) \
{ \
auto op = [&js](const char* name, auto* v) { js.at(name).get_to(*v); }; \
_JsonTypeDefinition(p, op); \
} \
\
template <class AddField> \
inline void _JsonTypeDefinition(Type& value, AddField& add_field)

Definition at line 195 of file json_export.h.

magic_enum::detail::value
constexpr E value(std::size_t i) noexcept
Definition: magic_enum.hpp:664
detail::from_json
void from_json(const BasicJsonType &j, typename std::nullptr_t &n)
Definition: json.hpp:4664
lexy::op
typename LEXY_DECAY_DECLTYPE(Operator)::op_tag_type op
Definition: operator.hpp:41
json
basic_json<> json
default specialization
Definition: json.hpp:3422
detail::to_json
void to_json(BasicJsonType &j, T b) noexcept
Definition: json.hpp:5642
lexyd::p
constexpr auto p
Parses the production.
Definition: production.hpp:127


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Dec 13 2024 03:19:18