Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 07:49:15

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "Acts/Plugins/Json/GeometryIdentifierJsonConverter.hpp"
0010 
0011 void Acts::to_json(nlohmann::json& j, const GeometryIdentifier& geoId) {
0012   j = GeometryIdentifierJsonConverter::encodeIdentifier(geoId);
0013 }
0014 
0015 void Acts::from_json(const nlohmann::json& j, GeometryIdentifier& geoId) {
0016   // Check if the JSON object iself is a GeometryIdentifier::ValueType
0017   if (!j.is_object()) {
0018     auto value = j.get<GeometryIdentifier::Value>();
0019     geoId = GeometryIdentifier(value);
0020     return;
0021   }
0022 
0023   geoId = GeometryIdentifierJsonConverter::decodeIdentifier(j);
0024 }