Stroika Library
3.0d16
Help-Home
Loading...
Searching...
No Matches
Deque_Factory.inl
1
/*
2
* Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3
*/
4
#include "
Stroika/Foundation/Containers/Concrete/Deque_DoublyLinkedList.h
"
5
6
namespace
Stroika::Foundation::Containers::Factory {
7
8
/*
9
********************************************************************************
10
******************************* Deque_Factory<T> *******************************
11
********************************************************************************
12
*/
13
template
<
typename
T>
14
constexpr
Deque_Factory<T>::Deque_Factory
(
const
FactoryFunctionType& f)
15
: fFactory_{f}
16
{
17
}
18
template
<
typename
T>
19
constexpr
Deque_Factory<T>::Deque_Factory
()
20
:
Deque_Factory
{AccessDefault_ ()}
21
{
22
}
23
template
<
typename
T>
24
constexpr
Deque_Factory<T>::Deque_Factory
([[maybe_unused]]
const
Hints& hints)
25
:
Deque_Factory
{[] () -> FactoryFunctionType {
26
// @todo some alternatives
27
return [] () {
return
Concrete::Deque_DoublyLinkedList<T>
{}; };
28
}()}
29
{
30
}
31
template
<
typename
T>
32
inline
auto
Deque_Factory<T>::Default
() ->
const
Deque_Factory
&
33
{
34
return
AccessDefault_ ();
35
}
36
template
<
typename
T>
37
inline
auto
Deque_Factory<T>::operator()
() const ->
ConstructedType
38
{
39
return
this->fFactory_ ();
40
}
41
template
<
typename
T>
42
void
Deque_Factory<T>::Register
(
const
optional<Deque_Factory>& f)
43
{
44
AccessDefault_ () = f.has_value () ? *f :
Deque_Factory
{
Hints
{}};
45
}
46
template
<
typename
T>
47
inline
auto
Deque_Factory<T>::AccessDefault_
() ->
Deque_Factory
&
48
{
49
static
Deque_Factory
sDefault_{Hints{}};
50
return
sDefault_;
51
}
52
53
}
Deque_DoublyLinkedList.h
Stroika::Foundation::Containers::Concrete::Deque_DoublyLinkedList
Deque_DoublyLinkedList<T> is an Array-based concrete implementation of the Deque<T> container pattern...
Definition
Deque_DoublyLinkedList.h:29
Stroika::Foundation::Containers::Deque
Definition
Deque.h:55
Stroika::Foundation::Containers::Factory::Deque_Factory
Singleton factory object - Used to create the default backend implementation of a Deque<> container; ...
Definition
Deque_Factory.h:28
Stroika::Foundation::Containers::Factory::Deque_Factory::Deque_Factory
constexpr Deque_Factory()
Definition
Deque_Factory.inl:19
Stroika::Foundation::Containers::Factory::Deque_Factory::Hints
Definition
Deque_Factory.h:48
Library
Sources
Stroika
Foundation
Containers
Factory
Deque_Factory.inl
Generated by
1.9.8