![]() |
|
|||
File indexing completed on 2025-02-22 10:31:21
0001 //----------------------------------*-C++-*----------------------------------// 0002 // Copyright 2024 UT-Battelle, LLC, and other Celeritas developers. 0003 // See the top-level COPYRIGHT file for details. 0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT) 0005 //---------------------------------------------------------------------------// 0006 //! \file celeritas/ext/RootJsonDumper.hh 0007 //---------------------------------------------------------------------------// 0008 #pragma once 0009 0010 #include <iosfwd> 0011 0012 #include "corecel/Config.hh" 0013 0014 #include "corecel/Assert.hh" 0015 0016 namespace celeritas 0017 { 0018 struct ImportData; 0019 0020 //---------------------------------------------------------------------------// 0021 /*! 0022 * Write an \c ImportData object to JSON output. 0023 * 0024 * \code 0025 * RootJsonDumper dump(&std::cout); 0026 * dump(my_import_data); 0027 * \endcode 0028 */ 0029 class RootJsonDumper 0030 { 0031 public: 0032 // Construct with an output stream 0033 explicit RootJsonDumper(std::ostream* os); 0034 0035 // Save data to the JSON file 0036 void operator()(ImportData const& data); 0037 0038 private: 0039 std::ostream* os_; 0040 }; 0041 0042 //---------------------------------------------------------------------------// 0043 #if !CELERITAS_USE_ROOT 0044 inline RootJsonDumper::RootJsonDumper(std::ostream*) 0045 { 0046 CELER_DISCARD(os_); 0047 CELER_NOT_CONFIGURED("ROOT"); 0048 } 0049 0050 inline void RootJsonDumper::operator()(ImportData const&) 0051 { 0052 CELER_ASSERT_UNREACHABLE(); 0053 } 0054 #endif 0055 0056 //---------------------------------------------------------------------------// 0057 } // namespace celeritas
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |