ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::expressions::Expression Struct Reference

Description:

Implements TSharedMonoVal with type ExpressionVal. Therefore, the relevant documentation is found with class ExpressionVal, which can be accessed through this type using operator->().

The result of combining both is an automatic pointer to a ExpressionVal that is "self-contained" in the first buffer of a MonoAllocator together with the allocator itself. The expression is deleted and all associated memory is freed when the last copy of the pointer goes out of scope.

Note
With the documentation of type TSharedMonoVal, two naming schemes are suggested. Here, the second scheme is used because the method virtual Expression Compile(const String&)  will always return this encapsulated object. Expressions are shared by definition.

Definition at line 232 of file expression.inl.

Inheritance diagram for alib::expressions::Expression:
alib::monomem::TSharedMonoVal< ExpressionVal, HeapAllocator, void >

Public Method Index:

 Expression ()=default
 Constructs an empty instance, hence a cleared automatic pointer.
 Expression (std::nullptr_t) noexcept
Public Method Index: inherited from alib::monomem::TSharedMonoVal< ExpressionVal, HeapAllocator, void >
 TSharedMonoVal (HeapAllocator &allocator, size_t initialBufferSizeInKB, unsigned bufferGrowthInPercent)
 ~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)
ExpressionVal * Get () noexcept
AllocatorTypeGetAllocator () noexcept
void & GetLock () const noexcept
bool IsNulled () const noexcept
 operator bool () const noexcept
bool operator!= (std::nullptr_t) const noexcept
ExpressionVal & operator* () noexcept
ExpressionVal * operator-> () noexcept
TSharedMonoValoperator= (const 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)
ExpressionVal & Self () noexcept
void SetNulled () noexcept
bool TryAcquire (const CallerInfo &ci) const noexcept
bool TryAcquireShared (const CallerInfo &ci) const noexcept
bool TryAcquireSharedTimed (const Ticks::Duration &waitDuration, const CallerInfo &ci) const noexcept
bool TryAcquireTimed (const Ticks::Duration &waitDuration, const CallerInfo &ci) const noexcept
bool Unique () const noexcept
unsigned UseCount () const noexcept

Protected Method Index:

 Expression (size_t initialBufferSizeInKB, unsigned bufferGrowthInPercent)
template<typename... TArgs>
void Reset (TArgs &&... args)

Additional Inherited Members

Public Type Index: inherited from alib::monomem::TSharedMonoVal< ExpressionVal, HeapAllocator, void >
using AllocatorType
 Exposes the monotonic allocator used. Equals to TMonoAllocator<TAllocator>.
using LockType
 Exposes the lock type specified with template parameter TLock.
using StoredType
 Exposes the stored type specified with template parameter T.
Public Static Method Index: inherited from alib::monomem::TSharedMonoVal< ExpressionVal, HeapAllocator, void >
static constexpr size_t SizeOfAllocation ()
Protected Type Index: inherited from alib::monomem::TSharedMonoVal< ExpressionVal, HeapAllocator, void >
using FieldMembers
Protected Field Index: inherited from alib::monomem::TSharedMonoVal< ExpressionVal, HeapAllocator, void >
FieldMembersmembers

Constructor(s) / Destructor Details:

◆ Expression() [1/2]

alib::expressions::Expression::Expression ( size_t initialBufferSizeInKB,
unsigned bufferGrowthInPercent )
inlineprotected

Constructor. Calls the constructor of parent TSharedMonoVal and then invokes void ConstructT(TArgs&& ...)  passing the mono allocator that the parent creates this instance in.

Parameters
initialBufferSizeInKBThe initial size of memory buffers. Passed to the allocator given with parent class TSharedMonoVal.
bufferGrowthInPercentOptional growth factor in percent, applied to the buffer size with each next buffer allocation.

Definition at line 259 of file expression.inl.

◆ Expression() [2/2]

alib::expressions::Expression::Expression ( std::nullptr_t )
inlinenoexcept

Constructs an empty instance from std::nullptr. This constructor is necessary to allow assignment of nullptr to values of this type, which clears the automatic pointer.

Definition at line 269 of file expression.inl.

Method Details:

◆ Reset()

template<typename... TArgs>
void alib::expressions::Expression::Reset ( TArgs &&... args)
protected

Forbid this method by making it protected.

Template Parameters
TArgsThe argument types used for re-constructing T.
Parameters
argsThe arguments to re-construct the instance of T.

The documentation for this struct was generated from the following file: