ug4
|
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 Interface & | interface (const_iterator iter) const |
Interface & | interface (int procID, size_t level) |
returns the interface to the given process. More... | |
const Interface & | interface (int procID, size_t level) const |
Interface & | interface (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 |
LevelLayout & | layout_on_level (int level) |
returns the layout at the given level. More... | |
const LevelLayout & | layout_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... | |
MultiLevelLayout & | operator= (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 |
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.
typedef layout_tags::multi_level_layout_tag pcl::MultiLevelLayout< TInterface >::category_tag |
Layout category.
typedef LevelLayout::const_iterator pcl::MultiLevelLayout< TInterface >::const_iterator |
typedef Interface::Element pcl::MultiLevelLayout< TInterface >::Element |
Element type.
typedef TInterface pcl::MultiLevelLayout< TInterface >::Interface |
Interface type.
typedef LevelLayout::iterator pcl::MultiLevelLayout< TInterface >::iterator |
An iterator that allows to iterate over the interfaces stored in the layout.
typedef SingleLevelLayout<TInterface> pcl::MultiLevelLayout< TInterface >::LevelLayout |
on each level a single-level-layout is used
typedef Interface::Type pcl::MultiLevelLayout< TInterface >::Type |
Type.
|
inline |
|
inline |
|
inline |
References pcl::MultiLevelLayout< TInterface >::clear().
|
inlineprotected |
clears this layout and then copies all levels from the given layout
References pcl::MultiLevelLayout< TInterface >::clear(), and pcl::MultiLevelLayout< TInterface >::m_vLayouts.
Referenced by pcl::MultiLevelLayout< TInterface >::MultiLevelLayout(), and pcl::MultiLevelLayout< TInterface >::operator=().
|
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().
|
inline |
|
inline |
deletes all levels.
References pcl::MultiLevelLayout< TInterface >::m_vLayouts.
Referenced by pcl::MultiLevelLayout< TInterface >::assign_layout(), and pcl::MultiLevelLayout< TInterface >::~MultiLevelLayout().
|
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().
|
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().
|
inline |
|
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().
|
inline |
|
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.
|
inline |
returns true if the layout contains any interface entries
References pcl::MultiLevelLayout< TInterface >::begin(), pcl::MultiLevelLayout< TInterface >::end(), pcl::MultiLevelLayout< TInterface >::interface(), and pcl::MultiLevelLayout< TInterface >::num_levels().
|
inline |
|
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().
|
inline |
|
inline |
returns the interface to the given iterator.
Referenced by pcl::MultiLevelLayout< TInterface >::has_interface_elements(), pcl::MultiLevelLayout< TInterface >::num_interface_elements(), and pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::receive_raw().
|
inline |
returns true if an interface to the given procID already exists.
References pcl::MultiLevelLayout< TInterface >::interface_exists(), pcl::MultiLevelLayout< TInterface >::m_vLayouts, and pcl::MultiLevelLayout< TInterface >::num_levels().
Referenced by pcl::MultiLevelLayout< TInterface >::interface_exists().
|
inline |
|
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().
|
inline |
|
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().
|
inline |
|
inlineprotected |
adds num new levels.
References pcl::MultiLevelLayout< TInterface >::m_vLayouts.
Referenced by pcl::MultiLevelLayout< TInterface >::require_level().
|
inline |
returns the sum of the interface sizes
References pcl::MultiLevelLayout< TInterface >::begin(), pcl::MultiLevelLayout< TInterface >::end(), pcl::MultiLevelLayout< TInterface >::interface(), and pcl::MultiLevelLayout< TInterface >::num_levels().
|
inline |
returns the number of interfaces in the layout
References pcl::MultiLevelLayout< TInterface >::m_vLayouts.
|
inline |
returns the number of levels.
References pcl::MultiLevelLayout< TInterface >::m_vLayouts.
Referenced by pcl::MultiLevelLayout< TInterface >::empty(), pcl::MultiLevelLayout< TInterface >::has_interface_elements(), pcl::MultiLevelLayout< TInterface >::interface_exists(), pcl::MultiLevelLayout< TInterface >::num_interface_elements(), pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::receive_raw(), pcl::MultiLevelLayout< TInterface >::require_level(), pcl::MultiLevelLayout< TInterface >::sort_interface_entries(), and ug::TestGridLayoutMap().
|
inline |
|
inline |
returns the interface to the given iterator.
Referenced by pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::receive_raw().
|
inlineprotected |
if the required level doesn't exist yet, it will created.
References pcl::MultiLevelLayout< TInterface >::new_levels(), and pcl::MultiLevelLayout< TInterface >::num_levels().
Referenced by pcl::MultiLevelLayout< TInterface >::begin(), pcl::MultiLevelLayout< TInterface >::end(), pcl::MultiLevelLayout< TInterface >::interface(), pcl::MultiLevelLayout< TInterface >::interface_exists(), and pcl::MultiLevelLayout< TInterface >::layout_on_level().
|
inlineprotected |
References pcl::MultiLevelLayout< TInterface >::num_levels(), and UG_THROW.
|
inline |
sort the entries in all interfaces of this layout
References pcl::MultiLevelLayout< TInterface >::layout_on_level(), pcl::MultiLevelLayout< TInterface >::num_levels(), and pcl::SingleLevelLayout< TInterface >::sort_interface_entries().
|
protected |
Referenced by pcl::MultiLevelLayout< TInterface >::assign_layout(), pcl::MultiLevelLayout< TInterface >::begin(), pcl::MultiLevelLayout< TInterface >::clear(), pcl::MultiLevelLayout< TInterface >::end(), pcl::MultiLevelLayout< TInterface >::erase(), pcl::MultiLevelLayout< TInterface >::interface(), pcl::MultiLevelLayout< TInterface >::interface_exists(), pcl::MultiLevelLayout< TInterface >::layout_on_level(), pcl::MultiLevelLayout< TInterface >::new_levels(), pcl::MultiLevelLayout< TInterface >::num_interfaces(), and pcl::MultiLevelLayout< TInterface >::num_levels().