18 #ifndef MAUVE_RUNTIME_HAS_PORT_HPP 19 #define MAUVE_RUNTIME_HAS_PORT_HPP 21 #include "Configurable.hpp" 38 template <
typename R,
typename ...P>
50 const std::vector<AbstractPort*>
get_ports()
const;
54 std::size_t get_ports_size()
const {
return ports.size(); }
69 template <
typename PORT,
typename ... PARAM>
70 PORT &
mk_port(std::string
const & name, PARAM ... parameters);
72 EventPort & mk_event_port(std::string
const & name);
75 ReadPort<T> & mk_read_port(std::string
const & name, T default_value);
80 template <
typename R,
typename ...P>
81 CallPort<R, P...> mk_call_port(std::string
const & name, R default_value);
84 std::vector<AbstractPort *> ports;
94 virtual const char*
what()
const throw() {
95 std::string message =
"Already Defined Port " + name;
96 return message.c_str();
103 #include "mauve/runtime/ipp/HasPort.ipp" const std::vector< AbstractPort * > get_ports() const
Get the ports of the shell.
const std::string name
Exception name.
Definition: HasPort.hpp:92
Definition: HasPort.hpp:33
virtual const char * what() const
Exception explanation.
Definition: HasPort.hpp:94
Definition: EventPort.hpp:28
Abstract Port class.
Definition: AbstractPort.hpp:35
Definition: HasPort.hpp:36
Definition: HasPort.hpp:41
The MAUVE namespace.
Definition: tracing.hpp:24
Configurable trait.
Definition: Configurable.hpp:25
PORT & mk_port(std::string const &name, PARAM...parameters)
Create a new port in this shell.
Definition: HasPort.ipp:30
Exception for Already Defined Ports.
Definition: HasPort.hpp:89
A Port to call a service.
Definition: CallPort.hpp:31