template<typename TLock>
struct alib::files::TSharedFTree< TLock >
Utility type which implements TSharedMonoVal with class FTree. The result of combining both is an automatic pointer to a FTree that is "self-contained" in the first buffer of a MonoAllocator together with the allocator itself. The tree is deleted and all associated memory is freed when the last copy of the pointer goes out of scope.
Along with the FTree, this shared object includes a SharedLock. See chapter 7.4 Locking Shared Values of the Programmer's Manual of module ALib Monomem for further information on how to protect the contents of this type against thread-racing-conditions.
- Template Parameters
-
TLock | The lock type passed to the template parameter of parent type TSharedMonoVal with the same name.
With the inclusion of module ALib Threads in the ALib Distribution, the type-alias alib::SharedFTree chooses type SharedLock.
Otherwise, in case ALib is compiled without threading support, the alias chooses void .
If it is assured that no racing-conditions occur with shared instances in multithreaded software, the using code may pass void here as well. |
Definition at line 507 of file ftree.hpp.
|
| TSharedFTree ()=default |
| Constructs an empty instance, hence a cleared automatic pointer.
|
|
| TSharedFTree (size_t initialBufferSizeInKB, unsigned int bufferGrowthInPercent=200) |
|
| TSharedFTree (std::nullptr_t) noexcept |
|
| ~TSharedFTree () |
|
void | DbgCriticalSections (lang::Switch onOff) |
|
TSharedFTree & | operator= (const TSharedFTree &)=default |
|
void | Reset () |
|
| TSharedMonoVal () noexcept |
| Default Constructor. Leaves this object nulled.
|
|
| TSharedMonoVal (const TSharedMonoVal &other) noexcept |
|
| TSharedMonoVal (HeapAllocator &allocator, size_t initialBufferSizeInKB, unsigned int bufferGrowthInPercent) |
|
| TSharedMonoVal (size_t initialBufferSizeInKB, unsigned int bufferGrowthInPercent) |
|
| TSharedMonoVal (std::nullptr_t) noexcept |
|
| TSharedMonoVal (TSharedMonoVal &&other) noexcept |
|
| ~TSharedMonoVal () |
|
void | Acquire (const CallerInfo &ci) const noexcept |
|
void | AcquireRecursive (const CallerInfo &ci) const noexcept |
|
void | AcquireShared (const CallerInfo &ci) const noexcept |
|
void | ConstructT (TArgs &&... args) |
|
const FTree * | Get () const noexcept |
|
FTree * | Get () noexcept |
|
AllocatorType & | GetAllocator () noexcept |
|
TLock & | GetLock () const noexcept |
|
bool | IsNulled () const noexcept |
|
| operator bool () const noexcept |
|
bool | operator!= (std::nullptr_t) const noexcept |
|
const FTree & | operator* () const noexcept |
|
FTree & | operator* () noexcept |
|
const FTree * | operator-> () const noexcept |
|
FTree * | operator-> () noexcept |
|
TSharedMonoVal & | operator= (const TSharedMonoVal &other) noexcept |
|
void | operator= (std::nullptr_t) |
| Assignment of nullptr . Same as SetNulled.
|
|
TSharedMonoVal & | operator= (TSharedMonoVal &&other) noexcept |
|
bool | operator== (std::nullptr_t) const noexcept |
|
void | Release (const CallerInfo &ci) const noexcept |
|
void | ReleaseRecursive (const CallerInfo &ci) const noexcept |
|
void | ReleaseShared (const CallerInfo &ci) const noexcept |
|
void | Reset (TArgs &&... args) |
|
const FTree & | Self () const noexcept |
|
FTree & | Self () noexcept |
|
void | SetNulled () noexcept |
|
bool | TryAcquire (const CallerInfo &ci) const noexcept |
|
bool | TryAcquireShared (const CallerInfo &ci) const noexcept |
|
bool | TryAcquireSharedTimed (const Ticks &pointInTime, const CallerInfo &ci) const noexcept |
|
bool | TryAcquireSharedTimed (const Ticks::Duration &waitDuration, const CallerInfo &ci) const noexcept |
|
bool | TryAcquireSharedTimed (const Ticks::Duration::TDuration &waitDuration, const CallerInfo &ci) const noexcept |
|
bool | TryAcquireSharedTimed (const Ticks::TTimePoint &pointInTime, const CallerInfo &ci) const noexcept |
|
bool | TryAcquireTimed (const Ticks &pointInTime, const CallerInfo &ci) const noexcept |
|
bool | TryAcquireTimed (const Ticks::Duration &waitDuration, const CallerInfo &ci) const noexcept |
|
bool | TryAcquireTimed (const Ticks::Duration::TDuration &waitDuration, const CallerInfo &ci) const noexcept |
|
bool | TryAcquireTimed (const Ticks::TTimePoint &pointInTime, const CallerInfo &ci) const noexcept |
|
bool | Unique () const noexcept |
|
unsigned int | UseCount () const noexcept |
|
template<typename TLock >
Clears all scanned or otherwise inserted data and re-initializes this object to its constructor defaults and resets the MonoAllocator of the parent class.
All shared instances remain valid (while, of-course, their content is likewise reset).
Definition at line 592 of file ftree.hpp.