-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add io concepts and restructure backend folder
- Loading branch information
1 parent
b4abb48
commit 5e89f23
Showing
29 changed files
with
552 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** Detray library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2025 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
// Project include(s) | ||
#include "detray/core/detail/type_traits.hpp" | ||
|
||
namespace detray::concepts { | ||
|
||
/// Check for the the presence of any type of grids in a detector definition | ||
template <class detector_t> | ||
concept has_grids = detail::contains_grids_v<typename detector_t::accel> || | ||
detail::contains_grids_v<typename detector_t::materials>; | ||
|
||
/// Check for the the presence of surface grids in a detector definition | ||
template <class detector_t> | ||
concept has_surface_grids = | ||
detail::contains_surface_grids_v<typename detector_t::accel>; | ||
|
||
/// Check for the the presence of material slabs in a detector definition | ||
template <class detector_t> | ||
concept has_material_slabs = | ||
detail::contains_material_slabs_v<typename detector_t::materials>; | ||
|
||
/// Check for the the presence of material rods in a detector definition | ||
template <class detector_t> | ||
concept has_material_rods = | ||
detail::contains_material_rods_v<typename detector_t::materials>; | ||
|
||
/// Check for the the presence of homogeneous material types in a detector | ||
/// definition | ||
template <class detector_t> | ||
concept has_homogeneous_material = | ||
detail::contains_homogeneous_material_v<typename detector_t::materials>; | ||
|
||
/// Check for the the presence of material maps in a detector definition | ||
template <class detector_t> | ||
concept has_material_maps = | ||
detail::contains_material_maps_v<typename detector_t::materials>; | ||
|
||
} // namespace detray::concepts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** Detray library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2025 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
// Project include(s) | ||
#include "detray/builders/detector_builder.hpp" | ||
#include "detray/utils/type_traits.hpp" | ||
|
||
// System include(s) | ||
#include <concepts> | ||
#include <string_view> | ||
|
||
namespace detray::io::concepts { | ||
|
||
/// Concept for detray io reader backends | ||
template <typename D, typename R> | ||
concept reader_backend = | ||
requires(const R rb, detector_builder<typename D::metadata> det_builder, | ||
typename D::name_map names) { | ||
|
||
typename R::payload_type; | ||
|
||
{ R::tag } | ||
->std::same_as<const std::string_view&>; | ||
|
||
{ | ||
R::template from_payload<D>(det_builder, names, | ||
typename R::payload_type()) | ||
} | ||
->std::same_as<void>; | ||
}; | ||
|
||
/// Concept for detray io writer backends | ||
template <typename D, typename W> | ||
concept writer_backend = requires(const W wb, D det, | ||
typename D::name_map names) { | ||
|
||
typename W::payload_type; | ||
|
||
{ W::tag } | ||
->std::same_as<const std::string_view&>; | ||
|
||
{ W::to_payload(det, names) } | ||
->std::same_as<typename W::payload_type>; | ||
}; | ||
|
||
} // namespace detray::io::concepts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.