ppap4lmp  0.7.2
processor.h
Go to the documentation of this file.
1 
9 #ifndef PROESSOR_H
10 #define PROESSOR_H
11 
12 #include <core/generators.h>
13 
18 class Processor {
25  protected:
52  virtual void run_impl(const int index) = 0;
69  template <class GEN>
70  void register_generator(
71  const ShPtr<GEN> &gen);
89  template <class GEN>
91  const Vec<ShPtr<GEN>> &gens);
101  virtual void use_generator_at(
102  const int i);
112  virtual void finish_using_generator_at(
113  const int i);
114  public:
116  Processor() = default;
117  virtual ~Processor() = default;
127  virtual void prepare() {}
137  virtual void finish() {}
153  virtual bool run();
162  void startup();
163 };
164 
165 #endif
virtual void finish_using_generator_at(const int i)
Call Generator::finish_using_generated_data of i* th Generator object in generators.
Definition: processor.cpp:68
Vec< ShPtr< Generator > > generators
Definition: processor.h:37
virtual void use_generator_at(const int i)
Call Generator::generate_data of i th Generator object in generators.
Definition: processor.cpp:58
void startup()
Startup this Processor object.
Definition: processor.cpp:101
This file includes all the header files of subclasses of Generator class.
int i_generator
Definition: processor.h:24
virtual bool run()
Run analysis using i th Generator object in generators, where i = i_generator.
Definition: processor.cpp:76
virtual void prepare()
Prepare analysis.
Definition: processor.h:127
int n_generators
Definition: processor.h:31
virtual void run_impl(const int index)=0
Implementation of analysis using an element of generators.
virtual void finish()
Finish analysis.
Definition: processor.h:137
std::vector< T > Vec
Vec is an alias for vector (same as list in Python).
Definition: std.h:27
void register_generator(const ShPtr< GEN > &gen)
Definition: processor.cpp:16
Processor analyzes data contained in one or more Generator objects.
Definition: processor.h:18
Processor()=default
Constructor of Processor class (default).
std::shared_ptr< T > ShPtr
ShPtr is an alias for shared pointer.
Definition: std.h:16
void register_generators(const Vec< ShPtr< GEN >> &gens)
Definition: processor.cpp:36