Loading...
Searching...
No Matches
UPtrDictionary< T > Class Template Reference

Template dictionary class which does not manages the storage associated with it. More...

#include <UPtrDictionary.H>

Inheritance diagram for UPtrDictionary< T >:
Collaboration diagram for UPtrDictionary< T >:

Public Types

typedef DictionaryBase< DLList< T * >, Tdict_type
 The template instance used for the dictionary content.
Public Types inherited from LList< DLListBase, T >
typedef T value_type
 Type of values stored.
typedef Tpointer
 Pointer for value_type.
typedef const Tconst_pointer
 Const pointer for value_type.
typedef Treference
 Reference for value_type.
typedef const Tconst_reference
 Const reference for value_type.
typedef label size_type
 The type that can represent the container size.
typedef label difference_type
 The difference between iterators.
using base_iterator
using const_base_iterator

Public Member Functions

 UPtrDictionary ()=default
 Default construct: empty without allocation (capacity=0).
 UPtrDictionary (const label initialCapacity)
 Construct empty with initial table capacity.
 UPtrDictionary (const UPtrDictionary &dict)
 Copy construct.
Public Member Functions inherited from DictionaryBase< DLList< T * >, T >
 DictionaryBase ()=default
 Default construct: empty without allocation (capacity=0).
 DictionaryBase (const label initialCapacity)
 Construct empty with initial table capacity.
 DictionaryBase (const DictionaryBase &dict)
 Copy construct.
 DictionaryBase (Istream &is, const INew &inew)
 Construct from Istream using given Istream constructor class.
 DictionaryBase (Istream &is)
 Construct from Istream using default Istream constructor class.
bool contains (const word &keyword) const
 Search for given keyword.
const Tcfind (const word &keyword) const
 Find and return an entry, nullptr on failure.
Tfind (const word &keyword)
 Find and return an entry, nullptr on failure.
const Tlookup (const word &keyword) const
 Find and return entry, FatalError on failure.
Tlookup (const word &keyword)
 Find and return entry, FatalError on failure.
wordList toc () const
 The table of contents (as a sorted list).
wordList sortedToc () const
 The table of contents as a sorted list.
wordList sortedToc (const Compare &comp) const
 The table of contents sorted using the specified comparator.
void push_front (const word &keyword, T *ptr)
 Add to front of dictionary.
void push_back (const word &keyword, T *ptr)
 Add to back of dictionary.
Tremove (const word &keyword)
 Remove and return entry specified by keyword.
void clear ()
 Clear the dictionary.
void transfer (DictionaryBase< DLList< T * >, T > &dict)
 Transfer the contents of the argument into this DictionaryBase.
void operator= (const DictionaryBase &)
 Copy assignment.
const Toperator[] (const word &key) const
 Find and return entry.
Toperator[] (const word &key)
 Find and return entry.
bool found (const word &key) const
 Same as contains().
const TlookupPtr (const word &k) const
 Deprecated(2020-03) use cfind().
TlookupPtr (const word &k)
 Deprecated(2020-03) use find().
void insert (const word &k, T *ptr)
 Add to front of dictionary.
void prepend (const word &k, T *ptr)
 Add to front of dictionary.
void append (const word &k, T *ptr)
 Add to back of dictionary.
Public Member Functions inherited from LList< DLListBase, T >
 LList ()=default
 Default construct.
 LList (const T &elem)
 Construct and copy add initial item.
 LList (T &&elem)
 Construct and move add initial item.
 LList (Istream &is)
 Construct from Istream.
 LList (const LList< DLListBase, T > &lst)
 Copy construct.
 LList (LList< DLListBase, T > &&lst)
 Move construct.
 LList (std::initializer_list< T > lst)
 Copy construct from an initializer list.
 ~LList ()
 Destructor. Calls clear().
reference front ()
 The first entry in the list.
const_reference front () const
 The first entry in the list (const access).
reference back ()
 The last entry in the list.
const_reference back () const
 The last entry in the list (const access).
void push_front (const T &elem)
 Add copy at front of list.
void push_front (T &&elem)
 Move construct at front of list.
void push_back (const T &elem)
 Add copy at back of list.
void push_back (T &&elem)
 Move construct at back of list.
void clear ()
 Delete contents of list.
void pop_front (label n=1)
 Remove first element(s) from the list (deletes pointers).
T removeHead ()
 Remove and return first entry.
T remove (link *item)
 Remove and return element.
T remove (iterator &iter)
 Remove and return element specified by iterator.
void transfer (LList< DLListBase, T > &lst)
 Transfer the contents of the argument into this List and annul the argument list.
void operator= (const LList< DLListBase, T > &lst)
 Copy assignment.
void operator= (LList< DLListBase, T > &&lst)
 Move assignment.
void operator= (std::initializer_list< T > lst)
 Copy assignment from an initializer list.
IstreamreadList (Istream &is)
 Read list from Istream.
OstreamwriteList (Ostream &os, const label shortLen=0) const
 Write LList with line-breaks when length exceeds shortLen.
iterator begin ()
 Iterator to first item in list with non-const access.
const_iterator cbegin () const
 Iterator to first item in list with const access.
reverse_iterator rbegin ()
 Iterator to last item in list with non-const access.
const_reverse_iterator crbegin () const
 Iterator to last item in list with const access.
const_iterator begin () const
 Iterator to first item in list with const access.
const_reverse_iterator rbegin () const
 Iterator to last item in list with const access.
const iterator & end ()
 End of list for forward iterators.
const const_iterator & cend () const
 End of list for forward iterators.
const reverse_iterator & rend ()
 End of list for reverse iterators.
const const_reverse_iterator & crend () const
 End of list for reverse iterators.
const const_iterator & end () const
 End of list for forward iterators.
const const_reverse_iterator & rend () const
 End of list for reverse iterators.
reference first ()
 The first entry in the list.
const_reference first () const
 The first entry in the list (const access).
reference last ()
 The last entry in the list.
const_reference last () const
 The last entry in the list (const access).
void prepend (const T &elem)
 Add copy at front of list.
void prepend (T &&elem)
 Move construct at front of list.
void append (const T &elem)
 Add copy at back of list.
void append (T &&elem)
 Move construct at back of list.
void insert (const T &elem)
 Add copy at front of list. Same as push_front().
void insert (T &&elem)
 Move construct at front of list. Same as push_front().
Public Member Functions inherited from DLListBase
 DLListBase ()=default
 Default construct.
 DLListBase (const DLListBase &)=delete
 No copy construct.
void operator= (const DLListBase &)=delete
 No copy assignment.
 ~DLListBase ()=default
 Destructor.
bool empty () const noexcept
 True if the list is empty.
label size () const noexcept
 The number of elements in list.
linkfront ()
 Return first entry.
const linkfront () const
 Return const access to first entry.
linkback ()
 Return last entry.
const linkback () const
 Return const access to last entry.
void push_front (link *item)
 Add at front of list.
void push_back (link *item)
 Add at back of list.
bool swapUp (link *item)
 Swap this element with the one above unless it is at the top.
bool swapDown (link *item)
 Swap this element with the one below unless it is at the bottom.
linkremoveHead ()
 Remove and return first entry.
linkremove (link *item)
 Remove and return element.
linkremove (iterator &iter)
 Remove and return element specified by iterator.
linkreplace (link *oldLink, link *newLink)
 Replace oldLink with newLink and return element.
linkreplace (iterator &oldIter, link *newitem)
 Replace oldIter with newItem and return element.
void clear ()
 Clear the list.
void swap (DLListBase &lst)
 Swap the contents of the list.
void transfer (DLListBase &lst)
 Transfer the contents of the argument into this list and annul the argument list.
iterator begin ()
 Iterator to first item in list with non-const access.
const_iterator cbegin () const
 Iterator to first item in list with const access.
const_iterator crbegin () const
 Iterator to last item in list with const access.
const iteratorend ()
 End of list for iterators.
const const_iteratorcend () const
 End of list for iterators.
const const_iteratorcrend () const
 End of list for reverse iterators.
linkfirst ()
 Return first entry.
const linkfirst () const
 Return const access to first entry.
linklast ()
 Return last entry.
const linklast () const
 Return const access to last entry.
void prepend (link *item)
 Add at front of list.
void append (link *item)
 Add at back of list.

Additional Inherited Members

Protected Member Functions inherited from DictionaryBase< DLList< T * >, T >
bool addHashEntry (const word &key, T *ptr)
 Add an entry to the HashTable.
void addEntries ()
 Add the IDLListType entries into the HashTable.
Protected Member Functions inherited from DLListBase
template<class IteratorType>
IteratorType iterator_first () const
 Return iterator to first item or end-iterator if list is empty.
template<class IteratorType>
IteratorType iterator_last () const
 Return iterator to last item or end-iterator if list is empty.
Static Protected Member Functions inherited from DLListBase
template<class IteratorType>
static const IteratorType & iterator_end ()
 Factory method to return an iterator end.
template<class IteratorType>
static const IteratorType & iterator_rend ()
 Factory method to return an iterator reverse end.
Protected Attributes inherited from DictionaryBase< DLList< T * >, T >
HashTable< T * > hashedTs_
 HashTable of the entries held on the IDLListType for quick lookup.

Detailed Description

template<class T>
class Foam::UPtrDictionary< T >

Template dictionary class which does not manages the storage associated with it.

It is derived from DictionaryBase instantiated on a non-memory managed form of intrusive doubly-linked list of <T>.

Definition at line 48 of file UPtrDictionary.H.

Member Typedef Documentation

◆ dict_type

template<class T>
typedef DictionaryBase<DLList<T*>, T> dict_type

The template instance used for the dictionary content.

Definition at line 57 of file UPtrDictionary.H.

Constructor & Destructor Documentation

◆ UPtrDictionary() [1/3]

template<class T>
UPtrDictionary ( )
default

Default construct: empty without allocation (capacity=0).

Referenced by UPtrDictionary().

Here is the caller graph for this function:

◆ UPtrDictionary() [2/3]

template<class T>
UPtrDictionary ( const label initialCapacity)
inlineexplicit

Construct empty with initial table capacity.

Definition at line 70 of file UPtrDictionary.H.

◆ UPtrDictionary() [3/3]

template<class T>
UPtrDictionary ( const UPtrDictionary< T > & dict)
inline

Copy construct.

Definition at line 78 of file UPtrDictionary.H.

References dict, and UPtrDictionary().

Here is the call graph for this function:

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