Marlin  01.17.01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CMProcessor.h
Go to the documentation of this file.
1 #ifndef CMPROCESSOR_H
2 #define CMPROCESSOR_H
3 
4 #include "marlin/Processor.h"
5 #include "marlin/ProcessorMgr.h"
6 
7 namespace marlin{
12 
21  class CMProcessor{
22 
23  public:
24  // Destructor
25  ~CMProcessor();
26 
28  static CMProcessor* instance() ;
29 
31  Processor* getProc( const std::string& type );
32 
35 
38 
42 
45  ProcessorParameter* getParam( const std::string& type, const std::string& key );
46 
49  const std::string getParamD( const std::string& type, const std::string& key );
50 
53  const std::string getParamT( const std::string& type, const std::string& key );
54 
57  int getParamSetSize( const std::string& type, const std::string& key );
58 
61  bool isParamVec( const std::string& type, const std::string& key );
62 
65  bool isParamOpt( const std::string& type, const std::string& key );
66 
68  bool isInstalled( const std::string& type );
69 
70  //utility function to tokenize strings
71  void tokenize( const std::string str, StringVec& tokens, const std::string& delimiters = " " );
72 
73  private:
74  // Constructor
75  CMProcessor();
76 
77  static CMProcessor* _me; //singleton instance
78  ProcessorMap _mProcs{}; //processor instances
79  ssMap _mpDescriptions{}; //processor descriptions
80  sbMap _mpStatus{}; //processor status ( INSTALLED=true ; NOT_INSTALLED=false )
81  sSPMap _mpSParameters{}; //processor string parameters
82 
83  sSet _mpTypes{}; //all processor types
84 
85  }; // end class CMProcessor
86 
87 } // end namespace marlin
88 #endif
static CMProcessor * instance()
return the instance of this class
Definition: CMProcessor.cc:11
This singleton class contains an instance of every available marlin processor type.
Definition: CMProcessor.h:21
const std::string getParamT(const std::string &type, const std::string &key)
returns the type of the parameter with the given key for the processor with the given type ...
Definition: CMProcessor.cc:173
ssMap getProcDesc()
returns a map with the processor descriptions
Definition: CMProcessor.h:34
bool isInstalled(const std::string &type)
returns true if the processor with the given type is installed
Definition: CMProcessor.cc:85
ProcessorParameter * getParam(const std::string &type, const std::string &key)
returns the parameter with the given key of the processor with the given type
Definition: CMProcessor.cc:152
std::map< std::string, std::shared_ptr< StringParameters > > sSPMap
Definition: CMProcessor.h:11
Processor * getProc(const std::string &type)
returns the instance of the processor with the given type
Definition: CMProcessor.cc:92
std::set< std::string > sSet
Definition: CCProcessor.h:22
const std::string getParamD(const std::string &type, const std::string &key)
returns the description of the parameter with the given key for the processor with the given type ...
Definition: CMProcessor.cc:165
STL class.
static CMProcessor * _me
Definition: CMProcessor.h:77
ProcessorMap _mProcs
Definition: CMProcessor.h:78
std::map< std::string, std::string > ssMap
Definition: CCProcessor.h:26
void tokenize(const std::string str, StringVec &tokens, const std::string &delimiters=" ")
Definition: CMProcessor.cc:212
Class that holds a steering variable for a marlin processor - automatically created by Processor::reg...
int getParamSetSize(const std::string &type, const std::string &key)
returns the set_size of the parameter with the given key for the processor with the given type ...
Definition: CMProcessor.cc:181
std::shared_ptr< StringParameters > mergeParams(const std::string &type, std::shared_ptr< StringParameters > sp)
merges the given parameters with the default ones from the processor with the given type ...
Definition: CMProcessor.cc:106
bool isParamOpt(const std::string &type, const std::string &key)
returns true if the parameter with the given key for the processor with the given type is optional ...
Definition: CMProcessor.cc:189
Base class for Marlin processors.
Definition: Processor.h:64
bool isParamVec(const std::string &type, const std::string &key)
returns true if the parameter with the given key for the processor with the given type is a vector ...
Definition: CMProcessor.cc:198
std::map< std::string, bool > sbMap
Definition: CMProcessor.h:9
std::shared_ptr< StringParameters > getSParams(const std::string &type)
returns the parameters for the processor of the given type
Definition: CMProcessor.cc:99