diff --git a/alib2common/src/core/components.hpp b/alib2common/src/core/components.hpp index 69c846ebae3d5eea6dccb742872e14e6d5922de6..01f1beb77ba1c8621bebca97bad31d18660ce112 100644 --- a/alib2common/src/core/components.hpp +++ b/alib2common/src/core/components.hpp @@ -147,9 +147,17 @@ public: } static void registerComponent ( ) { - std::array < std::string, 0 > names; - ComponentType & ( Derived::* method ) ( ) = & Component < Derived, ComponentType, component::Value, ComponentName >::get; - abstraction::AlgorithmRegistry::registerMethod < ComponentName > ( method, "get", names ); + std::array < std::string, 0 > emptyNames; + std::array < std::string, 1 > elementNames = { { "element" } }; + + ComponentType & ( Derived::* getMethod ) ( ) = & Component < Derived, ComponentType, component::Value, ComponentName >::get; + abstraction::AlgorithmRegistry::registerMethod < ComponentName > ( getMethod, "get", emptyNames ); + + const ComponentType & ( Derived::* constGetMethod ) ( ) const = & Component < Derived, ComponentType, component::Value, ComponentName >::get; + abstraction::AlgorithmRegistry::registerMethod < ComponentName > ( constGetMethod, "get", emptyNames ); + + bool ( Derived::* setMethod ) ( ComponentType ) = & Component < Derived, ComponentType, component::Value, ComponentName >::set; + abstraction::AlgorithmRegistry::registerMethod < ComponentName > ( setMethod, "set", elementNames ); } };