Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:17:09

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2022-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 orange/detail/RectArrayInserter.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Types.hh"
0011 #include "corecel/data/CollectionBuilder.hh"
0012 #include "corecel/data/DedupeCollectionBuilder.hh"
0013 
0014 #include "TransformRecordInserter.hh"
0015 #include "../OrangeData.hh"
0016 #include "../OrangeInput.hh"
0017 #include "../OrangeTypes.hh"
0018 
0019 namespace celeritas
0020 {
0021 namespace detail
0022 {
0023 class UniverseInserter;
0024 //---------------------------------------------------------------------------//
0025 /*!
0026  * Convert a RectArrayInput a RectArrayRecord.
0027  */
0028 class RectArrayInserter
0029 {
0030   public:
0031     //!@{
0032     //! \name Type aliases
0033     using Data = HostVal<OrangeParamsData>;
0034     //!@}
0035 
0036   public:
0037     // Construct with universe inserter and parameter data
0038     RectArrayInserter(UniverseInserter* insert_universe, Data* orange_data);
0039 
0040     // Create a simple unit and return its ID
0041     UniverseId operator()(RectArrayInput const& inp);
0042 
0043   private:
0044     Data* orange_data_{nullptr};
0045     TransformRecordInserter insert_transform_;
0046     UniverseInserter* insert_universe_;
0047 
0048     CollectionBuilder<RectArrayRecord> rect_arrays_;
0049     DedupeCollectionBuilder<real_type> reals_;
0050     CollectionBuilder<Daughter> daughters_;
0051 };
0052 
0053 //---------------------------------------------------------------------------//
0054 }  // namespace detail
0055 }  // namespace celeritas