doxygen
|
Container class representing a vector of objects with keys. More...
#include <linkedmap.h>
Public Member Functions | |
const T * | find (const std::string &key) const |
Find an object given the key. More... | |
const T * | find (const QCString &key) const |
Find an object given the key. More... | |
const T * | find (const char *key) const |
Find an object given the key. More... | |
T * | find (const char *key) |
A non-const wrapper for find() const. | |
T * | find (const QCString &key) |
A non-const wrapper for find() const. | |
T * | find (const std::string &key) |
A non-const wrapper for find() const. | |
template<class... Args> | |
T * | add (const char *k, Args &&... args) |
Adds a new object to the ordered vector if it was not added already. More... | |
template<class... Args> | |
T * | add (const QCString &k, Args &&... args) |
T * | add (const char *k, Ptr &&ptr) |
Adds an existing object to the ordered vector (unless another object was already added under the same key). More... | |
T * | add (const QCString &k, Ptr &&ptr) |
template<class... Args> | |
T * | prepend (const char *k, Args &&... args) |
Prepends a new object to the ordered vector if it was not added already. More... | |
template<class... Args> | |
T * | prepend (const QCString &key, Args &&... args) |
bool | del (const QCString &key) |
Removes an object from the container and deletes it. More... | |
Ptr & | operator[] (size_t pos) |
const Ptr & | operator[] (size_t pos) const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
reverse_iterator | rbegin () |
reverse_iterator | rend () |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
bool | empty () const |
size_t | size () const |
void | clear () |
Container class representing a vector of objects with keys.
Objects can efficiently be looked up given the key. Objects are owned by the container. When adding objects the order of addition is kept, and used while iterating.
|
inline |
Adds a new object to the ordered vector if it was not added already.
Return a non-owning pointer to the newly added object, or to the existing object if it was already inserted before under the given key.
|
inline |
Adds an existing object to the ordered vector (unless another object was already added under the same key).
Ownership is transferred. Return a non-owning pointer to the newly added object, or to the existing object if it was already inserted before under the given key.
|
inline |
Removes an object from the container and deletes it.
Returns true if the object was deleted or false it is was not found.
|
inline |
Find an object given the key.
Returns a pointer to the element if found or nullptr if it is not found.
|
inline |
Find an object given the key.
Returns a pointer to the element if found or nullptr if it is not found.
|
inline |
Find an object given the key.
Returns a pointer to the element if found or nullptr if it is not found.
|
inline |
Prepends a new object to the ordered vector if it was not added already.
Return a non-owning pointer to the newly added object, or to the existing object if it was already inserted before under the given key.