]> git.tdb.fi Git - builder.git/blob - source/action.h
Replace per-file copyright notices with a single file
[builder.git] / source / action.h
1 #ifndef ACTION_H_
2 #define ACTION_H_
3
4 #include <string>
5 #include <sigc++/sigc++.h>
6
7 class Builder;
8
9 /**
10 Actions are executed to rebuild targets.
11 */
12 class Action
13 {
14 public:
15         /// Emitted when the action has finished
16         sigc::signal<void> signal_done;
17         
18 protected:
19         Builder &builder;
20         
21         Action(Builder &b): builder(b) { }
22 public:
23         virtual ~Action() { }
24
25         /**
26         Checks whether the action is done and emits signal_done if it is.  Returns 0
27         if the action has completed successfully, 1 if an error was encountered and
28         -1 if it is still executing.
29         */
30         virtual int check() = 0;
31         
32 protected:
33         /**
34         Annouces the action by printing out the package name, tool and target name.
35         */
36         void announce(const std::string &, const std::string &, const std::string &);
37 };
38
39 #endif