*
operator new(
size_t size);
238 void*
operator new[](
size_t size);
242 void operator delete(
void* ptr);
246 void operator delete[](
void* ptr);
250 void*
operator new(
size_t size,
void* place);
254 void operator delete(
void* ptr,
void* place);
347 #ifdef NCBI_COUNTER_UNSIGNED 456 returnObjectStateCanBeDeleted(m_Counter);
463 returnObjectStateIsAllocatedInPool(m_Counter);
470 returnObjectStateReferenced(m_Counter);
477 returnObjectStateReferencedOnlyOnce(m_Counter);
513 #ifdef NCBI_OBJECT_LOCKER_INLINE 518 object->AddReference();
532 object->RemoveReference();
539 object->ReleaseReference();
555 template<
classInterface>
559 void Lock(
constInterface*
object)
const 561 const CObject* cobject =
dynamic_cast<const CObject*
>(object);
568 void Relock(
constInterface*
object)
const 570 const CObject* cobject =
dynamic_cast<const CObject*
>(object);
575 void Unlock(
constInterface*
object)
const 577 const CObject* cobject =
dynamic_cast<const CObject*
>(object);
584 const CObject* cobject =
dynamic_cast<const CObject*
>(object);
589 #ifdef NCBI_OBJECT_LOCKER_INLINE 599 const CObject* cobject =
dynamic_cast<const CObject*
>(object);
614template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
class CRef;
615template<class C, class Locker = typename CLockerTraits<C>::TLockerType>
class CConstRef;
617 template<
classC,
classLocker>
629 template<
classTDerived,
classTLocker>
friend class CRef;
630 template<
classTDerived,
classTLocker>
friend class CConstRef;
653:
m_Data(locker_value, ptr)
666 template<
classTDerived,
679ref.m_Data.second() = 0;
683 template<
classTDerived,
689ref.m_Data.second() = 0;
793 if( newPtr != oldPtr ) {
894ref.
Reset(old_ptr);
910 template<
classTDerived,
921 #ifdef NCBI_COMPILER_MSVC 929ref.m_Data.second() = 0;
934 template<
classTDerived,
939ref.m_Data.second() = 0;
1231 m_Data.
first().TransferLock(newPtr, src_locker);
1265 template<
classC,
classLocker>
1277 template<
classTDerived,
classTLocker>
friend class CConstRef;
1300:
m_Data(locker_value, ptr)
1313 template<
classTDerived,
1326ref.m_Data.second() = 0;
1330 template<
classTDerived,
1336ref.m_Data.second() = 0;
1340 template<
classTDerived,
1349 template<
classTDerived,
1355ref.m_Data.second() = 0;
1459 if( newPtr != oldPtr ) {
1560ref.
Reset(old_ptr);
1576 template<
classTDerived,
1588 #ifdef NCBI_COMPILER_MSVC 1590 if(
this== &ref) {
1595 x_MoveAssign(ref.m_Data.first(), ref.m_Data.second());
1596ref.m_Data.second() = 0;
1601 template<
classTDerived,
1605 x_MoveAssign(ref.m_Data.first(), ref.m_Data.second());
1606ref.m_Data.second() = 0;
1611 template<
classTDerived,
1620 template<
classTDerived,
1624 x_MoveAssign(ref.m_Data.first(), ref.m_Data.second());
1625ref.m_Data.second() = 0;
1771 m_Data.
first().TransferLock(newPtr, src_locker);
1784 const_cast<void**
>(
1785 reinterpret_cast<const void**
>(&
m_Data.
second()))),
1786 const_cast<C*
>(ptr)));
1803 template<
classT,
classL>
1807 return r1.IsNull();
1811 template<
classT,
classL>
1815 return r1.IsNull();
1819 template<
classT,
classL>
1823 return!
r1.IsNull();
1827 template<
classT,
classL>
1831 return!
r1.IsNull();
1835 template<
classT,
classL>
1839 return r1.IsNull();
1843 template<
classT,
classL>
1847 return r1.IsNull();
1851 template<
classT,
classL>
1855 return!
r1.IsNull();
1859 template<
classT,
classL>
1863 return!
r1.IsNull();
1867 #if defined(NCBI_COMPILER_WORKSHOP) 1873 template<
classT,
classL>
1877 return r1.GetPointerOrNull() <
r2.GetPointerOrNull();
1881 template<
classT,
classL>
1885 return r1.GetPointerOrNull() >
r2.GetPointerOrNull();
1889 template<
classT,
classL>
1893 return r1.GetPointerOrNull() <=
r2.GetPointerOrNull();
1897 template<
classT,
classL>
1901 return r1.GetPointerOrNull() >=
r2.GetPointerOrNull();
1905 template<
classT,
classL>
1909 return r1.GetPointerOrNull() ==
r2.GetPointerOrNull();
1913 template<
classT,
classL>
1917 return r1.GetPointerOrNull() !=
r2.GetPointerOrNull();
1924 template<
classT,
classL>
1928 return r1.GetPointerOrNull() <
r2.GetPointerOrNull();
1932 template<
classT,
classL>
1936 return r1.GetPointerOrNull() >
r2.GetPointerOrNull();
1940 template<
classT,
classL>
1944 return r1.GetPointerOrNull() <=
r2.GetPointerOrNull();
1948 template<
classT,
classL>
1952 return r1.GetPointerOrNull() >=
r2.GetPointerOrNull();
1956 template<
classT,
classL>
1960 return r1.GetPointerOrNull() ==
r2.GetPointerOrNull();
1964 template<
classT,
classL>
1968 return r1.GetPointerOrNull() !=
r2.GetPointerOrNull();
1976 template<
classT,
classL>
1980 return r1.GetPointerOrNull() ==
r2.GetPointerOrNull();
1984 template<
classT,
classL>
1988 return r1.GetPointerOrNull() ==
r2.GetPointerOrNull();
1992 template<
classT,
classL>
1996 return r1.GetPointerOrNull() !=
r2.GetPointerOrNull();
2000 template<
classT,
classL>
2004 return r1.GetPointerOrNull() !=
r2.GetPointerOrNull();
2031 template<
classInterface,
classLocker = CInterfaceObjectLocker<Interface> >
2070 template<
classTDerived,
2084 template<
classTDerived,
2106 template<
classTDerived,
2122 template<
classTDerived,
2127ref.ReleaseOrNull();
2157 template<
classInterface,
classLocker = CInterfaceObjectLocker<Interface> >
2202 template<
classTDerived,
2216 template<
classTDerived,
2225 template<
classTDerived,
2233 template<
classTDerived,
2249 template<
classTDerived,
2265 template<
classTDerived,
2270ref.ReleaseOrNull();
2275 template<
classTDerived,
2284 template<
classTDerived,
2289ref.ReleaseOrNull();
2333 template<
typenameT>
2339 template<
class... Args>
2341:
m_Data(std::forward<Args>(args)...)
2370 operator const T& (void)
const 2408 void Clear(
void);
2508 "Weak referenced object must be managed by CRef");
2559 return object->GetPtrProxy();
2568ref.
Reset(
static_cast<C*
>(
object));
2569 object->RemoveReference();
2582 template<
classInterface>
2598 return object->GetPtrProxy();
2611ref.
Reset(
dynamic_cast<Interface*
>(
object));
2612 object->RemoveReference();
2630 template<
classInterface,
classLocker>
2656template<class C, class Locker = typename CWeakLockerTraits<C>::TLockerType>
2777 return!(*
this== right);
2804 template<
classInterface,
classLocker = CWeakInterfaceLocker<Interface> >
2881 template<
classC,
classL>
2883 void swap(NCBI_NS_NCBI::CRef<C,L>& ref1,
2884NCBI_NS_NCBI::CRef<C,L>& ref2)
2890 template<
classC,
classL>
2892 void swap(NCBI_NS_NCBI::CConstIRef<C,L>& ref1,
2893NCBI_NS_NCBI::CConstIRef<C,L>& ref2)
2899 template<
classC,
classL>
2901 void swap(NCBI_NS_NCBI::CIRef<C,L>& ref1,
2902NCBI_NS_NCBI::CIRef<C,L>& ref2)
2908 template<
classC,
classL>
2910 void swap(NCBI_NS_NCBI::CConstRef<C,L>& ref1,
2911NCBI_NS_NCBI::CConstRef<C,L>& ref2)
2917 template<
classC,
classL>
2919 void swap(NCBI_NS_NCBI::CWeakRef<C,L>& ref1,
2920NCBI_NS_NCBI::CWeakRef<C,L>& ref2)
2926 template<
classC,
classL>
2928 void swap(NCBI_NS_NCBI::CWeakIRef<C,L>& ref1,
2929NCBI_NS_NCBI::CWeakIRef<C,L>& ref2)
CWeakInterfaceLocker â.
Interface IAlignRow - abstracts row rendering in Multiple Alignment Widget.
static unsigned char depth[2 *(256+1+29)+1]
bool operator<(const CEquivRange &A, const CEquivRange &B)
const first_type & first() const
const second_type & second() const
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual void x_InitErrCode(CException::EErrCode err_code)
Helper method for initializing error code.
virtual const char * GetErrCodeString(void) const override
Translate from the error code value to its string representation.
#define THROWS_NONE
Do not use 'throw' dynamic exception specification for C++11 compilers.
EErrCode
Error types that an application can generate.
CExpression operator>=(CREATED, time_point)
CExpression operator<=(time_point, CREATED)
void RemoveLastReference(TCount count) const
Remove the last reference.
CConstIRef(TObjectType *ptr, const locker_type &locker_value)
Constructor for explicit type conversion from pointer to object.
CIRef< Interface, Locker > TThisType
void TransferLock(const CObject *object, const CObjectCounterLocker &old_locker) const
CConstRef(const TThisType &ref)
Constructor from an existing CConstRef object.
const T & GetData(void) const
Get data as a reference â const version.
TObjectType * operator->(void) const
Reference operator.
TObjectType * GetNonNullPointer(void)
Get pointer value and throw a null pointer exception if pointer is null.
CWeakObjectLocker< C > TThisType
Alias for this type.
static const int eCounterStep
Skip over the "in heap" bits.
TParent::locker_type locker_type
CConstIRef(CIRef< TDerived > &&ref)
Move constructor from an existing CRef object of derived type.
TPtrProxyType * GetPtrProxy(Interface *ptr) const
Get proxy storage for pointer to object.
TObjectType * GetNCPointerOrNull(void) const THROWS_NONE
Get pointer value.
void Clear(void)
Set pointer to NULL from object's destructor.
void operator-(int) const
TThisType & operator=(TObjectType *ptr)
Assignment operator for const references with right hand side set to a pointer.
CRef< C, Locker > TRefType
Alias for the CRef type.
Locker::TPtrProxyType proxy_type
Alias for pointer proxy type.
bool Empty(void) const THROWS_NONE
Check if CConstRef is empty â not pointing to any object which means having a null value.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
TThisType & operator=(TThisType &&ref)
Move assignment operator for const references.
CConstIRef(TThisType &&ref)
Move constructor from an existing CConstRef object.
TObjectType & operator*(void)
Dereference operator returning object.
BEGIN_STD_SCOPE void swap(NCBI_NS_NCBI::CRef< C, L > &ref1, NCBI_NS_NCBI::CRef< C, L > &ref2)
CWeakRef(TObjectType *ptr, const locker_type &locker_value)
Constructor for explicit type conversion from pointer to object.
pair_base_member< locker_type, TObjectType * > m_Data
Pointer to object.
Locker locker_type
Define alias for locking type.
CRef(const TThisType &ref)
Copy constructor from an existing CRef object.
void TransferLock(const Interface *object, const CInterfaceObjectLocker< Interface > &old_locker) const
TThisType & operator=(const CRef< TDerived, Locker > &ref)
Assignment operator for references of derived types.
TParent::locker_type locker_type
static void ThrowNullPointerException(void)
TThisType & operator=(const CConstIRef< TDerived > &ref)
Assignment operator for references of derived types.
TThisType & operator=(CRef< TDerived, Locker > &&ref)
Move assignment operator for assigning a reference of derived type.
TPtrProxyType * GetPtrProxy(C *object) const
Get proxy storage for pointer to object.
TThisType & operator=(TThisType &&ref)
Move assignment operator for references.
TThisType & operator=(ENull null)
Assignment operator with right hand side set to ENull.
TThisType & operator=(const CIRef< TDerived > &ref)
Assignment operator for assigning a reference to a const reference.
bool operator!(void) const THROWS_NONE
Check if CRef is empty â not pointing to any object, which means having a null value.
TParent::locker_type locker_type
TThisType & operator=(TObjectType *ptr)
Assignment operator for references with right hand side set to a pointer.
void CleanWeakRefs(void) const
Method cleaning all CWeakRefs referencing at this moment to the object After calling to this method a...
CRef(void) THROWS_NONE
Constructor for null pointer.
TObjectType * AtomicSwap(TObjectType *ptr)
TParent::TObjectType TObjectType
void operator-(TObjectType *) const
bool IsNull(void) const THROWS_NONE
Check if pointer is null â same effect as Empty().
const TObjectType * GetPointer(void) const THROWS_NONE
Get pointer â constant version,.
CObjectCounterLocker TLockerType
Default locker type for CRef.
Uint8 TCount
Alias for value type of counter.
TThisType & operator=(const CIRef< TDerived > &ref)
Assignment operator for references of derived types.
bool NotNull(void) const THROWS_NONE
Check if pointer is not null â same effect as NotEmpty().
CWeakIRef(TObjectType *ptr, const locker_type &locker_value)
Constructor for explicit type conversion from pointer to object.
TObjectType & operator*(void) const
Dereference operator returning object.
void AtomicResetFrom(const TThisType &ref)
Reset reference object to new pointer.
void x_LockFromMoveConstructor(const Locker &src_locker)
static const TCount eCounterBitsPlaceMask
Mask for 'in heap' state flags.
static void ReportLockedObjects(bool clear=false)
Print all currently locked objects of monitored type.
TObjectType * GetNCPointer(void) const THROWS_NONE
Get pointer,.
virtual void DoDeleteThisObject(void)
Mark this object as allocated in heap â object can be deleted.
TThisType & operator=(TObjectType *ptr)
Assignment operator for references with right hand side set to a pointer.
void InvalidObject(void) const
Report object is invalid.
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
CWeakRef< Interface, Locker > TParent
void Unlock(const Interface *object) const
static void StopMonitoring(void)
Stop lock/unlock monitoring.
void x_LockFromMoveConstructor(const Locker &src_locker)
CWeakRef(void)
Constructor for null pointer.
const TObjectType * GetNonNullPointer(void) const
Get pointer value and throw a null pointer exception if pointer is null â constant version.
EAllocFillMode
Control filling of newly allocated memory.
TThisType & operator=(ENull)
Assignment operator with right hand side set to ENull.
void Reset(TObjectType *ptr)
Reset the containing pointer to another object.
static void SetAllocFillMode(EAllocFillMode mode)
TThisType & operator=(ENull null)
Assignment operator with right hand side set to ENull.
void operator-(int) const
CRef< proxy_type > m_Proxy
CConstIRef(void) THROWS_NONE
Constructor for null pointer.
CPtrToObjectProxy(CWeakObject *ptr)
typename std::enable_if< std::is_convertible< T *, TObjectType * >::value > enable_if_derived
Helper template to template enable methods only for derived types.
TObjectType * ReleaseOrNull(void)
Release a reference to the object and return a pointer to the object.
static EAllocFillMode GetAllocFillMode(void)
void InitCounter(void)
Initialize counter.
TObjectType * ReleaseOrNull(void)
Release a reference to the object and return a pointer to the object.
CRef(TObjectType *ptr)
Constructor for explicit type conversion from pointer to object.
bool x_AddWeakReference(CObject *obj)
Add reference to the object in "weak" manner.
virtual ~CObject(void)
Destructor.
void Reset(TObjectType *newPtr)
Reset reference object to new pointer.
void x_MoveAssign(const Locker &src_locker, TObjectType *newPtr)
CConstRef(CRef< TDerived, Locker > &&ref)
Move constructor from an existing CRef object of derived type.
virtual void DoNotDeleteThisObject(void)
Mark this object as not allocated in heap â do not delete this object.
void x_AssignFromRef(TObjectType *newPtr)
CConstRef(TObjectType *ptr)
Constructor for explicit type conversion from pointer to object.
void Swap(TThisType &ref)
Swaps the pointer with another reference.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
TObjectType * AtomicSwap(TObjectType *ptr)
TObjectType * GetNonNullNCPointer(void) const
Get pointer value and throw a null pointer exception if pointer is null.
void Relock(const CObject *object) const
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
CRef< Interface, Locker > TParent
CConstRef(void) THROWS_NONE
Constructor for null pointer.
T & GetData(void)
Get data as a reference.
CIRef< Interface, Locker > TRefType
bool operator!=(const TThisType &right)
operator!= to compare with another CWeakRef
CConstRef(TObjectType *ptr, const locker_type &locker_value)
Constructor for explicit type conversion from pointer to object.
void ReleaseReference(void) const
Remove reference without deleting object.
CObjectFor(Args &&... args)
static bool ObjectStateReferencedOnlyOnce(TCount count)
Check if object can be referenced only once.
CConstIRef(CConstIRef< TDerived > &&ref)
Move constructor from an existing CConstRef object of derived type.
CConstIRef(const CIRef< TDerived > &ref)
Constructor from an existing CRef object of derived type.
TThisType & operator=(const TThisType &ref)
Assignment operator for references.
static NCBI_XNCBI_EXPORT void ThrowNullPointerException(void)
Define method to throw null pointer exception.
C element_type
Define alias element_type.
virtual void DebugDump(CDebugDumpContext ddc, unsigned int depth) const
Define method for dumping debug information.
C element_type
Define alias element_type.
CConstRef(TThisType &&ref)
Move constructor from an existing CConstRef object.
CConstIRef(const TThisType &ref)
Constructor from an existing CConstRef object.
virtual ~CWeakObject(void)
static const TCount eCounterBitsCanBeDeleted
Define possible object states.
TThisType & operator=(const TThisType &ref)
Assignment operator for references.
void AddReference(void) const
Add reference to object.
void Reset(void)
Reset reference object.
const TObjectType & operator*(void) const
Dereference operator returning object â constant version.
bool operator==(const CRef< T, L > &r1, ENull)
Comparison operators for CRef<> and CConstRef<> with ENull.
void UnlockRelease(const CObject *object) const
TThisType & operator=(const TThisType &ref)
Assignment operator for references.
CRef(ENull) THROWS_NONE
Constructor for ENull pointer.
#define NCBI_OBJECT_LOCKER_EXPORT
CObjectCounterLocker â Default locker class for CRef/CConstRef templates, all other locker classes sh...
TRefType Lock(void) const
Lock the object and return reference to it.
void operator-(TObjectType *) const
CConstRef< Interface, Locker > TParent
virtual void DeleteThis(void)
Virtual method "deleting" this object.
TThisType & operator=(TThisType &&ref)
Move assignment operator for references.
void Reset(TObjectType *newPtr)
Reset reference object to new pointer.
CPtrToObjectProxy * GetPtrProxy(void) const
Get pointer to proxy object containing pointer to this object.
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty â pointing to an object and has a non-null value.
CIRef< Interface, TThisType > GetLockedObject(TPtrProxyType *proxy) const
Lock the object and return pointer to it stored in the proxy.
TThisType & operator=(const TThisType &ref)
Assignment operator for const references.
CWeakIRef< Interface, Locker > TThisType
void RemoveReference(void) const
Remove reference to object.
bool operator!=(const CRef< T, L > &r1, ENull)
Template operator != function for CRef objects â rhs is null.
const locker_type & GetLocker(void) const
Get reference to locker object.
static bool ObjectStateValid(TCount count)
Check if object state is valid.
static bool ObjectStateReferenced(TCount count)
Check if object can be referenced.
NCBI_XNCBI_EXPORT void CheckReferenceOverflow(TCount count) const
Report that counter has overflowed.
CConstRef< C, Locker > TThisType
Alias for this template type.
CConstIRef< Interface, Locker > TThisType
void Lock(const Interface *object) const
void Swap(TThisType &ref)
Swaps the pointer with another reference.
const TObjectType * GetPointerOrNull(void) const THROWS_NONE
Get pointer value â constant version.
CRef(const CRef< TDerived, Locker > &ref)
Copy constructor from an existing CRef object of derived type.
void AtomicResetFrom(const CConstRef &ref)
Reset reference object to new pointer.
CWeakRef< C, Locker > TThisType
Alias for this type.
static bool ObjectStateIsAllocatedInPool(TCount count)
Check if object is allocated in memory pool.
CRef(TObjectType *ptr, const locker_type &locker_value)
Constructor for explicit type conversion from pointer to object.
void Swap(TThisType &ref)
Swap values of this reference with another.
TThisType & operator=(ENull null)
Assignment from ENull pointer.
T & operator=(const T &data)
Assignment operator.
CConstIRef(TObjectType *ptr)
Constructor for explicit type conversion from pointer to object.
T TObjectType
Define alias for template parameter.
Locker locker_type
Define alias for locking type.
TObjectType * operator->(void)
Reference operator.
void operator+(int) const
bool Referenced(void) const THROWS_NONE
Check if object is referenced.
void operator+(int) const
void UnlockRelease(const Interface *object) const
CConstRef(ENull) THROWS_NONE
Constructor for ENull pointer.
const locker_type & GetLocker(void) const
Get reference to locker object.
TThisType & operator=(TObjectType *ptr)
Assignment operator for references with right hand side set to a pointer.
CObject * x_UpdateCObjectPtr(void)
TRefType Lock(void) const
Lock the object and return reference to it.
bool NotNull(void) const THROWS_NONE
Check if pointer is not null â same effect as NotEmpty().
void Swap(TThisType &ref)
Swaps the pointer with another reference.
void Swap(TThisType &ref)
Swaps the pointer with another reference.
NCBI_EXCEPTION_DEFAULT(CObjectException, CCoreException)
CRef< C, TThisType > GetLockedObject(TPtrProxyType *proxy) const
Lock the object and return pointer to it stored in the proxy.
static void ReportIncompatibleType(const type_info &type)
element_type TObjectType
Define alias TObjectType.
element_type TObjectType
Define alias TObjectType.
bool ReferencedOnlyOnce(void) const THROWS_NONE
Check if object is referenced only once.
TThisType & operator=(ENull)
Assignment operator with right hand side set to ENull.
bool CanBeDeleted(void) const THROWS_NONE
Check if object can be deleted.
TParent::TObjectType TObjectType
TObjectType * GetPointerOrNull(void) const THROWS_NONE
Get pointer value.
const TObjectType * operator->(void) const
Reference operator â constant version.
const TObjectType & GetObject(void) const
Get object â constant version.
CObject & operator=(const CObject &src) THROWS_NONE
Assignment operator.
void x_AssignFromRef(TObjectType *newPtr)
TThisType & operator=(TThisType &&ref)
Move assignment operator for references.
CWeakIRef(TObjectType *ptr)
Constructor for pointer to the interface.
static const TCount eCounterValid
Minimal value for valid objects (reference counter is zero) Must be a single bit value.
CWeakRef(ENull)
Constructor for ENull pointer.
CConstIRef(ENull) THROWS_NONE
Constructor for ENull pointer.
CConstRef(const CConstRef< TDerived, Locker > &ref)
Constructor from an existing CConstRef object of derived type.
void Reset(void)
Reset the containing pointer to null.
CWeakObjectLocker< C > TLockerType
CPtrToObjectProxy TPtrProxyType
Type working as proxy storage for pointer to object.
TObjectType * Release(void)
Release a reference to the object and return a pointer to the object.
CConstRef(CConstRef< TDerived, Locker > &&ref)
Move constructor from an existing CConstRef object of derived type.
static void MonitorObjectType(const type_info &type)
Set monitored object type, e.g.
CPtrToObjectProxy TPtrProxyType
Type working as proxy storage for pointer to object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null â same effect as Empty().
CRef< CPtrToObjectProxy > m_SelfPtrProxy
Proxy object with pointer to this instance.
CIRef(const CIRef< TDerived > &ref)
Constructor from existing ref of derived type.
CWeakIRef(ENull)
Constructor for ENull pointer.
TObjectType & GetObject(void)
Get object.
typename std::enable_if< std::is_convertible< T *, TObjectType * >::value > enable_if_derived
Helper template to template enable methods only for derived types.
CObject * GetLockedObject(void)
Lock the object and return pointer to it.
CIRef(const TThisType &ref)
Constructor from existing ref.
CIRef(TThisType &&ref)
Move constructor from existing ref.
TObjectType * Release(void)
Release a reference to the object and return a pointer to the object.
TThisType & operator=(CIRef< TDerived > &&ref)
Move assignment operator for references of derived types.
CIRef(TObjectType *ptr, const locker_type &locker_value)
Constructor for explicit type conversion from pointer to object.
CWeakRef(TObjectType *ptr)
Constructor for pointer to a particular object.
TParent::TObjectType TObjectType
bool operator!(void) const THROWS_NONE
Check if CConstRef is empty â not pointing to any object, which means having a null value.
bool NotEmpty(void) const THROWS_NONE
Check if CConstRef is not empty â pointing to an object and has a non-null value.
TThisType & operator=(CIRef< TDerived > &&ref)
Move assignment operator for assigning a reference to a const reference.
TThisType & operator=(ENull)
Assignment from ENull pointer.
Locker locker_type
Define alias for locking type.
static void ThrowNullPointerException(void)
TThisType & operator=(const CConstRef< TDerived, Locker > &ref)
Assignment operator for const references of derived types.
void Unlock(const CObject *object) const
C element_type
Define alias element_type.
void x_MoveAssign(const Locker &src_locker, TObjectType *newPtr)
atomic< Uint8 > TCounter
Counter type is CAtomiCounter.
CIRef(ENull) THROWS_NONE
Constructor for ENull pointer.
void AtomicReleaseTo(CConstRef &ref)
Release referenced object to another CConstRef<> object.
CRef(TThisType &&ref)
Move constructor from an existing CRef object.
CWeakInterfaceLocker< Interface > TThisType
Alias for this type.
TThisType & operator=(CConstRef< TDerived, Locker > &&ref)
Move assignment operator for const references of derived types.
static bool ObjectStateCanBeDeleted(TCount count)
Check if object can be deleted.
TThisType & operator=(CRef< TDerived, Locker > &&ref)
Move assignment operator for references of derived types.
const locker_type & GetLocker(void) const
Get reference to locker object.
CRef< C, Locker > TThisType
Alias for this template type.
void Reset(ENull)
Reset the containing pointer to null.
void Lock(const CObject *object) const
CRef(CRef< TDerived, Locker > &&ref)
Move constructor from an existing CRef object of derived type.
CIRef(TObjectType *ptr)
Constructor for explicit type conversion from pointer to object.
CObjectCounterLocker TLockerType
CObject(void)
Constructor.
TObjectType * GetPointerOrNull(void) THROWS_NONE
Get pointer value.
bool operator==(const TThisType &right)
operator== to compare with another CWeakRef
static NCBI_XNCBI_EXPORT void ReportIncompatibleType(const type_info &type)
Report about trying to convert incompatible interface fo CObject.
CWeakIRef(void)
Constructor for null pointer.
CIRef(void) THROWS_NONE
Constructor for null pointer.
static const TCount eCounterBitsInPlainHeap
Heap signature was found.
TObjectType & GetNCObject(void) const
Get object.
pair_base_member< locker_type, TObjectType * > m_Data
Pointer to object.
TThisType & operator=(const CRef< TDerived, Locker > &ref)
Assignment operator for assigning a reference of derived type.
const element_type TObjectType
Define alias TObjectType.
CConstIRef(const CConstIRef< TDerived > &ref)
Constructor from an existing CConstRef object of derived type.
TCounter m_Counter
The actual reference counter.
~CConstRef(void)
Destructor.
static bool ObjectStateUnreferenced(TCount count)
Check if object can be referenced.
CConstRef(const CRef< TDerived, Locker > &ref)
Constructor from an existing CRef object of derived type.
bool IsAllocatedInPool(void) const THROWS_NONE
Check if object is allocated in memory pool (not system heap)
TObjectType & GetObject(void) const
Get object.
void AtomicReleaseTo(TThisType &ref)
Release referenced object to another CRef<> object.
void Relock(const Interface *object) const
void Swap(TThisType &ref)
Swap values of this reference with another.
T m_Data
Data member of template parameter type.
TObjectType * GetNonNullPointer(void) const
Get pointer value and throw a null pointer exception if pointer is null.
CIRef(CIRef< TDerived > &&ref)
Move constructor from existing ref of derived type.
TThisType & operator=(CConstIRef< TDerived > &&ref)
Move assignment operator for references of derived types.
static const TCount eCounterStateMask
Valid object, and object in heap.
bool Empty(void) const THROWS_NONE
Check if CRef is empty â not pointing to any object, which means having a null value.
@ eDeleted
Attempt to delete a deleted object.
@ eRefDelete
Attempt to delete valid reference.
@ eCorrupted
Object corrupted error.
@ eRefOverflow
Reference overflow error.
@ eNoRef
Attempt to access an object that is unreferenced.
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_STD_SCOPE
Place it for adding new funtionality to STD scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define END_STD_SCOPE
End previously defined STD scope.
#define NCBI_XNCBI_EXPORT
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Defines MS Windows specifics for our "C++" code.
Multi-threading â atomic pointer exchange function.
void * SwapPointers(void *volatile *location, void *new_value)
static const sljit_gpr r1
static const sljit_gpr r2
bool operator>(const typename tree< T, tree_node_allocator >::iterator_base &one, const typename tree< T, tree_node_allocator >::iterator_base &two)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4