]> git.tdb.fi Git - builder.git/blob - source/action.h
Add comments
[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         /**
19         Checks whether the action is done and emits signal_done if it is.
20
21         @return  0 on successful completion, 1 on error, -1 if the action is still
22                  executing
23         */
24         virtual int check()=0;
25         
26         virtual ~Action() { }
27 protected:
28         Builder &builder;
29         
30         Action(Builder &b): builder(b) { }
31         void announce(const std::string &, const std::string &, const std::string &);
32 };
33
34 #endif