Linked Object Lists
-
class LinkedObject
- #include <LinkedObject.h>
Base virtual class to allow objects to be linked together.
This can be more efficient than defining a separate list, as each object requires only an additional pointer field for ‘next’.
Subclassed by LinkedObjectTemplate< Request >, LinkedObjectTemplate< Item >, LinkedObjectTemplate< HttpResourcePlugin >, LinkedObjectTemplate< StationInfo >, LinkedObjectTemplate< Element >, LinkedObjectTemplate< PluginRef >, LinkedObjectTemplate< Object >, LinkedObjectTemplate< Asset >, LinkedObjectTemplate< Answer >, LinkedObjectTemplate< Controller >, LinkedObjectTemplate< Handler >, LinkedObjectTemplate< Question >, LinkedObjectTemplate< Service >, LinkedObjectTemplate< Device >, LinkedObjectTemplate< PriorityNode< ObjectType > >, LinkedObjectTemplate< Renderer >, LinkedObjectTemplate< ClassType >, LinkedObjectTemplate< Info >, LinkedObjectTemplate< ObjectType >
Public Functions
-
virtual ~LinkedObject() = default
-
inline virtual LinkedObject *next() const
-
inline bool insertAfter(LinkedObject *object)
-
inline bool operator==(const LinkedObject &other) const
-
inline bool operator!=(const LinkedObject &other) const
Private Members
-
LinkedObject *mNext = {nullptr}
Friends
- friend class LinkedObjectList
-
virtual ~LinkedObject() = default
-
template<typename ObjectType>
class LinkedObjectTemplate : public LinkedObject - #include <LinkedObject.h>
Base class template for linked items with type casting.
Public Types
-
using Iterator = IteratorTemplate<ObjectType, ObjectType*, ObjectType&>
-
using ConstIterator = IteratorTemplate<const ObjectType, const ObjectType*, const ObjectType&>
-
template<typename T, typename TPtr, typename TRef>
class IteratorTemplate - #include <LinkedObject.h>
Public Types
-
using iterator_category = std::forward_iterator_tag
-
using difference_type = std::ptrdiff_t
Public Functions
-
inline IteratorTemplate(const IteratorTemplate &other)
-
inline IteratorTemplate &operator++()
-
inline IteratorTemplate operator++(int)
-
inline bool operator==(const IteratorTemplate &rhs) const
-
inline bool operator!=(const IteratorTemplate &rhs) const
-
using iterator_category = std::forward_iterator_tag
-
using Iterator = IteratorTemplate<ObjectType, ObjectType*, ObjectType&>
-
class LinkedObjectList
- #include <LinkedObjectList.h>
Singly-linked list of objects.
Note
We don’t own the items, just keep references to them
Subclassed by LinkedObjectListTemplate< Controller >, LinkedObjectListTemplate< Handler >, LinkedObjectListTemplate< Service >, LinkedObjectListTemplate< Control >, LinkedObjectListTemplate< ObjectType >
Public Functions
-
LinkedObjectList() = default
-
inline LinkedObjectList(LinkedObject *object)
-
bool add(LinkedObject *object)
-
inline bool add(const LinkedObject *object)
-
inline bool insert(LinkedObject *object)
-
inline bool insert(const LinkedObject *object)
-
bool remove(LinkedObject *object)
-
inline LinkedObject *pop()
-
inline void clear()
-
inline LinkedObject *head()
-
inline const LinkedObject *head() const
-
inline bool isEmpty() const
Protected Attributes
-
LinkedObject *mHead = {nullptr}
-
LinkedObjectList() = default
-
template<typename ObjectType>
class LinkedObjectListTemplate : public LinkedObjectList - #include <LinkedObjectList.h>
Subclassed by OwnedLinkedObjectListTemplate< Request >, OwnedLinkedObjectListTemplate< Item >, OwnedLinkedObjectListTemplate< HttpResourcePlugin >, OwnedLinkedObjectListTemplate< Surface >, OwnedLinkedObjectListTemplate< Element >, OwnedLinkedObjectListTemplate< StationInfo >, OwnedLinkedObjectListTemplate< PluginRef >, OwnedLinkedObjectListTemplate< Asset >, OwnedLinkedObjectListTemplate< Answer >, OwnedLinkedObjectListTemplate< Question >, OwnedLinkedObjectListTemplate< Device >, OwnedLinkedObjectListTemplate< PriorityNode< ObjectType > >, OwnedLinkedObjectListTemplate< ClassType >, OwnedLinkedObjectListTemplate< Info >, OwnedLinkedObjectListTemplate< ObjectType >
Public Types
-
using Iterator = typename LinkedObjectTemplate<ObjectType>::template IteratorTemplate<ObjectType, ObjectType*, ObjectType&>
-
using ConstIterator = typename LinkedObjectTemplate<ObjectType>::template IteratorTemplate<const ObjectType, const ObjectType*, const ObjectType&>
Public Functions
-
LinkedObjectListTemplate() = default
-
inline LinkedObjectListTemplate(ObjectType *object)
-
inline ObjectType *head()
-
inline const ObjectType *head() const
-
inline ConstIterator begin() const
-
inline ConstIterator end() const
-
inline bool add(ObjectType *object)
-
inline bool add(const ObjectType *object)
-
inline bool insert(ObjectType *object)
-
inline bool insert(const ObjectType *object)
-
inline ObjectType *pop()
-
inline size_t count() const
-
inline bool contains(const ObjectType &object) const
-
using Iterator = typename LinkedObjectTemplate<ObjectType>::template IteratorTemplate<ObjectType, ObjectType*, ObjectType&>
-
template<typename ObjectType>
class OwnedLinkedObjectListTemplate : public LinkedObjectListTemplate<ObjectType> - #include <LinkedObjectList.h>
Class template for singly-linked list of objects.
Note
We own the objects so are responsible for destroying them when removed
Subclassed by Storage::Disk::BasePartitionTable
Public Functions
-
OwnedLinkedObjectListTemplate() = default
-
OwnedLinkedObjectListTemplate(const OwnedLinkedObjectListTemplate &other) = delete
-
OwnedLinkedObjectListTemplate &operator=(const OwnedLinkedObjectListTemplate &other) = delete
-
inline ~OwnedLinkedObjectListTemplate()
-
inline bool remove(ObjectType *object)
-
inline void clear()
-
OwnedLinkedObjectListTemplate() = default