MarlinMT  0.1.0
GeometryPlugin.h
Go to the documentation of this file.
1 #ifndef MARLINMT_GEOMETRYPLUGIN_h
2 #define MARLINMT_GEOMETRYPLUGIN_h 1
3 
4 // -- std headers
5 #include <string>
6 #include <typeindex>
7 
8 // -- marlinmt headers
9 #include "marlinmt/Exceptions.h"
10 #include "marlinmt/Component.h"
11 
12 namespace marlinmt {
13 
14  class GeometryManager ;
15  class Application ;
16 
22  class GeometryPlugin : public Component {
23  friend class GeometryManager ;
24 
25  public:
26  GeometryPlugin() = delete ;
27  virtual ~GeometryPlugin() = default ;
28  GeometryPlugin(const GeometryPlugin &) = delete ;
29  GeometryPlugin& operator=(const GeometryPlugin &) = delete ;
30 
31  protected:
37  GeometryPlugin( const std::string &gtype ) ;
38 
39  protected:
43  virtual void loadGeometry() = 0 ;
44 
48  virtual const void *handle() const = 0 ;
49 
53  virtual void destroy() = 0 ;
54 
55  public:
59  virtual std::type_index typeIndex() const = 0 ;
60 
64  virtual void dumpGeometry() const = 0 ;
65 
69  void print() const ;
70 
71  protected:
73  virtual void initialize() override ;
74 
75  protected:
77  BoolParameter _dumpGeometry {*this, "DumpGeometry", "Whether to dump the geometry on creation", false} ;
78  };
79 
80 } // end namespace marlinmt
81 
82 #endif
GeometryManager class.
GeometryPlugin & operator=(const GeometryPlugin &)=delete
void print() const
Print the complete geometry plugin description.
virtual void dumpGeometry() const =0
Dump the geometry in the console.
virtual void initialize() override
Init the geometry plugin.
Component class.
Definition: Component.h:22
virtual void loadGeometry()=0
Load the geometry.
virtual void destroy()=0
Cleanup geometry.
virtual const void * handle() const =0
Get a handle on the geometry instance.
GeometryPlugin class Responsible for loading geometry in Marlin and providing access to it through th...
BoolParameter _dumpGeometry
Whether to dump the geometry on creation.
virtual std::type_index typeIndex() const =0
Get a type index object from the geometry handle.
virtual ~GeometryPlugin()=default