PortInT is the PIN class to get input data arriving to an object from other objects. More...
#include <InOut.hpp>
Public Member Functions | |
PortInT () | |
PortInT (const PortInT &other) | |
PortInT (O *obj_, void(O::*setVar_)(T), bool mandatory=false, int family=0) | |
PortInT (O *obj_, void(O::*setVar_)(T), DataType datatype, bool mandatory=false, int family=0) | |
PortInT (T *var_) | |
PortInT (T *var_, DataType datatype, bool mandatory=false, int family=0) | |
virtual | ~PortInT () |
bool | operator== (const PortInT &other) |
void | readBuffer () |
Public Member Functions inherited from mimmo::PortIn | |
PortIn () | |
PortIn (const PortIn &other) | |
virtual | ~PortIn () |
void | cleanBuffer () |
void | clear () |
void | clear (int j) |
DataType | getDataType () |
int | getFamily () |
std::vector< mimmo::BaseManipulation * > | getLink () |
bool | isMandatory () |
bool | operator== (const PortIn &other) |
Public Attributes | |
O * | m_obj_ |
void(O::* | m_setVar_ )(T) |
T * | m_var_ |
Public Attributes inherited from mimmo::PortIn | |
DataType | m_datatype |
int | m_familym |
mimmo::IBinaryStream | m_ibuffer |
bool | m_mandatory |
std::vector< BaseManipulation * > | m_objLink |
Detailed Description
template<typename T, typename O>
class mimmo::PortInT< T, O >
PortInT is the PIN class to get input data arriving to an object from other objects.
PortInT is the template derived class of PortIn specifying the set of data that need to exchanged.
PortIn stores the following members:
- pointer to the receiver object, owner of the PIN (m_obj)
- pointer to the type of receiver object variable, that will contain the data that need to be exchanged (m_var)
- pointer to a "set" method of the receiver object that will store the data that need to be exchanged (O::*m_setVar)
The last two members are alternative to each other, depending on the receiver object interface design. If receiver's m_var or set method are capable to handle with multiple inputs,all inputs passing through the ports will be stored in the receiver class, otherwise multiple data will be progressively overwritten each other, till the last, who will remain. Activation of the class will be automatically triggered by sender port PortOutT associated to it. See more in PortOut,PortOutT, PortIn documentation.
"Set" methods have to be function objects of the standard library (functional include) created by the bind method. The data value must be passed as argument of the function by copy or pointer.
Constructor & Destructor Documentation
◆ PortInT() [1/6]
mimmo::PortInT< T, O >::PortInT |
◆ PortInT() [2/6]
mimmo::PortInT< T, O >::PortInT | ( | T * | var_ | ) |
◆ PortInT() [3/6]
mimmo::PortInT< T, O >::PortInT | ( | T * | var_, |
DataType | datatype, | ||
bool | mandatory = false , |
||
int | family = 0 |
||
) |
◆ PortInT() [4/6]
mimmo::PortInT< T, O >::PortInT | ( | O * | obj_, |
void(O::*)(T) | setVar_, | ||
bool | mandatory = false , |
||
int | family = 0 |
||
) |
◆ PortInT() [5/6]
mimmo::PortInT< T, O >::PortInT | ( | O * | obj_, |
void(O::*)(T) | setVar_, | ||
DataType | datatype, | ||
bool | mandatory = false , |
||
int | family = 0 |
||
) |
Custom constructor of PortInT
- Parameters
-
[in] obj_ Pointer to object owner of the port. [in] setVar_ Pointer to function that sets members with the data in buffer. [in] datatype TAG of datat type communicated. [in] mandatory mandatory port? [in] family mandatory family tag.
◆ ~PortInT()
|
virtual |
◆ PortInT() [6/6]
mimmo::PortInT< T, O >::PortInT | ( | const PortInT< T, O > & | other | ) |
Member Function Documentation
◆ operator==()
bool mimmo::PortInT< T, O >::operator== | ( | const PortInT< T, O > & | other | ) |
◆ readBuffer()
|
virtual |
It reads the buffer of the output port with the data to be communicated. It stores the read values in the linked m_var_ by casting in the stream operator.
Implements mimmo::PortIn.
Member Data Documentation
◆ m_obj_
O* mimmo::PortInT< T, O >::m_obj_ |
◆ m_setVar_
void(O::* mimmo::PortInT< T, O >::m_setVar_) (T) |
◆ m_var_
T* mimmo::PortInT< T, O >::m_var_ |
The documentation for this class was generated from the following files: