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

PortInT is the PIN class to get input data arriving to an object from other objects. More...

#include <InOut.hpp>

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

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.

Definition at line 264 of file InOut.hpp.

Constructor & Destructor Documentation

◆ PortInT() [1/6]

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

Default constructor of PortInT

Definition at line 146 of file InOut.tpp.

◆ PortInT() [2/6]

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

Custom constructor of PortInT

Parameters
[in]var_Pointer to variable to be streamed.

Definition at line 157 of file InOut.tpp.

◆ PortInT() [3/6]

template<typename T , typename O >
mimmo::PortInT< T, O >::PortInT ( T *  var_,
DataType  datatype,
bool  mandatory = false,
int  family = 0 
)

Custom constructor of PortInT

Parameters
[in]var_Pointer to variable to be streamed.
[in]datatypeTAG of datat type communicated.
[in]mandatorymandatory port?
[in]familymandatory family tag.

Definition at line 172 of file InOut.tpp.

◆ PortInT() [4/6]

template<typename T , typename O >
mimmo::PortInT< T, O >::PortInT ( O *  obj_,
void(O::*)(T)  setVar_,
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]mandatorymandatory port?
[in]familymandatory family tag.

Definition at line 189 of file InOut.tpp.

◆ PortInT() [5/6]

template<typename T , typename O >
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]datatypeTAG of datat type communicated.
[in]mandatorymandatory port?
[in]familymandatory family tag.

Definition at line 206 of file InOut.tpp.

◆ ~PortInT()

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

Default destructor of PortInT

Definition at line 219 of file InOut.tpp.

◆ PortInT() [6/6]

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

Copy constructor of PortInT.

Definition at line 229 of file InOut.tpp.

Member Function Documentation

◆ operator==()

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

Compare operator of PortInT.

Definition at line 239 of file InOut.tpp.

◆ readBuffer()

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

Definition at line 253 of file InOut.tpp.

Member Data Documentation

◆ m_obj_

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

Object owner of the port.

Definition at line 268 of file InOut.hpp.

◆ m_setVar_

template<typename T , typename O >
void(O::* mimmo::PortInT< T, O >::m_setVar_) (T)

Pointer to function that fills members with the communicated (alternative to linked variable).

Definition at line 270 of file InOut.hpp.

◆ m_var_

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

Linked variable to fill with communicated data.

Definition at line 269 of file InOut.hpp.


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