summaryrefslogtreecommitdiffabout
path: root/include/sitecing/sitespace.h
Unidiff
Diffstat (limited to 'include/sitecing/sitespace.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/sitecing/sitespace.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/include/sitecing/sitespace.h b/include/sitecing/sitespace.h
new file mode 100644
index 0000000..38fafe4
--- a/dev/null
+++ b/include/sitecing/sitespace.h
@@ -0,0 +1,76 @@
1#ifndef __SITECING_SITESPACE_H
2#define __SITECING_SITESPACE_H
3
4#include <string>
5#include <map>
6#include <list>
7#include "sitecing/component_factory.h"
8#include "sitecing/component_so.h"
9#include "sitecing/configuration.h"
10
11/**
12 * @file
13 * @brief The sitespace class declaration.
14 */
15
16namespace sitecing {
17 using namespace std;
18
19 /**
20 * The class responsible for handling the whole environment (as far as I can
21 * remember).
22 */
23 class sitespace {
24 public:
25 /**
26 * The type for the map of components from the component name/path
27 * to the loaded component objects.
28 */
29 typedef map<string,component_so*> components_t;
30 /**
31 * The type for listing the components.
32 */
33 typedef list<component_so*> sentenced_t;
34 /**
35 * The main configuration object.
36 */
37 configuration& config;
38 /**
39 * The components producing factory.
40 */
41 component_factory factory;
42 /**
43 * The components loaded.
44 */
45 components_t components;
46 /**
47 * The list of components sentenced to death.
48 */
49 sentenced_t sentenced;
50
51 /**
52 * Create an object in accordance with the configuration parsed.
53 * @param c the coniguration container.
54 */
55 sitespace(configuration& c);
56 ~sitespace();
57
58 /**
59 * Fetch the component, providing it with the interface object
60 * pointer.
61 * @param c the component name.
62 * @param scif the interface object.
63 * @return the component fetches.
64 */
65 so_component fetch(const string& c,sitecing_interface* scif);
66
67 private:
68 /**
69 * Execute the death sentence as much as we can.
70 */
71 void execute_sentenced();
72 };
73
74}
75
76#endif /* __SITECING_SITESPACE_H */