PetaVision  Alpha
KeywordHandler.hpp
1 /*
2  * KeywordHandler.hpp
3  *
4  * Created on: Jan 20, 2016
5  * Author: pschultz
6  */
7 
8 #ifndef KEYWORDHANDLER_HPP_
9 #define KEYWORDHANDLER_HPP_
10 
11 #include <columns/BaseObject.hpp>
12 
13 namespace PV {
14 
15 typedef BaseObject *(*ObjectCreateFn)(char const *name, HyPerCol *hc);
16 
17 class HyPerCol;
18 
38  public:
42  KeywordHandler(char const *kw, ObjectCreateFn creator);
43 
47  KeywordHandler(KeywordHandler const &orig);
48 
53 
57  const char *getKeyword() const { return keyword; }
58 
62  ObjectCreateFn getCreator() const { return creator; }
63 
67  BaseObject *create(char const *name, HyPerCol *hc) const;
68 
72  virtual ~KeywordHandler();
73 
74  protected:
79  int initialize(char const *kw, BaseObject *(*creator)(char const *name, HyPerCol *hc));
80 
81  // Member variables
82  private:
83  char *keyword;
84  ObjectCreateFn creator;
85 };
86 
87 } /* namespace PV */
88 
89 #endif /* KEYWORDHANDLER_HPP_ */
BaseObject * create(char const *name, HyPerCol *hc) const
KeywordHandler(char const *kw, ObjectCreateFn creator)
ObjectCreateFn getCreator() const
KeywordHandler & operator=(KeywordHandler const &orig)
const char * getKeyword() const
int initialize(char const *kw, BaseObject *(*creator)(char const *name, HyPerCol *hc))