14 template <
typename THIS_CONTAINER,
typename BASE_CONTAINER,
bool USING_IREP>
15 inline size_t ArrayBasedContainer<THIS_CONTAINER, BASE_CONTAINER, USING_IREP>::capacity ()
const
17 if constexpr (USING_IREP) {
18 using _SafeReadRepAccessor =
typename THIS_CONTAINER ::template _SafeReadRepAccessor<typename THIS_CONTAINER::IImplRepBase_>;
19 return _SafeReadRepAccessor{
this}._ConstGetRep ().capacity ();
22 using _SafeReadRepAccessor =
typename THIS_CONTAINER ::template _SafeReadRepAccessor<typename THIS_CONTAINER::Rep_>;
23 return _SafeReadRepAccessor{
this}._ConstGetRep ().fData_.capacity ();
26 template <
typename THIS_CONTAINER,
typename BASE_CONTAINER,
bool USING_IREP>
29 if constexpr (USING_IREP) {
30 using _SafeReadWriteRepAccessor =
typename THIS_CONTAINER ::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::IImplRepBase_>;
31 _SafeReadWriteRepAccessor{
this}._GetWriteableRep ().reserve (slotsAlloced);
34 using _SafeReadWriteRepAccessor =
typename THIS_CONTAINER ::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::Rep_>;
35 return _SafeReadWriteRepAccessor{
this}._GetWriteableRep ().fData_.reserve (slotsAlloced);
38 template <
typename THIS_CONTAINER,
typename BASE_CONTAINER,
bool USING_IREP>
41 if constexpr (USING_IREP) {
42 using _SafeReadWriteRepAccessor =
typename THIS_CONTAINER ::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::IImplRepBase_>;
43 _SafeReadWriteRepAccessor{
this}._GetWriteableRep ().shrink_to_fit ();
46 using _SafeReadWriteRepAccessor =
typename THIS_CONTAINER ::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::Rep_>;
47 return _SafeReadWriteRepAccessor{
this}._GetWriteableRep ().fData_.shrink_to_fit ();
56 template <
typename THIS_CONTAINER_REP,
typename BASE_CONTAINER_REP>
60 Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (
this)->fData_.shrink_to_fit ();
61 Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (
this)->fChangeCounts_.PerformedChange ();
63 template <
typename THIS_CONTAINER_REP,
typename BASE_CONTAINER_REP>
64 size_t ArrayBasedContainerRepImpl<THIS_CONTAINER_REP, BASE_CONTAINER_REP>::capacity ()
const
67 return Debug::UncheckedDynamicCast<const THIS_CONTAINER_REP*> (
this)->fData_.capacity ();
69 template <
typename THIS_CONTAINER_REP,
typename BASE_CONTAINER_REP>
70 void ArrayBasedContainerRepImpl<THIS_CONTAINER_REP, BASE_CONTAINER_REP>::reserve (
size_t slotsAlloced)
73 Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (
this)->fData_.reserve (slotsAlloced);
74 Debug::UncheckedDynamicCast<THIS_CONTAINER_REP*> (
this)->fChangeCounts_.PerformedChange ();
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...