Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 07:46:21

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 #pragma once
0010 
0011 #include "Acts/Geometry/GeometryModule.h"
0012 #include "Acts/Geometry/TrackingGeometry.hpp"
0013 
0014 #include <memory>
0015 
0016 namespace Acts::detail {
0017 using BuildFunction = std::unique_ptr<TrackingGeometry> (*)(const Logger&);
0018 const ActsGeometryModuleV1* getGeometryModule(const char* module_abi_tag,
0019                                               const char* user_data_type,
0020                                               BuildFunction buildFunc);
0021 // Low-level shared helper: accepts a raw build function pointer matching the
0022 // C ABI struct's .build field. Handles static struct init and destroy.
0023 const ActsGeometryModuleV1* getGeometryModuleFromRaw(
0024     const char* module_abi_tag, const char* user_data_type,
0025     void* (*buildFunc)(const void*, const void*));
0026 }  // namespace Acts::detail
0027 
0028 // Internal — do not use directly.
0029 #define ACTS_IMPL_GEOMETRY_MODULE_ENTRY(get_module_expr)                 \
0030   extern "C" const ActsGeometryModuleV1* acts_geometry_module_v1(void) { \
0031     return (get_module_expr);                                            \
0032   }
0033 
0034 // Emit a clear error only when the macro is actually expanded without the tag,
0035 // rather than at include time — Acts internal code includes this header too.
0036 #ifdef ACTS_GEOMETRY_MODULE_ABI_TAG
0037 #define ACTS_DEFINE_GEOMETRY_MODULE(build_function)                \
0038   ACTS_IMPL_GEOMETRY_MODULE_ENTRY(Acts::detail::getGeometryModule( \
0039       ACTS_GEOMETRY_MODULE_ABI_TAG, nullptr, (build_function)))
0040 #else
0041 #define ACTS_DEFINE_GEOMETRY_MODULE(build_function)                  \
0042   static_assert(false,                                               \
0043                 "ACTS_GEOMETRY_MODULE_ABI_TAG must be provided via " \
0044                 "CMake (use acts_add_geometry_module).")
0045 #endif