14 template <
typename THIS_CONTAINER,
typename BASE_CONTAINER,
bool USING_IREP>
15 template <
typename... ARGS>
16 inline ArrayBasedContainer<THIS_CONTAINER, BASE_CONTAINER, USING_IREP>::ArrayBasedContainer (ARGS... args)
17 : BASE_CONTAINER{forward<ARGS> (args)...}
20 template <
typename THIS_CONTAINER,
typename BASE_CONTAINER,
bool USING_IREP>
21 inline size_t ArrayBasedContainer<THIS_CONTAINER, BASE_CONTAINER, USING_IREP>::capacity ()
const
23 if constexpr (USING_IREP) {
24 using _SafeReadRepAccessor =
typename THIS_CONTAINER ::template _SafeReadRepAccessor<typename THIS_CONTAINER::IImplRepBase_>;
25 return _SafeReadRepAccessor{
this}._ConstGetRep ().capacity ();
28 using _SafeReadRepAccessor =
typename THIS_CONTAINER ::template _SafeReadRepAccessor<typename THIS_CONTAINER::Rep_>;
29 return _SafeReadRepAccessor{
this}._ConstGetRep ().fData_.capacity ();
32 template <
typename THIS_CONTAINER,
typename BASE_CONTAINER,
bool USING_IREP>
35 if constexpr (USING_IREP) {
36 using _SafeReadWriteRepAccessor =
typename THIS_CONTAINER ::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::IImplRepBase_>;
37 _SafeReadWriteRepAccessor{
this}._GetWriteableRep ().
reserve (slotsAlloced);
40 using _SafeReadWriteRepAccessor =
typename THIS_CONTAINER ::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::Rep_>;
41 return _SafeReadWriteRepAccessor{
this}._GetWriteableRep ().fData_.reserve (slotsAlloced);
44 template <
typename THIS_CONTAINER,
typename BASE_CONTAINER,
bool USING_IREP>
47 if constexpr (USING_IREP) {
48 using _SafeReadWriteRepAccessor =
typename THIS_CONTAINER ::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::IImplRepBase_>;
49 _SafeReadWriteRepAccessor{
this}._GetWriteableRep ().
shrink_to_fit ();
52 using _SafeReadWriteRepAccessor =
typename THIS_CONTAINER ::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::Rep_>;
53 return _SafeReadWriteRepAccessor{
this}._GetWriteableRep ().fData_.shrink_to_fit ();
62 template <
typename THIS_CONTAINER_REP,
typename BASE_CONTAINER_REP>
63 template <
typename... ARGS>
65 : BASE_CONTAINER_REP{forward<ARGS> (args)...}
68 template <
typename THIS_CONTAINER_REP,
typename BASE_CONTAINER_REP>
72 Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (
this)->fData_.shrink_to_fit ();
73 Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (
this)->fChangeCounts_.PerformedChange ();
75 template <
typename THIS_CONTAINER_REP,
typename BASE_CONTAINER_REP>
79 return Debug::UncheckedDynamicCast<const THIS_CONTAINER_REP*> (
this)->fData_.capacity ();
81 template <
typename THIS_CONTAINER_REP,
typename BASE_CONTAINER_REP>
82 void ArrayBasedContainerRepImpl<THIS_CONTAINER_REP, BASE_CONTAINER_REP>::reserve (
size_t slotsAlloced)
85 Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (
this)->fData_.reserve (slotsAlloced);
86 Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (
this)->fChangeCounts_.PerformedChange ();
ArrayBasedContainer is a Stroika implementation detail, but its public methods are fair game and full...
nonvirtual void shrink_to_fit()
Reduce the space used to store the container contents.
nonvirtual void reserve(size_t slotsAlloced)
CRTP applied when ArrayBasedContainerIRep used.
shared_lock< const AssertExternallySynchronizedMutex > ReadContext
Instantiate AssertExternallySynchronizedMutex::ReadContext to designate an area of code where protect...
unique_lock< AssertExternallySynchronizedMutex > WriteContext
Instantiate AssertExternallySynchronizedMutex::WriteContext to designate an area of code where protec...