Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Queue_DoublyLinkedList.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Containers_Concrete_Queue_DoublyLinkedList_h_
5#define _Stroika_Foundation_Containers_Concrete_Queue_DoublyLinkedList_h_
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
10
11/**
12 * \file
13 *
14 * \note Code-Status: <a href="Code-Status.md#Beta">Beta</a>
15 */
16
18
19 /**
20 * \brief Queue_DoublyLinkedList<T> is an Array-based concrete implementation of the Queue<T> container pattern.
21 *
22 * \note Runtime performance/complexity:
23 * o size () is O(N)
24 *
25 * \note \em Thread-Safety <a href="Thread-Safety.md#C++-Standard-Thread-Safety">C++-Standard-Thread-Safety</a>
26 */
27 template <typename T>
28 class Queue_DoublyLinkedList : public Queue<T> {
29 private:
30 using inherited = Queue<T>;
31
32 public:
33 using value_type = typename inherited::value_type;
34
35 public:
36 /**
37 * \see docs on Queue<T> constructor
38 */
41 Queue_DoublyLinkedList (const Queue_DoublyLinkedList&) noexcept = default;
42 Queue_DoublyLinkedList (const initializer_list<value_type>& src);
43 template <IIterableOfTo<T> ITERABLE_OF_ADDABLE>
44 requires (not derived_from<remove_cvref_t<ITERABLE_OF_ADDABLE>, Queue_DoublyLinkedList<T>>)
45 explicit Queue_DoublyLinkedList (ITERABLE_OF_ADDABLE&& src)
46#if qCompilerAndStdLib_RequiresNotMatchInlineOutOfLineForTemplateClassBeingDefined_Buggy
48 {
49 this->AddAllToTail (forward<ITERABLE_OF_ADDABLE> (src));
50 AssertRepValidType_ ();
51 }
52#endif
53 ;
54 template <IInputIterator<T> ITERATOR_OF_ADDABLE>
55 Queue_DoublyLinkedList (ITERATOR_OF_ADDABLE&& start, ITERATOR_OF_ADDABLE&& end);
56
57 public:
58 nonvirtual Queue_DoublyLinkedList& operator= (Queue_DoublyLinkedList&&) noexcept = default;
59 nonvirtual Queue_DoublyLinkedList& operator= (const Queue_DoublyLinkedList&) = default;
60
61 private:
62 class Rep_;
63
64 private:
65 nonvirtual void AssertRepValidType_ () const;
66 };
67
68}
69
70/*
71 ********************************************************************************
72 ******************************* Implementation Details *************************
73 ********************************************************************************
74 */
75
76#include "Queue_DoublyLinkedList.inl"
77
78#endif /*_Stroika_Foundation_Containers_Concrete_Queue_DoublyLinkedList_h_ */
Queue_DoublyLinkedList<T> is an Array-based concrete implementation of the Queue<T> container pattern...
A Queue is a first-in-first-out (FIFO) data structure, where elements are arranged in well-ordered fa...
Definition Queue.h:95
nonvirtual void AddAllToTail(ITERABLE_OF_ADDABLE &&s)
typename inherited::value_type value_type
Definition Queue.h:109
static constexpr default_sentinel_t end() noexcept
Support for ranged for, and STL syntax in general.