ug4
pcl::MultiLevelLayout< TInterface > Class Template Reference

the standard multi-level-layout implementation More...

#include <pcl_communication_structs.h>

Public Types

typedef layout_tags::multi_level_layout_tag category_tag
 Layout category. More...
 
typedef LevelLayout::const_iterator const_iterator
 
typedef Interface::Element Element
 Element type. More...
 
typedef TInterface Interface
 Interface type. More...
 
typedef LevelLayout::iterator iterator
 An iterator that allows to iterate over the interfaces stored in the layout. More...
 
typedef SingleLevelLayout< TInterface > LevelLayout
 on each level a single-level-layout is used More...
 
typedef Interface::Type Type
 Type. More...
 

Public Member Functions

iterator begin (size_t level)
 returns the iterator to the first interface of the layout in the given level. More...
 
const_iterator begin (size_t level) const
 
void clear ()
 deletes all levels. More...
 
bool empty () const
 returns true if the layout has no interfaces. More...
 
bool empty (size_t level)
 returns true if the layout has no interfaces on the given level. More...
 
bool empty (size_t level) const
 
iterator end (size_t level)
 returns the iterator to the last interface of the layout in the given level. More...
 
const_iterator end (size_t level) const
 
iterator erase (iterator iter, size_t level)
 erases the interface at the given iterator on the given level. More...
 
bool has_interface_elements () const
 returns true if the layout contains any interface entries More...
 
const Interfaceinterface (const_iterator iter) const
 
Interfaceinterface (int procID, size_t level)
 returns the interface to the given process. More...
 
const Interfaceinterface (int procID, size_t level) const
 
Interfaceinterface (iterator iter)
 returns the interface to the given iterator. More...
 
bool interface_exists (int procID)
 returns true if an interface to the given procID already exists. More...
 
bool interface_exists (int procID) const
 
bool interface_exists (int procID, size_t level)
 returns true if an interface to the given procID on the given level already exists. More...
 
bool interface_exists (int procID, size_t level) const
 
LevelLayoutlayout_on_level (int level)
 returns the layout at the given level. More...
 
const LevelLayoutlayout_on_level (int level) const
 
 MultiLevelLayout ()
 
 MultiLevelLayout (const MultiLevelLayout &mll)
 
size_t num_interface_elements () const
 returns the sum of the interface sizes More...
 
size_t num_interfaces (size_t level) const
 returns the number of interfaces in the layout More...
 
size_t num_levels () const
 returns the number of levels. More...
 
MultiLevelLayoutoperator= (const MultiLevelLayout &mll)
 
int proc_id (const_iterator iter) const
 returns the interface to the given iterator. More...
 
template<class TCompare >
void sort_interface_entries (TCompare cmp)
 sort the entries in all interfaces of this layout More...
 
 ~MultiLevelLayout ()
 

Protected Member Functions

void assign_layout (const MultiLevelLayout &mll)
 clears this layout and then copies all levels from the given layout More...
 
void new_levels (size_t num)
 adds num new levels. More...
 
void require_level (size_t level)
 if the required level doesn't exist yet, it will created. More...
 
void require_level (size_t level) const
 

Protected Attributes

std::vector< LevelLayout * > m_vLayouts
 

Detailed Description

template<class TInterface>
class pcl::MultiLevelLayout< TInterface >

the standard multi-level-layout implementation

A MultiLevelLayout is a collection of interfaces, which are grouped in different levels.

Each interface is associated with a process-id. If the localSrcID of this layout == -1 then, when a new level is created, it's local srcID is automatically initialized with the level index. localSrcIDs of interfaces created on those levels are then initialised with the level index, too.

If the localSrcID >= 0 it is simply passed on to the level-layouts.

This layout type supports the requirements of the pcl::layout_tags::multi_level_layout_tag category.

Additionally it features methods that allow to add new interfaces.

Member Typedef Documentation

◆ category_tag

template<class TInterface >
typedef layout_tags::multi_level_layout_tag pcl::MultiLevelLayout< TInterface >::category_tag

Layout category.

◆ const_iterator

template<class TInterface >
typedef LevelLayout::const_iterator pcl::MultiLevelLayout< TInterface >::const_iterator

◆ Element

template<class TInterface >
typedef Interface::Element pcl::MultiLevelLayout< TInterface >::Element

Element type.

◆ Interface

template<class TInterface >
typedef TInterface pcl::MultiLevelLayout< TInterface >::Interface

Interface type.

◆ iterator

template<class TInterface >
typedef LevelLayout::iterator pcl::MultiLevelLayout< TInterface >::iterator

An iterator that allows to iterate over the interfaces stored in the layout.

◆ LevelLayout

template<class TInterface >
typedef SingleLevelLayout<TInterface> pcl::MultiLevelLayout< TInterface >::LevelLayout

on each level a single-level-layout is used

◆ Type

template<class TInterface >
typedef Interface::Type pcl::MultiLevelLayout< TInterface >::Type

Type.

Constructor & Destructor Documentation

◆ MultiLevelLayout() [1/2]

template<class TInterface >
pcl::MultiLevelLayout< TInterface >::MultiLevelLayout ( )
inline

◆ MultiLevelLayout() [2/2]

template<class TInterface >
pcl::MultiLevelLayout< TInterface >::MultiLevelLayout ( const MultiLevelLayout< TInterface > &  mll)
inline

◆ ~MultiLevelLayout()

template<class TInterface >
pcl::MultiLevelLayout< TInterface >::~MultiLevelLayout ( )
inline

Member Function Documentation

◆ assign_layout()

template<class TInterface >
void pcl::MultiLevelLayout< TInterface >::assign_layout ( const MultiLevelLayout< TInterface > &  mll)
inlineprotected

◆ begin() [1/2]

template<class TInterface >
iterator pcl::MultiLevelLayout< TInterface >::begin ( size_t  level)
inline

returns the iterator to the first interface of the layout in the given level.

You should access the values of this iterator using the methods Layout::interface and Layout::proc_id. Make sure that the level matches the level in the associated end() call.

References pcl::MultiLevelLayout< TInterface >::m_vLayouts, and pcl::MultiLevelLayout< TInterface >::require_level().

Referenced by pcl::MultiLevelLayout< TInterface >::empty(), pcl::MultiLevelLayout< TInterface >::has_interface_elements(), pcl::MultiLevelLayout< TInterface >::num_interface_elements(), and pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::receive_raw().

◆ begin() [2/2]

template<class TInterface >
const_iterator pcl::MultiLevelLayout< TInterface >::begin ( size_t  level) const
inline

◆ clear()

template<class TInterface >
void pcl::MultiLevelLayout< TInterface >::clear ( )
inline

◆ empty() [1/3]

template<class TInterface >
bool pcl::MultiLevelLayout< TInterface >::empty ( ) const
inline

returns true if the layout has no interfaces.

Note that this method only tells whether there are interfaces or not. To check whether there are any elements use has_interface_elements.

References pcl::MultiLevelLayout< TInterface >::empty(), and pcl::MultiLevelLayout< TInterface >::num_levels().

Referenced by pcl::MultiLevelLayout< TInterface >::empty().

◆ empty() [2/3]

template<class TInterface >
bool pcl::MultiLevelLayout< TInterface >::empty ( size_t  level)
inline

returns true if the layout has no interfaces on the given level.

Note that this method only tells whether there are interfaces or not. To check whether there are any elements use has_interface_elements.

References pcl::MultiLevelLayout< TInterface >::begin(), and pcl::MultiLevelLayout< TInterface >::end().

◆ empty() [3/3]

template<class TInterface >
bool pcl::MultiLevelLayout< TInterface >::empty ( size_t  level) const
inline

◆ end() [1/2]

template<class TInterface >
iterator pcl::MultiLevelLayout< TInterface >::end ( size_t  level)
inline

returns the iterator to the last interface of the layout in the given level.

You should access the values of this iterator using the methods Layout::interface and Layout::proc_id. Make sure that the level matches the level in the associated begin() call.

References pcl::MultiLevelLayout< TInterface >::m_vLayouts, and pcl::MultiLevelLayout< TInterface >::require_level().

Referenced by pcl::MultiLevelLayout< TInterface >::empty(), pcl::MultiLevelLayout< TInterface >::has_interface_elements(), pcl::MultiLevelLayout< TInterface >::num_interface_elements(), and pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::receive_raw().

◆ end() [2/2]

template<class TInterface >
const_iterator pcl::MultiLevelLayout< TInterface >::end ( size_t  level) const
inline

◆ erase()

template<class TInterface >
iterator pcl::MultiLevelLayout< TInterface >::erase ( iterator  iter,
size_t  level 
)
inline

erases the interface at the given iterator on the given level.

returns an iterator to the next interface.

References pcl::MultiLevelLayout< TInterface >::m_vLayouts.

◆ has_interface_elements()

template<class TInterface >
bool pcl::MultiLevelLayout< TInterface >::has_interface_elements ( ) const
inline

◆ interface() [1/4]

template<class TInterface >
const Interface& pcl::MultiLevelLayout< TInterface >::interface ( const_iterator  iter) const
inline

◆ interface() [2/4]

template<class TInterface >
Interface& pcl::MultiLevelLayout< TInterface >::interface ( int  procID,
size_t  level 
)
inline

returns the interface to the given process.

if the interface doesn't exist yet, it will be created.

References pcl::MultiLevelLayout< TInterface >::m_vLayouts, and pcl::MultiLevelLayout< TInterface >::require_level().

◆ interface() [3/4]

template<class TInterface >
const Interface& pcl::MultiLevelLayout< TInterface >::interface ( int  procID,
size_t  level 
) const
inline

◆ interface() [4/4]

◆ interface_exists() [1/4]

template<class TInterface >
bool pcl::MultiLevelLayout< TInterface >::interface_exists ( int  procID)
inline

◆ interface_exists() [2/4]

◆ interface_exists() [3/4]

template<class TInterface >
bool pcl::MultiLevelLayout< TInterface >::interface_exists ( int  procID,
size_t  level 
)
inline

returns true if an interface to the given procID on the given level already exists.

References pcl::MultiLevelLayout< TInterface >::m_vLayouts, and pcl::MultiLevelLayout< TInterface >::require_level().

◆ interface_exists() [4/4]

template<class TInterface >
bool pcl::MultiLevelLayout< TInterface >::interface_exists ( int  procID,
size_t  level 
) const
inline

◆ layout_on_level() [1/2]

template<class TInterface >
LevelLayout& pcl::MultiLevelLayout< TInterface >::layout_on_level ( int  level)
inline

returns the layout at the given level.

If level >= num_levels() then the layouts in between will be automatically created.

References pcl::MultiLevelLayout< TInterface >::m_vLayouts, and pcl::MultiLevelLayout< TInterface >::require_level().

Referenced by pcl::MultiLevelLayout< TInterface >::sort_interface_entries(), and ug::TestGridLayoutMap().

◆ layout_on_level() [2/2]

template<class TInterface >
const LevelLayout& pcl::MultiLevelLayout< TInterface >::layout_on_level ( int  level) const
inline

◆ new_levels()

template<class TInterface >
void pcl::MultiLevelLayout< TInterface >::new_levels ( size_t  num)
inlineprotected

◆ num_interface_elements()

template<class TInterface >
size_t pcl::MultiLevelLayout< TInterface >::num_interface_elements ( ) const
inline

◆ num_interfaces()

template<class TInterface >
size_t pcl::MultiLevelLayout< TInterface >::num_interfaces ( size_t  level) const
inline

returns the number of interfaces in the layout

References pcl::MultiLevelLayout< TInterface >::m_vLayouts.

◆ num_levels()

◆ operator=()

template<class TInterface >
MultiLevelLayout& pcl::MultiLevelLayout< TInterface >::operator= ( const MultiLevelLayout< TInterface > &  mll)
inline

◆ proc_id()

template<class TInterface >
int pcl::MultiLevelLayout< TInterface >::proc_id ( const_iterator  iter) const
inline

returns the interface to the given iterator.

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

◆ require_level() [1/2]

◆ require_level() [2/2]

template<class TInterface >
void pcl::MultiLevelLayout< TInterface >::require_level ( size_t  level) const
inlineprotected

◆ sort_interface_entries()

template<class TInterface >
template<class TCompare >
void pcl::MultiLevelLayout< TInterface >::sort_interface_entries ( TCompare  cmp)
inline

Member Data Documentation

◆ m_vLayouts


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