1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_core_util_Component_hpp
10 #define anna_core_util_Component_hpp
14 #include <anna/core/RuntimeException.hpp>
15 #include <anna/core/mt/Mutex.hpp>
26 Component parent class
28 It must be only one instance for each component, but we can't inherit them from anna::Singleton because the
29 programmer must have the posibility to re-implement the component. The main difference regarding anna components
30 is that anna component are not associated to the application, allowing to be used on non-anna applications
31 (instead of anna application, component is got internally through a singleton anna::ComponentManager).
32 In this way, some anna libraries could build resources based on this, allowing its use by many kind of projects.
34 ANNA components excludes concept of predecessor component and start/stop procedures, because complete use of
35 components must be done over pure-anna applications with its anna::app::componet resources.
38 Class* object = anna::functions::component <Class> (FILE_LOCATION);
43 If component 'Class' hasn't been registered, #anna::functions::component will launch an exception.
45 class Component : public anna::Mutex {
53 Gets the class name configured at constructor.
54 \return The class name configured at constructor.
56 const char* getClassName() const throw() { return a_className.c_str(); }
59 * Class string representation
61 * @return String with class content
63 virtual std::string asString(void) const throw();
66 Class XML representation.
67 \param parent XML node over which we will put instance information.
68 \return XML documentcon with class content.
70 virtual anna::xml::Node* asXML(anna::xml::Node* parent) const throw();
77 @param className Logical name for tha class.
79 explicit Component(const char* className);
83 const std::string a_className;
85 //Component (const Component& other);