9#ifndef HPP_ALIB_LANG_OWNER
10#define HPP_ALIB_LANG_OWNER 1
12#if !defined(HPP_ALIB) && !defined(ALIB_DOX)
18#if !defined(HPP_ALIB_STRINGS_CSTRING)
22namespace alib {
namespace lang {
42template <
typename TOwnable>
51 void*
operator new (size_t);
54 void*
operator new (size_t,
void*);
57 void*
operator new[](size_t);
60 void*
operator new[](size_t,
void*);
82 ownable.Acquire( dbgFile, dbgLine, dbgFunc );
100template <
typename TOwnable>
109#define ALIB_OWN(ownable) \
110alib::Owner<decltype(ownable)> ALIB_IDENTIFIER(owner) (ownable ALIB_COMMA_DBG ALIB_CALLER_PRUNED);
114#define ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS_MEMBER_DECL
115#define ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS
119#define ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS_MEMBER_DECL \
120bool dbgRecursionDetectionFlag = false;
122#define ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS \
123struct RecursionDetection \
126 RecursionDetection( bool& testMember ) : TestMember(testMember) {} \
128 void Acquire( const NCString&, int, const NCString& func ) \
130 ALIB_ASSERT_ERROR(TestMember==false, "FSOWNER", "Forbidden recursive use of method ", func) \
133 void Release() { TestMember= false; } \
135RecursionDetection dbgRecursionDetection( dbgRecursionDetectionFlag ); \
136ALIB_OWN(dbgRecursionDetection);
Owner(TOwnable &ownable, const NCString &dbgFile, int dbgLine, const NCString &dbgFunc)
void operator=(const Owner &)
lang::Owner< TOwnable > Owner
Type alias in namespace alib.