ug4
pcl::ICommunicationPolicy< TLayout > Class Template Referenceabstract

specializations are responsible to pack and unpack interface data during communication. More...

#include <pcl_communication_structs.h>

+ Inheritance diagram for pcl::ICommunicationPolicy< TLayout >:

Public Types

typedef Layout::Interface Interface
 
typedef TLayout Layout
 

Public Member Functions

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 collect (ug::BinaryBuffer &buff, const Interface &interface)=0
 should write data which is associated with the interface elements to the buffer. 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 bool extract (ug::BinaryBuffer &buff, const Interface &interface)=0
 extract data from the buffer and assigns it to the interface-elements. More...
 
virtual int get_required_buffer_size (const Interface &interface)
 returns the size of the buffer in bytes, that will be required for interface-communication. More...
 
virtual ~ICommunicationPolicy ()
 

Detailed Description

template<class TLayout>
class pcl::ICommunicationPolicy< TLayout >

specializations are responsible to pack and unpack interface data during communication.

Make sure that you use the same communication-policy for send and receive operations. Otherwise problems regarding buffer-sizes may occur.

Member Typedef Documentation

◆ Interface

template<class TLayout >
typedef Layout::Interface pcl::ICommunicationPolicy< TLayout >::Interface

◆ Layout

template<class TLayout >
typedef TLayout pcl::ICommunicationPolicy< TLayout >::Layout

Constructor & Destructor Documentation

◆ ~ICommunicationPolicy()

template<class TLayout >
virtual pcl::ICommunicationPolicy< TLayout >::~ICommunicationPolicy ( )
inlinevirtual

Member Function Documentation

◆ begin_layout_collection()

template<class TLayout >
virtual bool pcl::ICommunicationPolicy< TLayout >::begin_layout_collection ( const Layout pLayout)
inlinevirtual

signals the beginning of a layout collection.

the default implementation returns true and does nothing else. This method is only called on processes which collect data.

Referenced by pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::receive_raw().

◆ begin_layout_extraction()

template<class TLayout >
virtual bool pcl::ICommunicationPolicy< TLayout >::begin_layout_extraction ( const Layout pLayout)
inlinevirtual

signals the beginning of a layout extraction.

the default implementation returns true and does nothing else. This method is only called on processes which extract data.

Reimplemented in ug::ComPol_InterfaceStatus< TLayout >, ug::ComPol_MatCopyRowsOverlap0< TMatrix >, ug::ComPol_MatAddRowsOverlap0< TMatrix >, and ug::ComPol_MatDistributeDiag< TAlgebra >.

Referenced by pcl::InterfaceCommunicator< TLayout >::extract_data().

◆ begin_level_extraction()

template<class TLayout >
virtual void pcl::ICommunicationPolicy< TLayout >::begin_level_extraction ( int  level)
inlinevirtual

signals that a new layout-level will now be processed.

This is primarily interesting for layout-extraction of multi-level-layouts. Before extract is called for the interfaces of one level of a layout, begin_level_extraction(level) is called. If single-level-layouts are processed, this method is called once with level = 0. This method is called after begin_layout_extraction and before the associated extract calls.

Reimplemented in ug::ComPol_InterfaceStatus< TLayout >.

Referenced by pcl::InterfaceCommunicator< TLayout >::extract_data().

◆ collect()

template<class TLayout >
virtual bool pcl::ICommunicationPolicy< TLayout >::collect ( ug::BinaryBuffer buff,
const Interface interface 
)
pure virtual

should write data which is associated with the interface elements to the buffer.

Implemented in ug::ComPol_GatherSurfaceStates< TLayout >, ug::ComPol_SynchronizeDistInfos< TLayout >, ug::ComPol_Subset< TLayout >, ug::ComPol_EnableSelectionStateBits< TLayout >, ug::ComPol_Selection< TLayout >, ug::ComPol_InterfaceStatus< TLayout >, ug::ComPol_GatherVecAttachment< TLayout, TAttachment >, ug::ComPol_CopyAttachment< TLayout, TAttachment >, ug::ComPol_BoolMarker_RemoveMarks< TLayout >, ug::ComPol_BoolMarker_AddMarks< TLayout >, ug::ComPol_BroadcastRefineMarks< TLayout >, ug::ComPol_BroadcastCoarsenMarks< TLayout >, ug::ComPol_AdjustType< TLayout >, ug::ComPol_NewConstrainedVerticals< TLayout >, ug::ComPol_CheckDistributedParentStates< TLayout >, ug::ComPol_MatCreateOverlap< TMatrix >, ug::ComPol_MatCopyDiag< TMatrix >, ug::CommunicationScheme< TDerived, bool >, ug::CommunicationScheme< TDerived, TValue >, ug::CommunicationScheme< StdArrayCommunicationScheme< TArray >, TArray::value_type >, ug::CommunicationScheme< ConsistencyCheckClass< TVec, TValue >, TValue >, ug::ComPol_MatAddSetZeroInnerInterfaceCouplings< TMatrix >, ug::ComPol_MatCopyRowsOverlap0< TMatrix >, ug::ComPol_MatAddRowsOverlap0< TMatrix >, ug::ComPol_MatDistributeDiag< TAlgebra >, ug::ComPol_VecSubtractOnlyOneSlave< TVector >, ug::ComPol_CheckConsistency< TVector >, ug::ComPol_VecSubtract< TVector >, ug::ComPol_VecAddSetZero< TVector >, ug::ComPol_VecScaleAdd< TVector >, ug::ComPol_VecAdd< TVector >, ug::ComPol_VecScaleCopy< TVector >, ug::ComPol_VecCopy< TVector >, and ug::ComPol_AttachmentReduce< TLayout, TAttachment >.

Referenced by pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::InterfaceCommunicator(), pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::receive_raw(), and pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::send_data().

◆ end_layout_collection()

template<class TLayout >
virtual bool pcl::ICommunicationPolicy< TLayout >::end_layout_collection ( const Layout pLayout)
inlinevirtual

signals the end of a layout collection

the default implementation returns true and does nothing else. This method is only called on processes which collect data.

◆ end_layout_extraction()

template<class TLayout >
virtual bool pcl::ICommunicationPolicy< TLayout >::end_layout_extraction ( const Layout pLayout)
inlinevirtual

signals the end of a layout extraction

the default implementation returns true and does nothing else. This method is only called on processes which extract data.

Referenced by pcl::InterfaceCommunicator< TLayout >::extract_data().

◆ extract()

template<class TLayout >
virtual bool pcl::ICommunicationPolicy< TLayout >::extract ( ug::BinaryBuffer buff,
const Interface interface 
)
pure virtual

extract data from the buffer and assigns it to the interface-elements.

If this method is called between calls to begin_layout_extraction and end_layout_extraction, the interface that is passed to this method belongs to the layout.

Implemented in ug::ComPol_GatherSurfaceStates< TLayout >, ug::ComPol_SynchronizeDistInfos< TLayout >, ug::ComPol_Subset< TLayout >, ug::ComPol_EnableSelectionStateBits< TLayout >, ug::ComPol_Selection< TLayout >, ug::ComPol_InterfaceStatus< TLayout >, ug::ComPol_GatherVecAttachment< TLayout, TAttachment >, ug::ComPol_CopyAttachment< TLayout, TAttachment >, ug::ComPol_BoolMarker_RemoveMarks< TLayout >, ug::ComPol_BoolMarker_AddMarks< TLayout >, ug::ComPol_BroadcastRefineMarks< TLayout >, ug::ComPol_BroadcastCoarsenMarks< TLayout >, ug::ComPol_AdjustType< TLayout >, ug::ComPol_NewConstrainedVerticals< TLayout >, ug::ComPol_CheckDistributedParentStates< TLayout >, ug::ComPol_MatCreateOverlap< TMatrix >, ug::ComPol_MatCopyDiag< TMatrix >, ug::CommunicationScheme< TDerived, bool >, ug::CommunicationScheme< TDerived, TValue >, ug::CommunicationScheme< StdArrayCommunicationScheme< TArray >, TArray::value_type >, ug::CommunicationScheme< ConsistencyCheckClass< TVec, TValue >, TValue >, ug::ComPol_MatAddSetZeroInnerInterfaceCouplings< TMatrix >, ug::ComPol_MatCopyRowsOverlap0< TMatrix >, ug::ComPol_MatAddRowsOverlap0< TMatrix >, ug::ComPol_MatDistributeDiag< TAlgebra >, ug::ComPol_VecSubtractOnlyOneSlave< TVector >, ug::ComPol_CheckConsistency< TVector >, ug::ComPol_VecSubtract< TVector >, ug::ComPol_VecAddSetZero< TVector >, ug::ComPol_VecScaleAdd< TVector >, ug::ComPol_VecAdd< TVector >, ug::ComPol_VecScaleCopy< TVector >, ug::ComPol_VecCopy< TVector >, and ug::ComPol_AttachmentReduce< TLayout, TAttachment >.

Referenced by pcl::InterfaceCommunicator< TLayout >::extract_data(), and pcl::InterfaceCommunicator< TLayout >::wait().

◆ get_required_buffer_size()

template<class TLayout >
virtual int pcl::ICommunicationPolicy< TLayout >::get_required_buffer_size ( const Interface interface)
inlinevirtual

returns the size of the buffer in bytes, that will be required for interface-communication.

Determines the size of the buffer on which the extract and receive methods for the given interface will operate. If the buffer-size can't be calculated on both sides (sender and receiver) this method should return -1. This will lead to an additional communication step in which buffer-sizes will be exchanged. If the buffer-size can be calculated on both sides, it makes sense to do so, since this leads to less communication and overall improved performance. The buffer-size has to exactly match the size of required memory. Make sure that you completely fill the buffer during collect(...) and that you read all data during extract(...). The default implementation returns -1.

Reimplemented in ug::ComPol_GatherSurfaceStates< TLayout >, ug::ComPol_Subset< TLayout >, ug::ComPol_EnableSelectionStateBits< TLayout >, ug::ComPol_Selection< TLayout >, ug::ComPol_InterfaceStatus< TLayout >, ug::ComPol_BoolMarker_RemoveMarks< TLayout >, ug::ComPol_BoolMarker_AddMarks< TLayout >, ug::ComPol_BroadcastRefineMarks< TLayout >, ug::ComPol_BroadcastCoarsenMarks< TLayout >, ug::ComPol_AdjustType< TLayout >, ug::ComPol_SynchronizeDistInfos< TLayout >, ug::ComPol_NewConstrainedVerticals< TLayout >, ug::ComPol_CheckDistributedParentStates< TLayout >, ug::ComPol_MatCopyDiag< TMatrix >, ug::CommunicationScheme< TDerived, bool >, ug::CommunicationScheme< TDerived, TValue >, ug::CommunicationScheme< StdArrayCommunicationScheme< TArray >, TArray::value_type >, ug::CommunicationScheme< ConsistencyCheckClass< TVec, TValue >, TValue >, ug::ComPol_MatDistributeDiag< TAlgebra >, ug::ComPol_VecSubtractOnlyOneSlave< TVector >, ug::ComPol_CheckConsistency< TVector >, ug::ComPol_VecSubtract< TVector >, ug::ComPol_VecAddSetZero< TVector >, ug::ComPol_VecScaleAdd< TVector >, ug::ComPol_VecAdd< TVector >, ug::ComPol_VecScaleCopy< TVector >, and ug::ComPol_VecCopy< TVector >.

Referenced by pcl::InterfaceCommunicator< TLayout >::communicate_and_resume(), pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::extract_data(), pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::InterfaceCommunicator(), pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::prepare_receiver_buffer_map(), and pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::send_data().


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