PLaSK library
Loading...
Searching...
No Matches
plask::WithAligners< ParentType, ChildAlignerType > Struct Template Reference

Template of base class for containers which have aligners, one per child. More...

#include <plask/geometry/container.hpp>

Inheritance diagram for plask::WithAligners< ParentType, ChildAlignerType >:
[legend]
Collaboration diagram for plask::WithAligners< ParentType, ChildAlignerType >:
[legend]

Public Types

typedef ChildAlignerType ChildAligner
 
typedef ParentType::TranslationT TranslationT
 

Public Member Functions

template<typename... Args>
 WithAligners (Args &&... args)
 Delegate all constructors to parent class.
 
void onChildChanged (const GeometryObject::Event &evt) override
 Called by child.change signal.
 
bool removeIfTUnsafe (const std::function< bool(const shared_ptr< TranslationT > &c)> &predicate) override
 
void removeAtUnsafe (std::size_t index) override
 
void writeXMLChildAttr (XMLWriter::Element &dest_xml_child_tag, std::size_t child_index, const AxisNames &axes) const override
 
void move (std::size_t index, ChildAligner aligner)
 Set new aligner for child at given index.
 
void move (shared_ptr< const TranslationT > child, ChildAligner aligner)
 Set new aligner for given child.
 
void move (const TranslationT &child, ChildAligner aligner)
 Set new aligner for given child.
 
const std::vector< ChildAligner > & getAligners () const
 Get const reference to aligners.
 

Protected Member Functions

PathHints::Hint _insertUnsafe (const std::size_t pos, shared_ptr< TranslationT > to_insert, ChildAligner aligner)
 Do everything, but align to_insert by aligner.
 
PathHints::Hint _insert (const std::size_t pos, shared_ptr< TranslationT > to_insert, ChildAligner aligner)
 
PathHints::Hint _addUnsafe (shared_ptr< TranslationT > to_add, ChildAligner aligner)
 
ChildAligner getAlignerFor (shared_ptr< const TranslationT > child)
 
ChildAligner getAlignerFor (TranslationT &child)
 
void align (shared_ptr< TranslationT > child)
 
void align (TranslationT *child)
 
void align (TranslationT &child)
 

Protected Attributes

std::vector< ChildAligneraligners
 

Detailed Description

template<typename ParentType, typename ChildAlignerType>
struct plask::WithAligners< ParentType, ChildAlignerType >

Template of base class for containers which have aligners, one per child.

It define proper remove methods and some, protected, helpers.

Template Parameters
ParentTypecontainer type to inherit from
ChildAlignerTypealigner type

Definition at line 361 of file container.hpp.

Member Typedef Documentation

◆ ChildAligner

template<typename ParentType , typename ChildAlignerType >
typedef ChildAlignerType plask::WithAligners< ParentType, ChildAlignerType >::ChildAligner

Definition at line 362 of file container.hpp.

◆ TranslationT

template<typename ParentType , typename ChildAlignerType >
typedef ParentType::TranslationT plask::WithAligners< ParentType, ChildAlignerType >::TranslationT

Definition at line 363 of file container.hpp.

Constructor & Destructor Documentation

◆ WithAligners()

template<typename ParentType , typename ChildAlignerType >
template<typename... Args>
plask::WithAligners< ParentType, ChildAlignerType >::WithAligners ( Args &&...  args)
inline

Delegate all constructors to parent class.

Definition at line 422 of file container.hpp.

Member Function Documentation

◆ _addUnsafe()

template<typename ParentType , typename ChildAlignerType >
PathHints::Hint plask::WithAligners< ParentType, ChildAlignerType >::_addUnsafe ( shared_ptr< TranslationT to_add,
ChildAligner  aligner 
)
inlineprotected

Definition at line 385 of file container.hpp.

◆ _insert()

template<typename ParentType , typename ChildAlignerType >
PathHints::Hint plask::WithAligners< ParentType, ChildAlignerType >::_insert ( const std::size_t  pos,
shared_ptr< TranslationT to_insert,
ChildAligner  aligner 
)
inlineprotected

Definition at line 380 of file container.hpp.

◆ _insertUnsafe()

template<typename ParentType , typename ChildAlignerType >
PathHints::Hint plask::WithAligners< ParentType, ChildAlignerType >::_insertUnsafe ( const std::size_t  pos,
shared_ptr< TranslationT to_insert,
ChildAligner  aligner 
)
inlineprotected

Do everything, but align to_insert by aligner.

Definition at line 371 of file container.hpp.

◆ align() [1/3]

template<typename ParentType , typename ChildAlignerType >
void plask::WithAligners< ParentType, ChildAlignerType >::align ( shared_ptr< TranslationT child)
inlineprotected

Definition at line 410 of file container.hpp.

◆ align() [2/3]

template<typename ParentType , typename ChildAlignerType >
void plask::WithAligners< ParentType, ChildAlignerType >::align ( TranslationT child)
inlineprotected

Definition at line 417 of file container.hpp.

◆ align() [3/3]

template<typename ParentType , typename ChildAlignerType >
void plask::WithAligners< ParentType, ChildAlignerType >::align ( TranslationT child)
inlineprotected

Definition at line 415 of file container.hpp.

◆ getAlignerFor() [1/2]

template<typename ParentType , typename ChildAlignerType >
ChildAligner plask::WithAligners< ParentType, ChildAlignerType >::getAlignerFor ( shared_ptr< const TranslationT child)
inlineprotected

Definition at line 399 of file container.hpp.

◆ getAlignerFor() [2/2]

template<typename ParentType , typename ChildAlignerType >
ChildAligner plask::WithAligners< ParentType, ChildAlignerType >::getAlignerFor ( TranslationT child)
inlineprotected

Definition at line 404 of file container.hpp.

◆ getAligners()

template<typename ParentType , typename ChildAlignerType >
const std::vector< ChildAligner > & plask::WithAligners< ParentType, ChildAlignerType >::getAligners ( ) const
inline

Get const reference to aligners.

Definition at line 495 of file container.hpp.

◆ move() [1/3]

template<typename ParentType , typename ChildAlignerType >
void plask::WithAligners< ParentType, ChildAlignerType >::move ( const TranslationT child,
ChildAligner  aligner 
)
inline

Set new aligner for given child.

Parameters
childchild to move
alignernew position for given child

Definition at line 488 of file container.hpp.

◆ move() [2/3]

template<typename ParentType , typename ChildAlignerType >
void plask::WithAligners< ParentType, ChildAlignerType >::move ( shared_ptr< const TranslationT child,
ChildAligner  aligner 
)
inline

Set new aligner for given child.

Parameters
childchild to move
alignernew position for given child

Definition at line 478 of file container.hpp.

◆ move() [3/3]

template<typename ParentType , typename ChildAlignerType >
void plask::WithAligners< ParentType, ChildAlignerType >::move ( std::size_t  index,
ChildAligner  aligner 
)
inline

Set new aligner for child at given index.

Parameters
indexindex of child to move
alignernew position for child at given index

Definition at line 466 of file container.hpp.

◆ onChildChanged()

template<typename ParentType , typename ChildAlignerType >
void plask::WithAligners< ParentType, ChildAlignerType >::onChildChanged ( const GeometryObject::Event evt)
inlineoverride

Called by child.change signal.

Definition at line 425 of file container.hpp.

◆ removeAtUnsafe()

template<typename ParentType , typename ChildAlignerType >
void plask::WithAligners< ParentType, ChildAlignerType >::removeAtUnsafe ( std::size_t  index)
inlineoverride

Definition at line 450 of file container.hpp.

◆ removeIfTUnsafe()

template<typename ParentType , typename ChildAlignerType >
bool plask::WithAligners< ParentType, ChildAlignerType >::removeIfTUnsafe ( const std::function< bool(const shared_ptr< TranslationT > &c)> &  predicate)
inlineoverride

Definition at line 430 of file container.hpp.

◆ writeXMLChildAttr()

template<typename ParentType , typename ChildAlignerType >
void plask::WithAligners< ParentType, ChildAlignerType >::writeXMLChildAttr ( XMLWriter::Element dest_xml_child_tag,
std::size_t  child_index,
const AxisNames axes 
) const
inlineoverride

Definition at line 455 of file container.hpp.

Member Data Documentation

◆ aligners

template<typename ParentType , typename ChildAlignerType >
std::vector<ChildAligner> plask::WithAligners< ParentType, ChildAlignerType >::aligners
protected

Definition at line 368 of file container.hpp.


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