author | Michael Krelin <hacker@klever.net> | 2007-03-04 00:28:39 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-03-04 00:28:39 (UTC) |
commit | a3f38aafb288db5791b8dea34154cacc3c039971 (patch) (side-by-side diff) | |
tree | b7f735ef9fde95de5935c1784d8d9486a3e4cf10 /include/sitecing/component_so.h | |
parent | ca2207bcf18ed5b0dd1a0e370e9973d717ff87c9 (diff) | |
download | sitecing-a3f38aafb288db5791b8dea34154cacc3c039971.zip sitecing-a3f38aafb288db5791b8dea34154cacc3c039971.tar.gz sitecing-a3f38aafb288db5791b8dea34154cacc3c039971.tar.bz2 |
some doxygen improvements
Diffstat (limited to 'include/sitecing/component_so.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | include/sitecing/component_so.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sitecing/component_so.h b/include/sitecing/component_so.h index 3239d4a..3daceef 100644 --- a/include/sitecing/component_so.h +++ b/include/sitecing/component_so.h @@ -1,159 +1,165 @@ #ifndef __SITECING_COMPONENT_SO_H #define __SITECING_COMPONENT_SO_H #include <sys/types.h> #include <sys/stat.h> #include <string> #include <map> #include <list> #include "sitecing/acomponent.h" /** * @file * @brief Classes related to the .so components handling. */ namespace sitecing { using namespace std; /** * The 'class' component object. */ class component_so { public: /** * The type of the component instantiating function. */ typedef acomponent *(*egg_t)(); /** * Type for storing the list of instances and the reference counts. */ typedef map<acomponent*,int> used_chickens_t; /** * The type for storing the list of unused instances. */ typedef list<acomponent*> free_chickens_t; /** * The .so file name. */ string sofile; /** * The stat structure for the .so loaded. */ struct stat stso; /** * The dloaded .so handle. */ void *dl; /** * Pointer to the instatiator function. */ egg_t egg; /** * The list of instances in use. */ used_chickens_t chickens_used; /** * The list of unused instances. */ free_chickens_t chickens_free; /** * @param soname the .so file name */ component_so(const string& soname); ~component_so(); /** * Check whether the loaded .so is in sync with the disk file. */ bool is_uptodate() const; /** * @todo TODO: wish I could remember -- document me. */ acomponent* allocate_chicken(); /** * @todo TODO: wish I could remember -- document me. */ void allocate_chicken(acomponent *ac); /** * @todo TODO: wish I could remember -- document me. */ void deallocate_chicken(acomponent *ac); }; /** * The component instance container. */ class so_component { public: /** * Pointer to the component 'class'. */ component_so *hen; /** * The instance in question. */ acomponent* ac; so_component() : hen(0), ac(0) { } /** * @param h the 'class' object. * @param scif pointer to the interface to the site-C-ing core. */ so_component(component_so *h,sitecing_interface *scif); /** * Copy constructor * @param s source instance. */ so_component(const so_component& s) : hen(0), ac(0) { attach(s); } ~so_component() { detach(); } /** * Assignment operator. * @param s source instance. */ so_component& operator=(const so_component& s) { attach(s); return *this; } /** * @todo TODO: wish I could remember the details -- document me. * @param h the 'class' object. * @param a the instance to be attached. */ void attach(component_so *h,acomponent *a); /** * @todo TODO: wish I could remember the details -- document me. * @param s the source instance. */ void attach(const so_component& s) { attach(s.hen,s.ac); } /** * @todo TODO: wish I could remember the details -- document me. */ void detach(); }; /** * The typed component instance container template. * @param CT the component class. */ template<typename CT> class so_component_t : public sitecing::so_component { public: /** * @param s The untyped instance container. */ so_component_t(const so_component& s) : so_component(s) { } + + /** + * typed dereference operator + * @return the pointer to the most derived component instance + * @see acomponent::__the_most_derived_this() + */ CT* operator->() { return static_cast<CT*>(ac->__the_most_derived_this()); } }; } #endif /* __SITECING_COMPONENT_SO_H */ |