summaryrefslogtreecommitdiffabout
path: root/include/sitecing/acomponent.h
authorMichael Krelin <hacker@klever.net>2005-01-29 21:21:05 (UTC)
committer Michael Krelin <hacker@klever.net>2005-01-29 21:21:05 (UTC)
commitce1f37aae46ea95020d7b865f7a80e8abdfad0d8 (patch) (side-by-side diff)
tree4964383ab8cd7e6d8ea821f1a615d1bbcf98dad8 /include/sitecing/acomponent.h
parent3c75c860fc1ad5b3f5185e23ec6f438dd2528958 (diff)
downloadsitecing-0.0.zip
sitecing-0.0.tar.gz
sitecing-0.0.tar.bz2
initial commit into repository0.0
Diffstat (limited to 'include/sitecing/acomponent.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/sitecing/acomponent.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/include/sitecing/acomponent.h b/include/sitecing/acomponent.h
new file mode 100644
index 0000000..160e854
--- a/dev/null
+++ b/include/sitecing/acomponent.h
@@ -0,0 +1,78 @@
+#ifndef __SITECING_ACOMPONENT_H
+#define __SITECING_ACOMPONENT_H
+
+#include "sitecing/sitecing_interface.h"
+
+/**
+ * @file
+ * @brief The acomponent class declaration.
+ */
+
+namespace sitecing {
+
+ /**
+ * An abstract base class for sitecing components.
+ */
+ class acomponent {
+ public:
+ /**
+ * Pointer to the interface object, used to communicate with the
+ * site-C-ing core.
+ */
+ sitecing_interface *__SCIF;
+
+ acomponent();
+ virtual ~acomponent();
+
+ /**
+ * Set the interface to core pointer.
+ * @param scif the pointer to the interface object.
+ */
+ virtual void __set_interface(sitecing_interface *scif=0);
+ /**
+ * Invoked if the interface to the core has changed.
+ * @param oscif pointer to the old interface object.
+ */
+ virtual void __on_change_interface(sitecing_interface *oscif);
+
+ /**
+ * do import components.
+ */
+ virtual void __do_imports();
+ /**
+ * invoked on components imports.
+ */
+ virtual void __on_imports();
+ /**
+ * fetch the pointer to the most derived component.
+ * @returns pointer to the most derived object.
+ */
+ virtual void *__the_most_derived_this() = 0;
+
+ /**
+ * Do the job.
+ * @param __magic the magic number used as a key to decipher the
+ * rest of parameters.
+ * @param __args the parameters.
+ */
+ virtual void main(int __magic,va_list __args) = 0;
+
+ /**
+ * Run the component. Convenience helper for calling main().
+ * @param __magic the magic number.
+ * @param ... the rest of parameters.
+ * @see main();
+ */
+ void run(int __magic,...);
+
+ /**
+ * Helper function (which doesn't necessarily belongs here!) for
+ * reading the file and passing it to the output stream.
+ * @param fn the file name.
+ */
+ void pass_file_through(const char *fn);
+ };
+
+}
+
+#endif /* __SITECING_ACOMPONENT_H */