mimmo::PortOutT< T, O > Class Template Reference

PortOutT is the PIN class to exchange output data from an object to others. More...

#include <InOut.hpp>

Inheritance diagram for mimmo::PortOutT< T, O >:
Collaboration diagram for mimmo::PortOutT< T, O >:

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< PortIDgetPortLink ()
 
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< PortIDm_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.

Definition at line 155 of file InOut.hpp.

Constructor & Destructor Documentation

◆ PortOutT() [1/6]

template<typename T , typename O >
mimmo::PortOutT< T, O >::PortOutT

Default constructor of PortOutT

Definition at line 35 of file InOut.tpp.

◆ PortOutT() [2/6]

template<typename T , typename O >
mimmo::PortOutT< T, O >::PortOutT ( T *  var_)

Custom constructor of PortOutT

Parameters
[in]var_Pointer to variable to be streamed.

Definition at line 44 of file InOut.tpp.

◆ PortOutT() [3/6]

template<typename T , typename O >
mimmo::PortOutT< T, O >::PortOutT ( T *  var_,
DataType  datatype 
)

Custom constructor of PortOutT

Parameters
[in]var_Pointer to variable to be streamed.
[in]datatypeTAG of datat type communicated.

Definition at line 56 of file InOut.tpp.

◆ PortOutT() [4/6]

template<typename T , typename O >
mimmo::PortOutT< T, O >::PortOutT ( O *  obj_,
T(O::*)()  getVar_ 
)

Custom constructor of PortOutT

Parameters
[in]obj_Pointer to object owner of the port.
[in]getVar_Pointer to function that gets the data to be streamed.

Definition at line 69 of file InOut.tpp.

◆ PortOutT() [5/6]

template<typename T , typename O >
mimmo::PortOutT< T, O >::PortOutT ( O *  obj_,
T(O::*)()  getVar_,
DataType  datatype 
)

Custom constructor of PortOutT

Parameters
[in]obj_Pointer to object owner of the port.
[in]getVar_Pointer to function that gets the data to be streamed.
[in]datatypeTAG of datat type communicated.

Definition at line 82 of file InOut.tpp.

◆ ~PortOutT()

template<typename T , typename O >
mimmo::PortOutT< T, O >::~PortOutT
virtual

Default destructor of PortOutT

Definition at line 94 of file InOut.tpp.

◆ PortOutT() [6/6]

template<typename T , typename O >
mimmo::PortOutT< T, O >::PortOutT ( const PortOutT< T, O > &  other)

Copy constructor of PortOutT.

Definition at line 104 of file InOut.tpp.

Member Function Documentation

◆ operator==()

template<typename T , typename O >
bool mimmo::PortOutT< T, O >::operator== ( const PortOutT< T, O > &  other)

Compare operator of PortOutT.

Definition at line 114 of file InOut.tpp.

◆ writeBuffer()

template<typename T , typename O >
void mimmo::PortOutT< T, O >::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.

Definition at line 129 of file InOut.tpp.

Member Data Documentation

◆ m_getVar_

template<typename T , typename O >
T(O::* mimmo::PortOutT< T, O >::m_getVar_) ()

Pointer to function that recovers the data to communicate (alternative to linked variable).

Definition at line 161 of file InOut.hpp.

◆ m_obj_

template<typename T , typename O >
O* mimmo::PortOutT< T, O >::m_obj_

Object owner of the port.

Definition at line 159 of file InOut.hpp.

◆ m_var_

template<typename T , typename O >
T* mimmo::PortOutT< T, O >::m_var_

Linked variable to communicate.

Definition at line 160 of file InOut.hpp.


The documentation for this class was generated from the following files: