Stroika Library
3.0d16
Help-Home
Loading...
Searching...
No Matches
SparseDataHyperRectangle.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_SparseDataHyperRectangle_h_
5
#define _Stroika_Foundation_Containers_SparseDataHyperRectangle_h_ 1
6
7
#include "Stroika/Foundation/StroikaPreComp.h"
8
9
#include "
Stroika/Foundation/Containers/DataHyperRectangle.h
"
10
11
/**
12
* \file
13
*
14
* \note Code-Status: <a href="Code-Status.md#Draft">Draft</a>
15
*
16
* TODO:
17
*
18
*/
19
20
namespace
Stroika::Foundation::Containers
{
21
22
using
Common::ArgByValueType
;
23
using
Traversal::Iterable;
24
using
Traversal::Iterator;
25
26
/**
27
* A SparseDataHyperRectangle<> is a DataHyperRectangle where you specify a special 'default' value, which will appear
28
* in any cell you 'get' without first setting (as if the hyper-rectangle was pre-initialized to that value).
29
*
30
* But default values don't show up when iterating.
31
*
32
* \note <a href="Design-Overview.md#Comparisons">Comparisons</a>:
33
* o Same as DataHyperRectangle<> comparisons
34
*/
35
template
<
typename
T,
typename
... INDEXES>
36
class
[[nodiscard]]
SparseDataHyperRectangle
:
public
DataHyperRectangle
<T, INDEXES...> {
37
private
:
38
using
inherited
=
DataHyperRectangle
<T, INDEXES...>;
39
40
public
:
41
using
value_type =
typename
inherited::value_type;
42
43
public
:
44
/**
45
* Use this typedef in templates to recover the basic functional container pattern of concrete types.
46
*/
47
using
ArchetypeContainerType
=
SparseDataHyperRectangle
;
48
49
public
:
50
/**
51
*/
52
SparseDataHyperRectangle
(
Common::ArgByValueType<T>
defaultItem = {});
53
SparseDataHyperRectangle
(
const
SparseDataHyperRectangle<T, INDEXES...>
& src);
54
55
protected
:
56
explicit
SparseDataHyperRectangle
(
const
shared_ptr<typename inherited::_IRep>& src)
noexcept
;
57
explicit
SparseDataHyperRectangle
(shared_ptr<typename inherited::_IRep>&& src)
noexcept
;
58
59
public
:
60
nonvirtual
SparseDataHyperRectangle
<T, INDEXES...>& operator= (
const
SparseDataHyperRectangle<T, INDEXES...>
& rhs) =
default
;
61
};
62
63
/**
64
* using SparseDataHyperRectangleN = SparseDataHyperRectangle<T, size_t REPEATED N TIMES>
65
*/
66
template
<
typename
T,
size_t
N>
67
using
SparseDataHyperRectangleN
=
68
typename
Private_DataHyperRectangle_::template NTemplate<T, SparseDataHyperRectangle>::template Helper_<make_index_sequence<N>>::CombinedType;
69
70
}
71
72
/*
73
********************************************************************************
74
******************************* Implementation Details *************************
75
********************************************************************************
76
*/
77
78
#include "SparseDataHyperRectangle.inl"
79
80
#endif
/*_Stroika_Foundation_Containers_SparseDataHyperRectangle_h_ */
DataHyperRectangle.h
Stroika::Foundation::Containers::DataHyperRectangle
Definition
DataHyperRectangle.h:61
Stroika::Foundation::Containers::SparseDataHyperRectangle
Definition
SparseDataHyperRectangle.h:36
Stroika::Foundation::Common::ArgByValueType
conditional_t<(sizeof(CHECK_T)<=2 *sizeof(void *)) and is_trivially_copyable_v< CHECK_T >, CHECK_T, const CHECK_T & > ArgByValueType
This is an alias for 'T' - but how we want to pass it on stack as formal parameter.
Definition
TypeHints.h:32
Stroika::Foundation::Containers
Definition
String.h:55
Stroika::Foundation::Containers::SparseDataHyperRectangleN
typename Private_DataHyperRectangle_::template NTemplate< T, SparseDataHyperRectangle >::template Helper_< make_index_sequence< N > >::CombinedType SparseDataHyperRectangleN
Definition
SparseDataHyperRectangle.h:68
Library
Sources
Stroika
Foundation
Containers
SparseDataHyperRectangle.h
Generated by
1.9.8