Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-06-26 07:05:40

0001 // Created by Dmitry Romanov
0002 // Subject to the terms in the LICENSE file found in the top-level directory.
0003 //
0004 
0005 #pragma once
0006 namespace eicrecon {
0007 
0008     /**
0009      * This struct might be used for factories that has no underlying config class,
0010      * for example:
0011      *    WithPodConfig<NoConfig>
0012      */
0013     struct NoConfig {
0014     };
0015 
0016     /**
0017      * Small helper class that brings common functions interface for classes that have POD type config
0018      * @tparam ConfigT
0019      *
0020      * @example:
0021      *
0022      */
0023     template<typename ConfigT = NoConfig>
0024     class WithPodConfig {
0025     public:
0026         using ConfigType = ConfigT;
0027 
0028         /// Get a configuration to be changed
0029         ConfigT& getConfig() {return m_cfg;}
0030 
0031         /// Sets a configuration (config is properly copyible)
0032         ConfigT& applyConfig(ConfigT cfg) { m_cfg = cfg; return m_cfg;}
0033 
0034     protected:
0035         /** configuration parameters **/
0036         ConfigT m_cfg;
0037     };
0038 }