Falaise  4.0.1
SuperNEMO Software Toolkit
geometry.h
Go to the documentation of this file.
1 //! \file falaise/snemo/services/geometry.h
2 //! \brief Types and traits for the SuperNEMO Geometry Service
3 #ifndef SNEMO_GEOMETRY_SVC_HH
4 #define SNEMO_GEOMETRY_SVC_HH
5 
8 
9 namespace snemo {
10 // NB: Document in terms of inheritance purely to fool Doxygen...
11 /*! \class snemo::geometry_svc
12  * \brief Locate, track, and trace elements of the SuperNEMO detector geometry
13  * \implements geomtools::manager
14  *
15  * It provides an implementation of the `const` parts of the @ref geomtools::manager interface,
16  * and you should consult documentation for that class for full details.
17  *
18  * The class should only be created through obtaining a @ref snemo::service_handle
19  * using a @ref datatools::service_manager, e.g.
20  *
21  * ```cpp
22  * void example(datatools::service_manager& s) {
23  * snemo::service_handle<snemo::geometry_svc> geosvc{s};
24  * ...
25  * }
26  * ```
27  *
28  * Direct construction is not supported and cannot be guaranteed to work.
29  *
30  * \sa geomtools::manager
31  */
33 
34 //! Specialization of service_traits for geometry_svc
35 template <>
37  using label_type = BOOST_METAPARSE_STRING("geometry");
40 
42  return &(sm.get_geom_manager());
43  }
44 };
45 
46 } // namespace snemo
47 
48 #endif // SNEMO_GEOMETRY_SVC_HH
49 
const geomtools::manager & get_geom_manager() const
static instance_type * get(service_type &sm)
Definition: geometry.h:41
Template struct for defining trait types and functions for a service.
Definition: service_traits.h:44
Locate, track, and trace elements of the SuperNEMO detector geometry.
Definition: calo_tapered_scin_box_model.h:54
BOOST_METAPARSE_STRING("geometry") label_type
Definition: geometry.h:37
const geomtools::manager geometry_svc
Definition: geometry.h:32