ug4
|
A linked list of elements living in an attachment. More...
#include <attached_list.h>
Classes | |
struct | Entry |
Public Types | |
typedef AttachmentAccessor< element, AEntry, ElemHandler > | AAEntry |
typedef Attachment< Entry > | AEntry |
typedef ConstAttachedElementListIterator< AAEntry > | const_iterator |
typedef TAttachmentPipe::element | element |
typedef TAttachmentPipe::ElementHandler | ElemHandler |
typedef AttachedElementListIterator< AAEntry > | iterator |
Public Member Functions | |
AttachedElementList (AEntry aEntry) | |
Note that auto-copy on aEntry has to be disabled. More... | |
AttachedElementList (const AttachedElementList &ael) | |
AttachedElementList (TAttachmentPipe *pipe, AEntry aEntry) | |
Note that auto-copy on aEntry has to be disabled. More... | |
AttachedElementList (TAttachmentPipe *pipe=NULL) | |
element | back () |
returns the last element in the list More... | |
const element | back () const |
returns the last element in the list (const) More... | |
iterator | begin () |
returns an iterator to the beginning of the sequence. More... | |
const_iterator | begin () const |
returns an iterator to the beginning of the sequence. More... | |
void | clear () |
clears the list. begin() == end() afterwards. More... | |
bool | empty () const |
retunrs true if the list is empty More... | |
iterator | end () |
returns an iterator to the end of the sequence. More... | |
const_iterator | end () const |
returns an iterator to the end of the sequence. More... | |
iterator | erase (iterator begin, iterator end) |
erases a sequence of entries More... | |
iterator | erase (iterator position) |
erases the element at the given position More... | |
element | front () |
returns the first element in the list More... | |
const element | front () const |
returns the first element in the list (const) More... | |
iterator | get_iterator (const element &elem) |
returns the iterator to the given element More... | |
element const * | get_pointer_to_element (const element &elem) |
returns a const pointer to an element. More... | |
iterator | insert (iterator position, const element &elem) |
inserts an element right before the specified position. More... | |
bool | is_in_list (const element &elem) |
returns true if the element is in the list More... | |
const AttachedElementList & | operator= (const AttachedElementList &ael) |
void | push_back (const element &elem) |
pushes an element to the end of the list More... | |
void | set_pipe (TAttachmentPipe *pipe) |
set the attachment pipe on which the list shall operate More... | |
void | set_pipe (TAttachmentPipe *pipe, AEntry aEntry) |
Sets the pipe and a shared entry-attachment on which the list will operate. More... | |
~AttachedElementList () | |
Private Attributes | |
AAEntry | m_aaEntry |
AEntry | m_aEntry |
element | m_back |
bool | m_bSharedAttachment |
element | m_front |
TAttachmentPipe * | m_pipe |
A linked list of elements living in an attachment.
This is a highly specialized linked list mainly (only!) used in the Grid, SubsetHandler, Selector, ... classes to maintain a list of GridObjects.
Only elements registered at the underlying attachment pipe may be added to the list. Note that each element may only be added once.
Make sure that the attachment pipe on which the list operates exists at least as long as the list itself, or call set_pipe(NULL), if the pipe is erased before.
This list assumes that TAttachmentPipe::element is a pointer type.
Note that instances of this class are never lightweight, since memory for a potentially full list is allocated in the attachment pipe.
If the list operates on a shared attachment, the one who created the attachment is responsible for releasing it.
typedef AttachmentAccessor<element, AEntry, ElemHandler> ug::AttachedElementList< TAttachmentPipe >::AAEntry |
typedef Attachment<Entry> ug::AttachedElementList< TAttachmentPipe >::AEntry |
typedef ConstAttachedElementListIterator<AAEntry> ug::AttachedElementList< TAttachmentPipe >::const_iterator |
typedef TAttachmentPipe::element ug::AttachedElementList< TAttachmentPipe >::element |
typedef TAttachmentPipe::ElementHandler ug::AttachedElementList< TAttachmentPipe >::ElemHandler |
typedef AttachedElementListIterator<AAEntry> ug::AttachedElementList< TAttachmentPipe >::iterator |
|
inline |
|
inline |
Note that auto-copy on aEntry has to be disabled.
|
inline |
Note that auto-copy on aEntry has to be disabled.
References ug::AttachedElementList< TAttachmentPipe >::set_pipe().
|
inline |
References ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, ug::AttachedElementList< TAttachmentPipe >::m_aEntry, ug::AttachedElementList< TAttachmentPipe >::m_bSharedAttachment, ug::AttachedElementList< TAttachmentPipe >::m_front, ug::AttachedElementList< TAttachmentPipe >::m_pipe, ug::AttachedElementList< TAttachmentPipe >::push_back(), and ug::AttachedElementList< TAttachmentPipe >::set_pipe().
|
inline |
|
inline |
returns the last element in the list
References ug::AttachedElementList< TAttachmentPipe >::m_back.
|
inline |
returns the last element in the list (const)
References ug::AttachedElementList< TAttachmentPipe >::m_back.
|
inline |
returns an iterator to the beginning of the sequence.
References ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, and ug::AttachedElementList< TAttachmentPipe >::m_front.
Referenced by ug::AttachedElementList< TAttachmentPipe >::clear(), and ug::AttachedElementList< TAttachmentPipe >::erase().
|
inline |
returns an iterator to the beginning of the sequence.
References ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, and ug::AttachedElementList< TAttachmentPipe >::m_front.
|
inline |
clears the list. begin() == end() afterwards.
References ug::AttachedElementList< TAttachmentPipe >::begin(), ug::AttachedElementList< TAttachmentPipe >::end(), ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, ug::AttachedElementList< TAttachmentPipe >::m_back, ug::AttachedElementList< TAttachmentPipe >::m_front, and ug::AttachedElementList< TAttachmentPipe >::m_pipe.
Referenced by ug::AttachedElementList< TAttachmentPipe >::operator=().
|
inline |
retunrs true if the list is empty
References ug::AttachedElementList< TAttachmentPipe >::m_front.
Referenced by ug::AttachedElementList< TAttachmentPipe >::insert(), and ug::AttachedElementList< TAttachmentPipe >::push_back().
|
inline |
returns an iterator to the end of the sequence.
Note that this is the iterator to the element behind the last one.
References ug::AttachedElementList< TAttachmentPipe >::m_aaEntry.
Referenced by ug::AttachedElementList< TAttachmentPipe >::clear(), and ug::AttachedElementList< TAttachmentPipe >::erase().
|
inline |
returns an iterator to the end of the sequence.
Note that this is the iterator to the element behind the last one.
References ug::AttachedElementList< TAttachmentPipe >::m_aaEntry.
|
inline |
erases a sequence of entries
References ug::AttachedElementList< TAttachmentPipe >::begin(), ug::AttachedElementList< TAttachmentPipe >::end(), and ug::AttachedElementList< TAttachmentPipe >::erase().
|
inline |
erases the element at the given position
returns an iterator to the element directly behind position.
References ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, ug::AttachedElementList< TAttachmentPipe >::m_back, ug::AttachedElementList< TAttachmentPipe >::m_front, ug::AttachedElementList< TAttachmentPipe >::Entry::next, and ug::AttachedElementList< TAttachmentPipe >::Entry::prev.
Referenced by ug::AttachedElementList< TAttachmentPipe >::erase().
|
inline |
returns the first element in the list
References ug::AttachedElementList< TAttachmentPipe >::m_front.
|
inline |
returns the first element in the list (const)
References ug::AttachedElementList< TAttachmentPipe >::m_front.
|
inline |
returns the iterator to the given element
Note that the return value is undefined if element is not a member of the list!
References ug::AttachedElementList< TAttachmentPipe >::m_aaEntry.
Referenced by ug::AttachedElementList< TAttachmentPipe >::insert().
|
inline |
returns a const pointer to an element.
This pointer is valid until the content of the list is changed.
References ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, and ug::AttachedElementList< TAttachmentPipe >::m_front.
|
inline |
inserts an element right before the specified position.
returns the iterator of the newly inserted element.
References ug::AttachedElementList< TAttachmentPipe >::empty(), ug::AttachedElementList< TAttachmentPipe >::get_iterator(), ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, ug::AttachedElementList< TAttachmentPipe >::m_front, ug::AttachedElementList< TAttachmentPipe >::Entry::prev, and ug::AttachedElementList< TAttachmentPipe >::push_back().
|
inline |
returns true if the element is in the list
References ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, and ug::AttachedElementList< TAttachmentPipe >::m_front.
|
inline |
References ug::AttachedElementList< TAttachmentPipe >::clear(), ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, ug::AttachedElementList< TAttachmentPipe >::m_aEntry, ug::AttachedElementList< TAttachmentPipe >::m_bSharedAttachment, ug::AttachedElementList< TAttachmentPipe >::m_front, ug::AttachedElementList< TAttachmentPipe >::m_pipe, ug::AttachedElementList< TAttachmentPipe >::push_back(), and ug::AttachedElementList< TAttachmentPipe >::set_pipe().
|
inline |
pushes an element to the end of the list
References ug::AttachedElementList< TAttachmentPipe >::empty(), ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, ug::AttachedElementList< TAttachmentPipe >::m_back, and ug::AttachedElementList< TAttachmentPipe >::m_front.
Referenced by ug::AttachedElementList< TAttachmentPipe >::AttachedElementList(), ug::AttachedElementList< TAttachmentPipe >::insert(), and ug::AttachedElementList< TAttachmentPipe >::operator=().
|
inline |
set the attachment pipe on which the list shall operate
References ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::access(), ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::invalidate(), ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, ug::AttachedElementList< TAttachmentPipe >::m_aEntry, ug::AttachedElementList< TAttachmentPipe >::m_back, ug::AttachedElementList< TAttachmentPipe >::m_bSharedAttachment, ug::AttachedElementList< TAttachmentPipe >::m_front, and ug::AttachedElementList< TAttachmentPipe >::m_pipe.
Referenced by ug::MGSelector::add_level(), ug::GridSubsetHandler::add_required_subset_lists(), ug::AttachedElementList< TAttachmentPipe >::AttachedElementList(), ug::MGSelector::disable_element_support(), ug::ElementStorage< TElem >::ElementStorage(), ug::MGSelector::enable_element_support(), ug::MultiGridSubsetHandler::new_subset(), ug::AttachedElementList< TAttachmentPipe >::operator=(), ug::AttachedElementList< TAttachmentPipe >::~AttachedElementList(), and ug::ElementStorage< TElem >::~ElementStorage().
|
inline |
Sets the pipe and a shared entry-attachment on which the list will operate.
Note that auto-copy on aEntry has to be disabled.
References ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::access(), ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::invalidate(), ug::AttachedElementList< TAttachmentPipe >::m_aaEntry, ug::AttachedElementList< TAttachmentPipe >::m_aEntry, ug::AttachedElementList< TAttachmentPipe >::m_back, ug::AttachedElementList< TAttachmentPipe >::m_bSharedAttachment, ug::AttachedElementList< TAttachmentPipe >::m_front, and ug::AttachedElementList< TAttachmentPipe >::m_pipe.
|
private |
Referenced by ug::AttachedElementList< TAttachmentPipe >::AttachedElementList(), ug::AttachedElementList< TAttachmentPipe >::begin(), ug::AttachedElementList< TAttachmentPipe >::clear(), ug::AttachedElementList< TAttachmentPipe >::end(), ug::AttachedElementList< TAttachmentPipe >::erase(), ug::AttachedElementList< TAttachmentPipe >::get_iterator(), ug::AttachedElementList< TAttachmentPipe >::get_pointer_to_element(), ug::AttachedElementList< TAttachmentPipe >::insert(), ug::AttachedElementList< TAttachmentPipe >::is_in_list(), ug::AttachedElementList< TAttachmentPipe >::operator=(), ug::AttachedElementList< TAttachmentPipe >::push_back(), and ug::AttachedElementList< TAttachmentPipe >::set_pipe().
|
private |
|
private |
|
private |
|
private |
Referenced by ug::AttachedElementList< TAttachmentPipe >::AttachedElementList(), ug::AttachedElementList< TAttachmentPipe >::begin(), ug::AttachedElementList< TAttachmentPipe >::clear(), ug::AttachedElementList< TAttachmentPipe >::empty(), ug::AttachedElementList< TAttachmentPipe >::erase(), ug::AttachedElementList< TAttachmentPipe >::front(), ug::AttachedElementList< TAttachmentPipe >::get_pointer_to_element(), ug::AttachedElementList< TAttachmentPipe >::insert(), ug::AttachedElementList< TAttachmentPipe >::is_in_list(), ug::AttachedElementList< TAttachmentPipe >::operator=(), ug::AttachedElementList< TAttachmentPipe >::push_back(), and ug::AttachedElementList< TAttachmentPipe >::set_pipe().
|
private |