ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t > Class Template Reference

Convert a geometry hierarchy map to/from Json. More...

#include <ActsPlugins/Json/GeometryHierarchyMapJsonConverter.hpp>

Inheritance diagram for Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >:
[legend]

Public Types

using Container = GeometryHierarchyMap<value_t>
using Value = value_t

Public Member Functions

 GeometryHierarchyMapJsonConverter (std::string valueIdentifier)
 Construct the converter.
Container fromJson (const nlohmann::json &encoded) const
 Decode a Json object into a geometry hierarchy map.
nlohmann::json toJson (const Container &container, const decorator_t *decorator) const
 Encode the geometry hierarchy map into a Json object.

Detailed Description

template<typename value_t, class decorator_t = void>
class Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >

Convert a geometry hierarchy map to/from Json.

Template Parameters
value_tvalue type stored in the geometry hierarchy map

The value type is expected to be directly convertible to/from a Json object. It has to be either a fundamental type or appropriate to_json(json&, const value_t&) and from_json(const json&, value_t&) functions must be available. See the relevant nlohmann::json documentation for further information.

A user-defined identifier is stored in the encoded Json object that is used to identify which value type is stored in the file. The identifier is checked for consistency when decoding the Json object.

Member Typedef Documentation

◆ Container

template<typename value_t, class decorator_t = void>
using Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >::Container = GeometryHierarchyMap<value_t>

◆ Value

template<typename value_t, class decorator_t = void>
using Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >::Value = value_t

Constructor & Destructor Documentation

◆ GeometryHierarchyMapJsonConverter()

template<typename value_t, class decorator_t = void>
Acts::GeometryHierarchyMapJsonConverter< value_t, decorator_t >::GeometryHierarchyMapJsonConverter ( std::string valueIdentifier)
explicit

Construct the converter.

Parameters
valueIdentifieruser-defined identifier for the stored value