Luiza  v03-01
CMProcessor.h
1 #ifndef CMPROCESSOR_H
2 #define CMPROCESSOR_H
3 
4 #include "luiza/Processor.h"
5 #include "luiza/ProcessorMgr.h"
6 
7 namespace luiza{
8  typedef std::set< std::string > sSet;
9  typedef std::map< std::string, bool > sbMap;
10  typedef std::map< std::string, std::string > ssMap;
11  typedef std::map< std::string, StringParameters* > sSPMap;
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 
34  ssMap getProcDesc(){ return _mpDescriptions; }
35 
37  StringParameters* getSParams( const std::string& type );
38 
41  StringParameters* mergeParams( const std::string& type, StringParameters* sp );
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 luiza
88 #endif
bool isParamOpt(const std::string &type, const std::string &key)
Definition: CMProcessor.cc:189
Definition: CMProcessor.h:21
bool isParamVec(const std::string &type, const std::string &key)
Definition: CMProcessor.cc:198
int getParamSetSize(const std::string &type, const std::string &key)
Definition: CMProcessor.cc:181
bool isInstalled(const std::string &type)
Definition: CMProcessor.cc:85
ssMap getProcDesc()
Definition: CMProcessor.h:34
ProcessorParameter * getParam(const std::string &type, const std::string &key)
Definition: CMProcessor.cc:152
static CMProcessor * instance()
Definition: CMProcessor.cc:11
Base class for Luiza processors.
Definition: Processor.h:55
const std::string getParamT(const std::string &type, const std::string &key)
Definition: CMProcessor.cc:173
StringParameters * mergeParams(const std::string &type, StringParameters *sp)
Definition: CMProcessor.cc:106
StringParameters * getSParams(const std::string &type)
Definition: CMProcessor.cc:99
Definition: ProcessorParameter.h:27
Processor * getProc(const std::string &type)
Definition: CMProcessor.cc:92
Namespace for Luiza framework.
Definition: CCCollection.h:6
const std::string getParamD(const std::string &type, const std::string &key)
Definition: CMProcessor.cc:165