]> git.tdb.fi Git - builder.git/blob - source/action.h
Add Id tag to all files
[builder.git] / source / action.h
1 /* $Id$
2
3 This file is part of builder
4 Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef ACTION_H_
9 #define ACTION_H_
10
11 #include <string>
12 #include <sigc++/sigc++.h>
13
14 class Builder;
15
16 /**
17 Actions are executed to rebuild targets.
18 */
19 class Action
20 {
21 public:
22         /// Emitted when the action has finished
23         sigc::signal<void> signal_done;
24         
25         /**
26         Checks whether the action is done and emits signal_done if it is.
27
28         @return  0 on successful completion, 1 on error, -1 if the action is still
29                  executing
30         */
31         virtual int check()=0;
32         
33         virtual ~Action() { }
34 protected:
35         Builder &builder;
36         
37         Action(Builder &b): builder(b) { }
38         void announce(const std::string &, const std::string &, const std::string &);
39 };
40
41 #endif