Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53:43

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file celeritas/optical/detail/OpticalSizes.json.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <nlohmann/json.hpp>
0010 
0011 #include "corecel/Types.hh"
0012 #include "corecel/io/JsonUtils.json.hh"
0013 
0014 namespace celeritas
0015 {
0016 namespace detail
0017 {
0018 //---------------------------------------------------------------------------//
0019 /*!
0020  * Save state size/capacity counters.
0021  *
0022  * These should be *integrated* across streams, *per process*.
0023  */
0024 struct OpticalSizes
0025 {
0026     size_type generators{};
0027     size_type initializers{};
0028     size_type tracks{};
0029     size_type streams{};
0030 };
0031 
0032 //---------------------------------------------------------------------------//
0033 
0034 void to_json(nlohmann::json& j, OpticalSizes const& inp)
0035 {
0036     j = {
0037         CELER_JSON_PAIR(inp, generators),
0038         CELER_JSON_PAIR(inp, initializers),
0039         CELER_JSON_PAIR(inp, tracks),
0040         CELER_JSON_PAIR(inp, streams),
0041     };
0042 }
0043 
0044 //---------------------------------------------------------------------------//
0045 }  // namespace detail
0046 }  // namespace celeritas