ug4
ug::ComPol_VecCopy< TVector > Class Template Reference

Communication Policy to copy values of a vector. More...

#include <communication_policies.h>

+ Inheritance diagram for ug::ComPol_VecCopy< TVector >:

Public Member Functions

virtual bool collect (ug::BinaryBuffer &buff, const Interface &interface)
 writes the interface values into a buffer that will be sent More...
 
 ComPol_VecCopy ()
 Default constructor. More...
 
 ComPol_VecCopy (TVector *pVec)
 Constructor setting the vector. More...
 
 ComPol_VecCopy (TVector *pVecDest, const TVector *pVecSrc)
 Constructor setting the vector. More...
 
virtual bool extract (ug::BinaryBuffer &buff, const Interface &interface)
 writes values from a buffer into the interface More...
 
virtual int get_required_buffer_size (const Interface &interface)
 returns the buffer size More...
 
void set_vector (TVector *pVec)
 set the vector to work on More...
 
void set_vector (TVector *pVecDest, const TVector *pVecSrc)
 set the vector to work on More...
 
- Public Member Functions inherited from pcl::ICommunicationPolicy< IndexLayout >
virtual bool begin_layout_collection (const Layout *pLayout)
 signals the beginning of a layout collection. More...
 
virtual bool begin_layout_extraction (const Layout *pLayout)
 signals the beginning of a layout extraction. More...
 
virtual void begin_level_extraction (int level)
 signals that a new layout-level will now be processed. More...
 
virtual bool end_layout_collection (const Layout *pLayout)
 signals the end of a layout collection More...
 
virtual bool end_layout_extraction (const Layout *pLayout)
 signals the end of a layout extraction More...
 
virtual ~ICommunicationPolicy ()
 

Private Attributes

TVector * m_pVecDest
 
const TVector * m_pVecSrc
 

Additional Inherited Members

- Public Types inherited from pcl::ICommunicationPolicy< IndexLayout >
typedef Layout::Interface Interface
 
typedef IndexLayout Layout
 

Detailed Description

template<class TVector>
class ug::ComPol_VecCopy< TVector >

Communication Policy to copy values of a vector.

This class is used as a policy to copy values on the interfaces of a parallel vector. The collecting interfaces pack the values on the interface into a stream. The extracting interfaces receive the stream and overwrites the values of the vector with the sent data.

Template Parameters
TVectorVector type

Constructor & Destructor Documentation

◆ ComPol_VecCopy() [1/3]

template<class TVector >
ug::ComPol_VecCopy< TVector >::ComPol_VecCopy ( )
inline

Default constructor.

◆ ComPol_VecCopy() [2/3]

template<class TVector >
ug::ComPol_VecCopy< TVector >::ComPol_VecCopy ( TVector *  pVec)
inline

Constructor setting the vector.

◆ ComPol_VecCopy() [3/3]

template<class TVector >
ug::ComPol_VecCopy< TVector >::ComPol_VecCopy ( TVector *  pVecDest,
const TVector *  pVecSrc 
)
inline

Constructor setting the vector.

Member Function Documentation

◆ collect()

template<class TVector >
virtual bool ug::ComPol_VecCopy< TVector >::collect ( ug::BinaryBuffer buff,
const Interface interface 
)
inlinevirtual

writes the interface values into a buffer that will be sent

This function collects all entries of the vector into a buffer that are part of the interface.

Parameters
[out]buffBuffer
[in]interfaceInterface that will communicate

Implements pcl::ICommunicationPolicy< IndexLayout >.

References pcl::OrderedInterface< TType, TContainer, TAlloc >::begin(), pcl::OrderedInterface< TType, TContainer, TAlloc >::end(), pcl::OrderedInterface< TType, TContainer, TAlloc >::get_element(), ug::ComPol_VecCopy< TVector >::m_pVecSrc, PROFILE_BEGIN_GROUP, and ug::Serialize().

◆ extract()

template<class TVector >
virtual bool ug::ComPol_VecCopy< TVector >::extract ( ug::BinaryBuffer buff,
const Interface interface 
)
inlinevirtual

writes values from a buffer into the interface

This function writes the buffer values into the vector.

Parameters
[out]buffBuffer
[in]interfaceInterface that communicates

Implements pcl::ICommunicationPolicy< IndexLayout >.

References pcl::OrderedInterface< TType, TContainer, TAlloc >::begin(), ug::Deserialize(), pcl::OrderedInterface< TType, TContainer, TAlloc >::end(), pcl::OrderedInterface< TType, TContainer, TAlloc >::get_element(), ug::ComPol_VecCopy< TVector >::m_pVecDest, and PROFILE_BEGIN_GROUP.

◆ get_required_buffer_size()

template<class TVector >
virtual int ug::ComPol_VecCopy< TVector >::get_required_buffer_size ( const Interface interface)
inlinevirtual

returns the buffer size

This function returns the size of the buffer needed for the communication of passed interface. If the vector has fixed size entries this is just the number of interface entries times the size of the entry. In case of a variable size entry type a negative value is returned to indicate that no buffer size can be determined in advanced.

Parameters
[in]interfaceInterface that will communicate

Reimplemented from pcl::ICommunicationPolicy< IndexLayout >.

References pcl::OrderedInterface< TType, TContainer, TAlloc >::size().

◆ set_vector() [1/2]

template<class TVector >
void ug::ComPol_VecCopy< TVector >::set_vector ( TVector *  pVec)
inline

◆ set_vector() [2/2]

template<class TVector >
void ug::ComPol_VecCopy< TVector >::set_vector ( TVector *  pVecDest,
const TVector *  pVecSrc 
)
inline

Member Data Documentation

◆ m_pVecDest

template<class TVector >
TVector* ug::ComPol_VecCopy< TVector >::m_pVecDest
private

◆ m_pVecSrc

template<class TVector >
const TVector* ug::ComPol_VecCopy< TVector >::m_pVecSrc
private

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