Plugins
ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout > Class Template Reference

#include <memreduce.h>

+ Inheritance diagram for ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >:

Public Types

typedef TArray array_type
 
typedef base_type::Interface Interface
 
typedef base_type::Layout Layout
 
typedef array_type::value_type value_type
 
- Public Types inherited from pcl::ICommunicationPolicy< TLayout >
typedef Layout::Interface Interface
 
typedef TLayout Layout
 

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_MemCopy ()
 Default constructor. More...
 
 ComPol_MemCopy (TArray *pMemDst, const TArray *pMemSrc)
 Constructor setting the arrays. More...
 
 ComPol_MemCopy (TArray *pVec)
 Constructor setting the same arrays for the source and the destination. 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_dst (TArray *pMemDst)
 set the destination More...
 
void set_src (const TArray *pMem)
 set the source array More...
 
- Public Member Functions inherited from pcl::ICommunicationPolicy< TLayout >
virtual bool begin_layout_collection (const Layout *pLayout)
 
virtual bool begin_layout_extraction (const Layout *pLayout)
 
virtual void begin_level_extraction (int level)
 
virtual bool end_layout_collection (const Layout *pLayout)
 
virtual bool end_layout_extraction (const Layout *pLayout)
 
virtual ~ICommunicationPolicy ()
 

Private Types

typedef pcl::ICommunicationPolicy< TLayout > base_type
 
typedef ComPol_MemCopy< TArray, TLayout > this_type
 

Private Attributes

TArray * m_pMemDst
 
const TArray * m_pMemSrc
 

Detailed Description

template<typename TArray, typename TLayout>
class ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >

Communication policy for copying arrays represented by classes like std::vector or VariableArray1.

Template Parameters
TArraytype of the array class (e.g. std::vector)
TLayouttype of the parallel layout of the memory

Member Typedef Documentation

◆ array_type

template<typename TArray , typename TLayout >
typedef TArray ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::array_type

◆ base_type

template<typename TArray , typename TLayout >
typedef pcl::ICommunicationPolicy<TLayout> ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::base_type
private

◆ Interface

template<typename TArray , typename TLayout >
typedef base_type::Interface ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::Interface

◆ Layout

template<typename TArray , typename TLayout >
typedef base_type::Layout ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::Layout

◆ this_type

template<typename TArray , typename TLayout >
typedef ComPol_MemCopy<TArray, TLayout> ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::this_type
private

◆ value_type

template<typename TArray , typename TLayout >
typedef array_type::value_type ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::value_type

Constructor & Destructor Documentation

◆ ComPol_MemCopy() [1/3]

template<typename TArray , typename TLayout >
ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::ComPol_MemCopy ( )
inline

Default constructor.

◆ ComPol_MemCopy() [2/3]

template<typename TArray , typename TLayout >
ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::ComPol_MemCopy ( TArray *  pVec)
inline

Constructor setting the same arrays for the source and the destination.

◆ ComPol_MemCopy() [3/3]

template<typename TArray , typename TLayout >
ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::ComPol_MemCopy ( TArray *  pMemDst,
const TArray *  pMemSrc 
)
inline

Constructor setting the arrays.

Member Function Documentation

◆ collect()

template<typename TArray , typename TLayout >
virtual bool ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::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< TLayout >.

References ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::m_pMemSrc, and ug::Serialize().

◆ extract()

template<typename TArray , typename TLayout >
virtual bool ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::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< TLayout >.

References ug::Deserialize(), and ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::m_pMemDst.

◆ get_required_buffer_size()

template<typename TArray , typename TLayout >
virtual int ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::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< TLayout >.

◆ set_dst()

template<typename TArray , typename TLayout >
void ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::set_dst ( TArray *  pMemDst)
inline

◆ set_src()

template<typename TArray , typename TLayout >
void ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::set_src ( const TArray *  pMem)
inline

Member Data Documentation

◆ m_pMemDst

template<typename TArray , typename TLayout >
TArray* ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::m_pMemDst
private

◆ m_pMemSrc

template<typename TArray , typename TLayout >
const TArray* ug::Electromagnetism::ComPol_MemCopy< TArray, TLayout >::m_pMemSrc
private

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