summaryrefslogtreecommitdiffabout
path: root/include/sitecing/sitespace.h
Side-by-side diff
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 @@
+#ifndef __SITECING_SITESPACE_H
+#define __SITECING_SITESPACE_H
+
+#include <string>
+#include <map>
+#include <list>
+#include "sitecing/component_factory.h"
+#include "sitecing/component_so.h"
+#include "sitecing/configuration.h"
+
+/**
+ * @file
+ * @brief The sitespace class declaration.
+ */
+
+namespace sitecing {
+ using namespace std;
+
+ /**
+ * The class responsible for handling the whole environment (as far as I can
+ * remember).
+ */
+ class sitespace {
+ public:
+ /**
+ * The type for the map of components from the component name/path
+ * to the loaded component objects.
+ */
+ typedef map<string,component_so*> components_t;
+ /**
+ * The type for listing the components.
+ */
+ typedef list<component_so*> sentenced_t;
+ /**
+ * The main configuration object.
+ */
+ configuration& config;
+ /**
+ * The components producing factory.
+ */
+ component_factory factory;
+ /**
+ * The components loaded.
+ */
+ components_t components;
+ /**
+ * The list of components sentenced to death.
+ */
+ sentenced_t sentenced;
+
+ /**
+ * Create an object in accordance with the configuration parsed.
+ * @param c the coniguration container.
+ */
+ sitespace(configuration& c);
+ ~sitespace();
+
+ /**
+ * Fetch the component, providing it with the interface object
+ * pointer.
+ * @param c the component name.
+ * @param scif the interface object.
+ * @return the component fetches.
+ */
+ so_component fetch(const string& c,sitecing_interface* scif);
+
+ private:
+ /**
+ * Execute the death sentence as much as we can.
+ */
+ void execute_sentenced();
+ };
+
+}
+
+#endif /* __SITECING_SITESPACE_H */