adding gccasm.rules to vcproj files
[reactos.git] / reactos / tools / rbuild / backend / backend.h
1 /*
2 * Copyright (C) 2005 Casper S. Hornstrup
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18 #ifndef __BACKEND_H
19 #define __BACKEND_H
20
21 #include "../rbuild.h"
22
23 class Backend;
24
25 typedef Backend* BackendFactory ( Project& project,
26 Configuration& configuration );
27
28 class Backend
29 {
30 public:
31 class Factory
32 {
33 static std::map<std::string,Factory*>* factories;
34 static int ref;
35
36 protected:
37
38 Factory ( const std::string& name_ );
39 virtual ~Factory();
40
41 virtual Backend* operator() ( Project&,
42 Configuration& configuration ) = 0;
43
44 public:
45 static Backend* Create ( const std::string& name,
46 Project& project,
47 Configuration& configuration );
48 };
49
50 protected:
51 Backend ( Project& project,
52 Configuration& configuration );
53
54 public:
55 virtual ~Backend();
56
57 virtual void Process () = 0;
58 Project& ProjectNode;
59 Configuration& configuration;
60 };
61
62 #endif /* __BACKEND_H */