Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
SkipListSupport.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
5#ifndef _Stroika_Foundation_Containers_Private_SkipListSupport_h_
6#define _Stroika_Foundation_Containers_Private_SkipListSupport_h_
7
8#include "Stroika/Foundation/StroikaPreComp.h"
9
10#include "Stroika/Foundation/Common/Common.h"
11
12#include "Stroika/Foundation/Containers/Common.h"
13#include "Stroika/Foundation/Containers/DataStructures/SkipList.h"
14
15/**
16 * \file
17 * support classes for Concrete classes 'extensions' of behavior specific to the SkipList data structure
18 */
19
21
22 /**
23 * \brief SkipListBasedContainer is a Stroika implementation detail, but its public methods are fair game and fully supported (as used in subclasses)
24 *
25 * This mechanism allows all the array based concrete containers (such as Set_SkipList, Sequence_SkipList) to all
26 * share the same API and implementation of the API access functions (ReBalance etc) but without
27 * any genericity implied in the API (just code sharing).
28 *
29 * \note bool USING_IREP:
30 * Can we just peek from SkipListBasedContainer<> into the fData_ and do the array operations? Yes, if Rep_ is not
31 * type-erased, but no otherwise. If we specify false, we can avoid putting references to the SkipListBasedContainerIRep
32 * into the vtable, and linking a bunch of often not used code. But if we've got extra template parameters to the Rep_,
33 * we cannot peek at it from this container, so must indirect.
34 */
35 template <typename THIS_CONTAINER, typename BASE_CONTAINER, bool USING_IREP>
36 class SkipListBasedContainer : public BASE_CONTAINER {
37 public:
38 /**
39 */
40 template <typename... ARGS>
41 SkipListBasedContainer (ARGS... args);
42
43 public:
44 /**
45 * \brief
46 */
47 nonvirtual void ReBalance ();
48 };
49
50 /**
51 * \brief impl detail for array based container support (see SkipListBasedContainer docs on bool USING_IREP)
52 */
53 template <typename CONTAINER_REP_BASE_CLASS>
54 class SkipListBasedContainerIRep : public CONTAINER_REP_BASE_CLASS {
55 public:
56 virtual void ReBalance () = 0;
57 };
58
59 /**
60 * \brief CRTP applied when SkipListBasedContainerIRep used
61 */
62 template <typename THIS_CONTAINER_REP, typename BASE_CONTAINER_REP>
63 class SkipListBasedContainerRepImpl : public BASE_CONTAINER_REP {
64 public:
65 /**
66 */
67 template <typename... ARGS>
68 SkipListBasedContainerRepImpl (ARGS... args);
69 virtual void ReBalance () override;
70 };
71
72}
73
74/*
75 ********************************************************************************
76 ***************************** Implementation Details ***************************
77 ********************************************************************************
78 */
79#include "SkipListSupport.inl"
80
81#endif /*_Stroika_Foundation_Containers_Private_SkipListSupport_h_ */
SkipListBasedContainer is a Stroika implementation detail, but its public methods are fair game and f...
impl detail for array based container support (see SkipListBasedContainer docs on bool USING_IREP)
CRTP applied when SkipListBasedContainerIRep used.