libepp_nicbr
SheppCommand.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: SheppCommand.H 1086 2010-12-10 13:07:28Z eduardo $ */
7 #ifndef __SHEPP_COMMAND_H__
8 #define __SHEPP_COMMAND_H__
9 
10 #include <string>
11 using std::string;
12 
13 typedef int isfunc_t (vector<string> &);
14 
16 class SheppCommand {
17 public:
19  bool operator<(const SheppCommand &cmd) const {
20  return name < cmd.name;
21  }
22 
25  {
26  init();
27  }
28 
30  SheppCommand(string name, isfunc_t *function, string brief)
31  {
32  this->name = name;
33  this->function = function;
34  this->brief = brief;
35  }
36 
38  void reset(string name, isfunc_t *function, string brief)
39  {
40  this->name = name;
41  this->function = function;
42  this->brief = brief;
43  }
44 
46  string name;
47 
49  isfunc_t *function;
50 
52  string brief;
53 protected:
55  void init()
56  {
57  name = "";
58  function = NULL;
59  brief = "";
60  }
61 };
62 
63 #endif //__SHEPP_COMMAND_H__
bool operator<(const SheppCommand &cmd) const
Operator necessary to create a set of SheppCommands.
Definition: SheppCommand.H:19
string brief
SheppCommand brief description.
Definition: SheppCommand.H:52
void reset(string name, isfunc_t *function, string brief)
Reinitializes all object attributes.
Definition: SheppCommand.H:38
SheppCommand class: command name, function and a brief description.
Definition: SheppCommand.H:16
void init()
Initializes all object attributes to empty.
Definition: SheppCommand.H:55
SheppCommand()
Constructor that initializes all object attributes to empty.
Definition: SheppCommand.H:24
string name
SheppCommand name.
Definition: SheppCommand.H:46
SheppCommand(string name, isfunc_t *function, string brief)
Constructor that sets all object attributes.
Definition: SheppCommand.H:30