author | Michael Krelin <hacker@klever.net> | 2005-01-29 21:21:05 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2005-01-29 21:21:05 (UTC) |
commit | ce1f37aae46ea95020d7b865f7a80e8abdfad0d8 (patch) (side-by-side diff) | |
tree | 4964383ab8cd7e6d8ea821f1a615d1bbcf98dad8 /include/sitecing/component_factory.h | |
parent | 3c75c860fc1ad5b3f5185e23ec6f438dd2528958 (diff) | |
download | sitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.zip sitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.tar.gz sitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.tar.bz2 |
initial commit into repository0.0
Diffstat (limited to 'include/sitecing/component_factory.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | include/sitecing/component_factory.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/include/sitecing/component_factory.h b/include/sitecing/component_factory.h new file mode 100644 index 0000000..a208ed1 --- a/dev/null +++ b/include/sitecing/component_factory.h @@ -0,0 +1,84 @@ +#ifndef __SITECING_COMPONENT_FACTORY_H +#define __SITECING_COMPONENT_FACTORY_H + +#include <string> +#include <list> +#include <stdexcept> +#include "sitecing/file_factory.h" +#include "sitecing/configuration.h" + +/** + * @file + * @brief The component_factory class declaration. + */ + +namespace sitecing { + using namespace std; + + /** + * @brief The components builder. + */ + class component_factory : public file_factory { + public: + /** + * Path to the source files root. + */ + string root_source; + /** + * Path to the root of the intermediate files storage. + */ + string root_intermediate; + /** + * Output path for .so components. + */ + string root_so; + /** + * Reference to the configuration container. + */ + configuration& config; + + /** + * @param c reference to the configuration container. + */ + component_factory(configuration& c); + + /** + * @overload file_factory::get_dependencies() + */ + virtual void get_dependencies(const string& dst,file_list_t& deps); + /** + * @overload file_factory::is_uptodate() + */ + virtual bool is_uptodate(const string& dst,file_list_t *deps=NULL); + /** + * @overload file_factory::build() + */ + virtual void build(const string& dst); + + /** + * Helper function for executing external command. + * @param cmd the command to execute. + * @param args the command line arguments. + * @param stdo stdout for the child process. + * @param stde stderr for the child process. + * @return exit code. + */ + int execute(const string& cmd,const list<string>& args,int stdo,int stde); + /** + * Fetch the class name of the component. + * @param component the component. + * @return the class name. + */ + string get_classname(const string& component); + /** + * Get the components from which the target component has been + * derived. + * @param component the target component + * @param rv where to store the list of ancestors. + */ + void get_ancestors(const string& component,file_list_t &rv); + }; + +} + +#endif /* __SITECING_COMPONENT_FACTORY_H */ |