Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
SkipListSupport.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
6
8
9 /*
10 ********************************************************************************
11 *********** SkipListBasedContainer<THIS_CONTAINER,BASE_CONTAINER> **************
12 ********************************************************************************
13 */
14 template <typename THIS_CONTAINER, typename BASE_CONTAINER, bool USING_IREP>
15 inline void SkipListBasedContainer<THIS_CONTAINER, BASE_CONTAINER, USING_IREP>::ReBalance ()
16 {
17 if constexpr (USING_IREP) {
18 using _SafeReadWriteRepAccessor = typename THIS_CONTAINER::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::IImplRepBase_>;
19 _SafeReadWriteRepAccessor{this}._GetWriteableRep ().ReBalance ();
20 }
21 else {
22 using _SafeReadWriteRepAccessor = typename THIS_CONTAINER::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::Rep_>;
23 return _SafeReadWriteRepAccessor{this}._GetWriteableRep ().fData_.ReBalance ();
24 }
25 }
26
27 /*
28 ********************************************************************************
29 *** SkipListBasedContainerRepImpl<THIS_CONTAINER_REP, BASE_CONTAINER_REP> ******
30 ********************************************************************************
31 */
32 template <typename THIS_CONTAINER_REP, typename BASE_CONTAINER_REP>
33 void SkipListBasedContainerRepImpl<THIS_CONTAINER_REP, BASE_CONTAINER_REP>::ReBalance ()
34 {
35 Debug::AssertExternallySynchronizedMutex::WriteContext declareContext{Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (this)->fData_};
36 Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (this)->fData_.ReBalance ();
37 Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (this)->fChangeCounts_.PerformedChange ();
38 }
39
40}
unique_lock< AssertExternallySynchronizedMutex > WriteContext
Instantiate AssertExternallySynchronizedMutex::WriteContext to designate an area of code where protec...