18 #ifndef MAUVE_RUNTIME_INTERFACE_HPP 19 #define MAUVE_RUNTIME_INTERFACE_HPP 21 #include "AbstractInterface.hpp" 22 #include "ServiceContainer.hpp" 23 #include "EventService.hpp" 24 #include "ReadService.hpp" 25 #include "WriteService.hpp" 26 #include "CallService.hpp" 27 #include "InterfaceContainer.hpp" 28 #include "WithHook.hpp" 33 template <
typename SHELL,
typename CORE>
41 template <
typename S,
typename C,
typename I>
46 std::string
name()
const {
return _container->name(); }
50 std::size_t get_services_size()
const override final {
return services.size(); }
52 const std::vector<Service*>
get_services()
const override final;
58 int get_service_index(
const Service* service)
const override final;
62 inline bool is_configured() const override final {
return _configured; }
64 inline bool configure() override final {
return _container->configure_interface(); }
65 inline void cleanup() override final { _container->cleanup_interface(); }
67 inline CORE * core_ptr ()
const override final {
return _container->core_ptr(); }
73 inline SHELL & shell()
const {
return _container->shell(); };
74 inline CORE & core ()
const {
return _container->core(); };
79 mk_event_service(std::string
const & name,
typename EventServiceImpl<CORE>::action_t action);
83 mk_read_service(std::string
const & name,
typename ReadServiceImpl<CORE, T>::action_t action);
87 mk_write_service(std::string
const & name,
typename WriteServiceImpl<CORE, T>::action_t action);
89 template <
typename R,
typename ...P>
96 std::vector<Service *> services;
111 virtual const char*
what()
const throw() {
112 std::string message =
"Allready Defined Service " +
name;
113 return message.c_str();
120 #include "ipp/Interface.ipp" Definition: Interface.hpp:34
std::string name() const
Get the name.
Definition: Interface.hpp:46
const std::string name
Exception name.
Definition: Interface.hpp:109
Class of a Call service.
Definition: CallPort.hpp:27
Definition: ReadPort.hpp:27
AllreadyDefinedService(std::string const &name)
Constructor.
Definition: Interface.hpp:107
Abstract Interface class.
Definition: AbstractInterface.hpp:35
bool configure() overridefinal
Configure the object.
Definition: Interface.hpp:64
Objects with hooks.
Definition: WithHook.hpp:27
Object with a Logger.
Definition: WithLogger.hpp:27
Service * get_service(std::string const &name) const overridefinal
Get a service by name.
Definition: Interface.ipp:75
Class of a generic MAUVE logger.
Definition: logger.hpp:39
The MAUVE namespace.
Definition: tracing.hpp:24
std::function< R(CORE *, P...)> action_t
Service action type.
Definition: CallService.hpp:63
const std::vector< Service * > get_services() const overridefinal
Get the set of services owned by the interface.
Definition: Interface.ipp:66
Definition: Architecture.hpp:38
bool is_configured() const overridefinal
Get the configuration status of the configurable object.
Definition: Interface.hpp:62
void cleanup() overridefinal
Cleanup the object.
Definition: Interface.hpp:65
Definition: EventService.hpp:31
Definition: InterfaceContainer.hpp:30
A Service.
Definition: Service.hpp:30
Definition: WritePort.hpp:27
AbstractLogger & logger() const override
Get the logger.
Definition: Interface.hpp:60
virtual const char * what() const
Exception explanation.
Definition: Interface.hpp:111
Definition: CallService.hpp:29
Exception for Already Defined Services.
Definition: Interface.hpp:105