PortOutT is the PIN class to exchange output data from an object to others. More...
#include <InOut.hpp>
Public Member Functions | |
PortOutT () | |
PortOutT (const PortOutT &other) | |
PortOutT (O *obj_, T(O::*getVar_)()) | |
PortOutT (O *obj_, T(O::*getVar_)(), DataType datatype) | |
PortOutT (T *var_) | |
PortOutT (T *var_, DataType datatype) | |
virtual | ~PortOutT () |
bool | operator== (const PortOutT &other) |
void | writeBuffer () |
Public Member Functions inherited from mimmo::PortOut | |
PortOut () | |
PortOut (const PortOut &other) | |
virtual | ~PortOut () |
void | cleanBuffer () |
void | clear () |
void | clear (int j) |
void | exec () |
DataType | getDataType () |
std::vector< BaseManipulation * > | getLink () |
std::vector< PortID > | getPortLink () |
bool | operator== (const PortOut &other) |
Public Attributes | |
T(O::* | m_getVar_ )() |
O * | m_obj_ |
T * | m_var_ |
Public Attributes inherited from mimmo::PortOut | |
DataType | m_datatype |
std::vector< BaseManipulation * > | m_objLink |
mimmo::OBinaryStream | m_obuffer |
std::vector< PortID > | m_portLink |
Detailed Description
template<typename T, typename O>
class mimmo::PortOutT< T, O >
PortOutT is the PIN class to exchange output data from an object to others.
PortOutT is the template derived class of PortOut specifying the set of data that need to exchanged.
PortOut stores the following members:
- pointer to the sender object, owner of the PIN (m_obj)
- pointer to the type of sender object variable containing the data that need to be exchanged (m_var)
- pointer to a "get" method of the sender object that recovers the data that need to be exchanged (O::*m_getVar)
The last two members are alternative to each other, depending on the sender object interface design. Once the data is recovered from its sender object, it is redistributed as in PortOut base class (see PortOut doc).
"Get" methods have to be function objects of the standard library (functional include) created by the bind method. The data value must be returned by this methods as a copy or pointer.
Constructor & Destructor Documentation
◆ PortOutT() [1/6]
mimmo::PortOutT< T, O >::PortOutT |
◆ PortOutT() [2/6]
mimmo::PortOutT< T, O >::PortOutT | ( | T * | var_ | ) |
◆ PortOutT() [3/6]
mimmo::PortOutT< T, O >::PortOutT | ( | T * | var_, |
DataType | datatype | ||
) |
◆ PortOutT() [4/6]
mimmo::PortOutT< T, O >::PortOutT | ( | O * | obj_, |
T(O::*)() | getVar_ | ||
) |
◆ PortOutT() [5/6]
mimmo::PortOutT< T, O >::PortOutT | ( | O * | obj_, |
T(O::*)() | getVar_, | ||
DataType | datatype | ||
) |
◆ ~PortOutT()
|
virtual |
◆ PortOutT() [6/6]
mimmo::PortOutT< T, O >::PortOutT | ( | const PortOutT< T, O > & | other | ) |
Member Function Documentation
◆ operator==()
bool mimmo::PortOutT< T, O >::operator== | ( | const PortOutT< T, O > & | other | ) |
◆ writeBuffer()
|
virtual |
It writes the buffer of the output port with the data to be communicated. It uses the linked get function if the member pointer m_getVar_ is not nullptr. Alternatively it uses m_var_ directly (if not nullptr).
Implements mimmo::PortOut.
Member Data Documentation
◆ m_getVar_
T(O::* mimmo::PortOutT< T, O >::m_getVar_) () |
◆ m_obj_
O* mimmo::PortOutT< T, O >::m_obj_ |
◆ m_var_
T* mimmo::PortOutT< T, O >::m_var_ |
The documentation for this class was generated from the following files: