44template <
typename TOwnable,
bool TOptional= false>
61 template<
typename TRequires= TOwnable>
66 template<
typename TRequires= TOwnable>
68 void callRelease() {
owned->Release(); }
78 ,
dbgCI(ci) { ownable.Acquire( ci ); }
87 ,
dbgCI(ci) {
if (ownable !=
nullptr) ownable->Acquire( ci ); }
89 Owner( TOwnable& ownable ) :
owned(&ownable) { ownable.Acquire(); }
92 :
owned(ownable) {
if (ownable !=
nullptr) ownable->Acquire(); }
120template <
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(); }
217template <
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>
350 template<
typename TRequires= TOwnable>
352 void callRelease() {
owned->ReleaseRecursive(
dbgCI); }
355 template<
typename TRequires= TOwnable>
357 void callRelease() {
owned->ReleaseRecursive(); }
367 ,
dbgCI(ci) { ownable.AcquireRecursive(ci); }
376 ,
dbgCI(ci) {
if (ownable !=
nullptr) ownable->AcquireRecursive( ci ); }
382 :
owned(ownable) {
if (ownable !=
nullptr) ownable->AcquireRecursive(); }
409template <
typename TOwnable,
bool TOptional= false>
426 template<
typename TRequires= TOwnable>
428 void callRelease()
const {
owned->ReleaseShared(
dbgCI); }
431 template<
typename TRequires= TOwnable>
433 void callRelease()
const {
owned->ReleaseShared(); }
443 ,
dbgCI(ci) { ownable.AcquireShared(ci); }
452 ,
dbgCI(ci) {
if (ownable !=
nullptr) ownable->AcquireShared( ci ); }
454 OwnerShared( TOwnable& ownable ) :
owned(&ownable) { ownable.AcquireShared(); }
457 :
owned(ownable) {
if (ownable !=
nullptr) ownable->AcquireShared(); }
486template <
typename TOwnable,
bool TOptional= false>
504 template<
typename TRequires= TOwnable>
506 void callRelease() {
owned->ReleaseShared(
dbgCI); }
509 template<
typename TRequires= TOwnable>
511 void callRelease() {
owned->ReleaseShared(); }
530 ,
dbgCI(ci) {
isOwning = !ownable || ownable->TryAcquireShared( ci ); }
537 :
owned(ownable) {
isOwning = !ownable || ownable->TryAcquireShared(); }
575template <
typename TOwnable,
bool TOptional= false>
593 template<
typename TRequires= TOwnable>
595 void callRelease() {
owned->ReleaseShared(
dbgCI); }
598 template<
typename TRequires= TOwnable>
600 void callRelease() {
owned->ReleaseShared(); }
612 template<
typename TTimeValue>
625 template<
typename TTimeValue>
631 template<
typename TTimeValue>
635 template<
typename TTimeValue>
638 :
owned(ownable) {
isOwning= !ownable || ownable->TryAcquireSharedTimed(
time); }
660 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 TryAcquireSharedTimed.
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 TryAcquireTimed.
bool IsOwning() const noexcept
CallerInfo dbgCI
Caller information. Available only with debug-builds.
bool isOwning
The result of the call to TryAcquireShared.
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)