Input port accepting data of type T. More...
#include <Dataflow/Core/PortIn.hpp>
Public Types | |
using | DataType = T |
![]() | |
using | Observer |
Observer functor type. | |
Public Member Functions | |
bool | has_data () override |
T & | data () |
Gets the data pointed by the connected out port. | |
void | set_default_value (const T &value) |
T & | default_value () |
bool | has_default_value () const override |
void | insert (Ra::Core::VariableSet &v) override |
bool | is_linked () const override |
template<typename B = T, std::enable_if_t< std::is_constructible< nlohmann::json, B >::value, bool > = true> | |
void | to_json_impl (nlohmann::json &data) |
template<typename B = T, std::enable_if_t<!std::is_constructible< nlohmann::json, B >::value, bool > = true> | |
void | to_json_impl (nlohmann::json &data) |
template<typename B = T, std::enable_if_t< std::is_assignable< nlohmann::json, B >::value, bool > = true> | |
void | from_json_impl (const nlohmann::json &data) |
template<typename B = T, std::enable_if_t<!std::is_assignable< nlohmann::json, B >::value, int > = true> | |
void | from_json_impl (const nlohmann::json &data) |
void | to_json (nlohmann::json &data) override |
void | from_json (const nlohmann::json &data) override |
Constructors | |
delete default constructors. | |
PortIn (const PortIn &)=delete | |
PortIn & | operator= (const PortIn &)=delete |
PortIn (Node *node, const std::string &name) | |
PortIn (Node *node, const std::string &name, const T &value) | |
Manage the connection with a PortOut. | |
bool | accept (PortBaseOut *portOut) const override |
bool | accept (PortOut< T > *portOut) const |
bool | connect (PortBaseOut *portOut) override |
bool | connect (PortOut< T > *portOut) |
bool | disconnect () override |
PortBaseOut * | link () override |
![]() | |
Observable ()=default | |
Default constructor ... do nothing ;) | |
Observable (const Observable &)=delete | |
Observable & | operator= (const Observable &)=delete |
void | copyObserversTo (Observable &other) const |
explicit copy of all attached observers the other Observable | |
int | attach (Observer observer) |
int | attachMember (T *object, void(T::*observer)(Args...)) |
void | notify (Args... p) const |
Notify (i.e. call) each attached observer with argument p . | |
void | detachAll () |
Detach all observers. | |
void | detach (int observerId) |
Input port accepting data of type T.
Forward PortIn classes used by getLink and reflect.
An input port does not staore the data but is an accessor to the data stored on the connected output port. An Input port is observable and notify its observers at each connect/disconnect event.
T | The accepted data type |
Definition at line 17 of file PortOut.hpp.
using Ra::Dataflow::Core::PortIn< T >::DataType = T |
Definition at line 74 of file PortIn.hpp.
|
inline |
Constructor.
node | The pointer to the node associated with the port. |
name | The name of the port. |
Definition at line 87 of file PortIn.hpp.
|
inline |
value | default value of the port |
Definition at line 92 of file PortIn.hpp.
|
override |
Definition at line 216 of file PortIn.hpp.
bool Ra::Dataflow::Core::PortIn< T >::accept | ( | PortOut< T > * | portOut | ) | const |
Definition at line 221 of file PortIn.hpp.
|
override |
Definition at line 226 of file PortIn.hpp.
bool Ra::Dataflow::Core::PortIn< T >::connect | ( | PortOut< T > * | portOut | ) |
Definition at line 237 of file PortIn.hpp.
T & Ra::Dataflow::Core::PortIn< T >::data | ( | ) |
Gets the data pointed by the connected out port.
It checks if the data is available. If it is not, it returns the default value. Fails if note link nor has a default value, check with has_data beforehand if needed.
Definition at line 200 of file PortIn.hpp.
|
inline |
Definition at line 125 of file PortIn.hpp.
|
override |
Definition at line 248 of file PortIn.hpp.
|
inlineoverridevirtual |
Reimplemented from Ra::Dataflow::Core::PortBase.
Definition at line 165 of file PortIn.hpp.
|
inline |
Definition at line 150 of file PortIn.hpp.
|
inline |
Definition at line 158 of file PortIn.hpp.
|
inlineoverridevirtual |
Returns true if the port is linked to an output port that has data or if it has a default value.
Implements Ra::Dataflow::Core::PortBase.
Definition at line 210 of file PortIn.hpp.
|
inlineoverride |
Definition at line 126 of file PortIn.hpp.
|
inlineoverride |
Definition at line 127 of file PortIn.hpp.
|
inlineoverride |
Definition at line 132 of file PortIn.hpp.
|
inlineoverride |
Definition at line 121 of file PortIn.hpp.
|
inline |
Definition at line 124 of file PortIn.hpp.
|
inlineoverridevirtual |
Reimplemented from Ra::Dataflow::Core::PortBase.
Definition at line 161 of file PortIn.hpp.
|
inline |
Definition at line 136 of file PortIn.hpp.
|
inline |
Definition at line 141 of file PortIn.hpp.