44template <
typename TOwnable,
bool TOptional= false>
62 template<
typename TRequires= TOwnable>
67 template<
typename TRequires= TOwnable>
69 void callRelease() {
owned->Release(); }
79 ,
dbgCI(ci) { ownable.Acquire( ci ); }
88 ,
dbgCI(ci) {
if (ownable !=
nullptr) ownable->Acquire( ci ); }
90 Owner( TOwnable& ownable ) :
owned(&ownable) { ownable.Acquire(); }
93 :
owned(ownable) {
if (ownable !=
nullptr) ownable->Acquire(); }
119template <
typename TOwnable,
bool TOptional= false>
138 template<
typename TRequires= TOwnable>
143 template<
typename TRequires= TOwnable>
145 void callRelease() {
if (!TOptional ||
owned)
owned->Release(); }
148 template<
typename TRequires= TOwnable>
150 void callRelease() {
if (!TOptional ||
owned)
owned->ReleaseRecursive(
dbgCI); }
153 template<
typename TRequires= TOwnable>
155 void callRelease() {
if (!TOptional ||
owned)
owned->ReleaseRecursive(); }
175 ,
dbgCI(ci) {
isOwning = !ownable || ownable->TryAcquire( ci ); }
181 :
owned(ownable) {
isOwning = !ownable || ownable->TryAcquire(); }
216template <
typename TOwnable,
bool TOptional= false>
235 template<
typename TRequires= TOwnable>
240 template<
typename TRequires= TOwnable>
242 void callRelease() {
owned->Release(); }
246 template<
typename TRequires= TOwnable>
248 void callRelease() {
owned->ReleaseRecursive(
dbgCI); }
251 template<
typename TRequires= TOwnable>
253 void callRelease() {
owned->ReleaseRecursive(); }
266 template<
typename TTimeValue>
279 template<
typename TTimeValue>
285 template<
typename TTimeValue>
289 template<
typename TTimeValue>
308 template<
typename TTimeValue>
333template <
typename TOwnable,
bool TOptional= false>
351 template<
typename TRequires= TOwnable>
353 void callRelease() {
owned->ReleaseRecursive(
dbgCI); }
356 template<
typename TRequires= TOwnable>
358 void callRelease() {
owned->ReleaseRecursive(); }
368 ,
dbgCI(ci) { ownable.AcquireRecursive(ci); }
377 ,
dbgCI(ci) {
if (ownable !=
nullptr) ownable->AcquireRecursive( ci ); }
383 :
owned(ownable) {
if (ownable !=
nullptr) ownable->AcquireRecursive(); }
410template <
typename TOwnable,
bool TOptional= false>
428 template<
typename TRequires= TOwnable>
430 void callRelease()
const {
owned->ReleaseShared(
dbgCI); }
433 template<
typename TRequires= TOwnable>
435 void callRelease()
const {
owned->ReleaseShared(); }
445 ,
dbgCI(ci) { ownable.AcquireShared(ci); }
454 ,
dbgCI(ci) {
if (ownable !=
nullptr) ownable->AcquireShared( ci ); }
456 OwnerShared( TOwnable& ownable ) :
owned(&ownable) { ownable.AcquireShared(); }
459 :
owned(ownable) {
if (ownable !=
nullptr) ownable->AcquireShared(); }
488template <
typename TOwnable,
bool TOptional= false>
507 template<
typename TRequires= TOwnable>
509 void callRelease() {
owned->ReleaseShared(
dbgCI); }
512 template<
typename TRequires= TOwnable>
514 void callRelease() {
owned->ReleaseShared(); }
533 ,
dbgCI(ci) {
isOwning = !ownable || ownable->TryAcquireShared( ci ); }
540 :
owned(ownable) {
isOwning = !ownable || ownable->TryAcquireShared(); }
578template <
typename TOwnable,
bool TOptional= false>
597 template<
typename TRequires= TOwnable>
599 void callRelease() {
owned->ReleaseShared(
dbgCI); }
602 template<
typename TRequires= TOwnable>
604 void callRelease() {
owned->ReleaseShared(); }
616 template<
typename TTimeValue>
629 template<
typename TTimeValue>
635 template<
typename TTimeValue>
639 template<
typename TTimeValue>
642 :
owned(ownable) {
isOwning= !ownable || ownable->TryAcquireSharedTimed(
time); }
664 template<
typename TTimeValue>
#define ALIB_HAS_METHOD(T, Method,...)
#define ALIB_STACK_ALLOCATED_TYPE(T)
#define ALIB_ASSERT_ERROR(cond, domain,...)
void Set(OwnablePointer ownable)
std::remove_reference_t< TOwnable > * OwnablePointer
The pointer type of the owned object.
OwnerRecursive(OwnablePointer ownable, const CallerInfo &ci)
OwnerRecursive(TOwnable &ownable, const CallerInfo &ci)
OwnablePointer owned
The resource to acquire and release.
CallerInfo dbgCI
Caller information. Available only with debug-builds.
~OwnerRecursive()
Destructor. Invokes ReleaseRecursive() on member owned.
std::remove_reference_t< TOwnable > * OwnablePointer
The pointer type of the owned object.
OwnerSharedTimed(OwnablePointer ownable, const TTimeValue &time, const CallerInfo &ci)
~OwnerSharedTimed()
Destructor. Invokes Release() on member owned.
CallerInfo dbgCI
Caller information. Available only with debug-builds.
bool Set(OwnablePointer ownable, const TTimeValue &time)
OwnerSharedTimed(TOwnable &ownable, const TTimeValue &time, const CallerInfo &ci)
bool isOwning
The result of the call to TryAcquire.
bool IsOwning() const noexcept
OwnablePointer owned
The resource to acquire and release.
OwnerShared(TOwnable &ownable, const CallerInfo &ci)
OwnablePointer owned
The resource to acquire and release.
std::remove_reference_t< TOwnable > * OwnablePointer
The pointer type of the owned object.
~OwnerShared()
Destructor. Invokes ReleaseShared() on member owned.
OwnerShared(OwnablePointer ownable, const CallerInfo &ci)
void Set(OwnablePointer ownable)
CallerInfo dbgCI
Caller information. Available only with debug-builds.
std::remove_reference_t< TOwnable > * OwnablePointer
The pointer type of the owned object.
bool IsOwning() const noexcept
~OwnerTimed()
Destructor. Invokes Release() on member #".owned".
OwnerTimed(OwnablePointer ownable, const TTimeValue &time, const CallerInfo &ci)
OwnerTimed(TOwnable &ownable, const TTimeValue &time, const CallerInfo &ci)
bool Set(OwnablePointer ownable, const TTimeValue &time)
OwnablePointer owned
The resource to acquire and release.
CallerInfo dbgCI
Caller information. Available only with debug-builds.
bool isOwning
The result of the call to TryAcquire.
bool IsOwning() const noexcept
CallerInfo dbgCI
Caller information. Available only with debug-builds.
bool isOwning
The result of the call to TryAcquire.
std::remove_reference_t< TOwnable > * OwnablePointer
The pointer type of the owned object.
OwnablePointer owned
The resource to acquire and release.
bool Set(OwnablePointer ownable)
OwnerTryShared(TOwnable &ownable, const CallerInfo &ci)
OwnerTryShared(OwnablePointer ownable, const CallerInfo &ci)
~OwnerTryShared()
Destructor. Invokes Release() on member owned.
OwnablePointer owned
The resource to acquire and release.
bool Set(OwnablePointer ownable)
OwnerTry(OwnablePointer ownable, const CallerInfo &ci)
~OwnerTry()
Destructor. Invokes Release() on member #".owned".
CallerInfo dbgCI
Caller information. Available only with debug-builds.
std::remove_reference_t< TOwnable > * OwnablePointer
The pointer type of the owned object.
bool IsOwning() const noexcept
OwnerTry(TOwnable &ownable, const CallerInfo &ci)
bool isOwning
The result of the call to TryAcquire.
OwnablePointer owned
The resource to acquire and release.
std::remove_reference_t< TOwnable > * OwnablePointer
The pointer type of the owned object.
~Owner()
Destructor. Releases the owner by invoking Release().
Owner(TOwnable &ownable, const CallerInfo &ci)
Owner(OwnablePointer ownable, const CallerInfo &ci)
CallerInfo dbgCI
Caller information. Available only with debug-builds.
void Set(OwnablePointer ownable)