LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
task.hh
Go to the documentation of this file.
1 
6 #ifndef TASK_TASK_HH
7 # define TASK_TASK_HH
8 
9 # include <string>
10 # include <list>
11 # include <task/task-register.hh>
12 
13 namespace task
14 {
15 
22  class Task
23  {
24 
27  public:
36  Task(const char* name, const char* module_name, const char* desc,
37  int key = 0, const std::string& deps = "");
38 
40  virtual ~Task();
46  public:
48  virtual bool check() const = 0;
50  virtual void execute() const = 0;
54 
55  typedef std::list<std::string> deps_type;
56 
57  virtual deps_type
58  resolve_dependencies(tasks_list_type& active_tasks) const;
59 
60 
63  public:
70  const char* name_get() const;
71 
73  const char* module_name_get() const;
74 
76  int key_get() const;
77 
79  const char* desc_get() const;
80 
82  const char* argname_get() const;
83  void argname_set(const char*);
84 
86  void arg_set(const char* arg) const;
87  const char* arg_get() const;
88 
90  const deps_type& dependencies_get() const;
91 
94  public:
96  void print_dependencies() const;
97 
98  public:
100  static std::string normalize(const std::string& task_name);
101 
102  protected:
104  std::string name_;
106  const char* module_name_;
113  int key_;
115  const char* desc_;
117  const char* argname_;
119  mutable const char* arg_;
122  };
123 
124 } // namespace task
125 # include <task/task.hxx>
126 
127 #endif // !TASK_TASK_HH