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.
32 Class* object = anna::functions::component <Class> (FILE_LOCATION);
37 If component 'Class' hasn't been registered, #anna::functions::component will launch an exception.
39 class Component : public anna::Mutex {
47 Gets the class name configured at constructor.
48 \return The class name configured at constructor.
50 const char* getClassName() const throw() { return a_className.c_str(); }
53 * Class string representation
55 * @return String with class content
57 virtual std::string asString(void) const throw();
60 Class XML representation.
61 \param parent XML node over which we will put instance information.
62 \return XML documentcon with class content.
64 virtual anna::xml::Node* asXML(anna::xml::Node* parent) const throw();
69 const std::string a_className;
73 @param className Logical name for tha class.
75 explicit Component(const char* className);
77 Component (const Component& other);