ug4
ug::CommunicationScheme< TDerived, bool > Class Template Reference

CRTP Base class for communications on layout/interfaces. More...

#include <communication_scheme.h>

+ Inheritance diagram for ug::CommunicationScheme< TDerived, bool >:

Public Member Functions

virtual bool collect (ug::BinaryBuffer &buff, const Interface &interface)
 should write data which is associated with the interface elements to the buffer. More...
 
TDerived & derived ()
 
virtual bool extract (ug::BinaryBuffer &buff, const Interface &interface)
 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...
 
- 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 ()
 

Additional Inherited Members

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

Detailed Description

template<typename TDerived>
class ug::CommunicationScheme< TDerived, bool >

CRTP Base class for communications on layout/interfaces.

Template Parameters
TDerivedDerived class Template specialization for bool values
See also
CommunicationScheme<TDerived, TValue>

Member Function Documentation

◆ collect()

◆ derived()

template<typename TDerived >
TDerived& ug::CommunicationScheme< TDerived, bool >::derived ( )
inline

◆ extract()

template<typename TDerived >
virtual bool ug::CommunicationScheme< TDerived, bool >::extract ( ug::BinaryBuffer buff,
const Interface interface 
)
inlinevirtual

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.

Implements pcl::ICommunicationPolicy< IndexLayout >.

References pcl::OrderedInterface< TType, TContainer, TAlloc >::begin(), ug::CommunicationScheme< TDerived, TValue >::derived(), ug::Deserialize(), pcl::OrderedInterface< TType, TContainer, TAlloc >::end(), pcl::OrderedInterface< TType, TContainer, TAlloc >::get_element(), and pcl::OrderedInterface< TType, TContainer, TAlloc >::get_target_proc().

◆ get_required_buffer_size()

template<typename TDerived >
virtual int ug::CommunicationScheme< TDerived, bool >::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 from pcl::ICommunicationPolicy< IndexLayout >.

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


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