2#ifndef _aspose_system_weak_ptr_h_
3#define _aspose_system_weak_ptr_h_
28 using SmartPtr_::m_data;
48 template<class Q, typename = typename std::enable_if<std::is_convertible<Q*, Pointee_*>::value>::type>
60 template<class Q, typename = typename std::enable_if<std::is_convertible<Q*, Pointee_*>::value>::type>
75 SmartPtr_::operator = (value);
82 return SmartPtr_::operator == (
nullptr);
89 return m_data.IsNull();
96 return m_data.IsNull() ? nullptr : m_data.WeakGetCounter()->GetObject();
108struct BasePointerType<
WeakPtr<T>>
119 if (object_ptr ==
nullptr)
120 *stream <<
"nullptr";
132 if (object_ptr !=
nullptr)
133 stream << object_ptr->ToString();
144 if (object_ptr !=
nullptr)
145 stream << object_ptr->ToString();
154template<
class X >
struct RemoveShared<
System::WeakPtr<X>> {
typedef X
type; };
168 struct hash<
System::WeakPtr<T> >
173 using result_type = std::size_t;
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
int GetHashCode() const
Calls GetHashCode() on pointed object.
Definition: smart_ptr.h:877
T Pointee_
Pointed type.
Definition: smart_ptr.h:183
Subclass of System::SmartPtr which sets itself to weak mode at construction. Please note that this cl...
Definition: weak_ptr.h:18
WeakPtr(SmartPtr_ &&x)
Move-constructs weak pointer.
Definition: weak_ptr.h:66
WeakPtr(Pointee_ *object)
Creates weak pointer to given object.
Definition: weak_ptr.h:37
WeakPtr(const SmartPtr< Q > &x)
Creates weak pointer referencing same pointer x points to.
Definition: weak_ptr.h:49
WeakPtr(std::nullptr_t=nullptr)
Creates null pointer.
Definition: weak_ptr.h:32
WeakPtr(const WeakPtr_ &ptr)
Copy-constructs weak pointer.
Definition: weak_ptr.h:54
SmartPtr< T > SmartPtr_
Alias for corresponding SmartPtr class.
Definition: weak_ptr.h:21
WeakPtr(const WeakPtr< Q > &x)
Copy-constructs weak pointer.
Definition: weak_ptr.h:61
WeakPtr(const SmartPtr_ &ptr)
Creates weak pointer referencing same pointer ptr points to.
Definition: weak_ptr.h:42
Object * get_weak() const
Gets referenced object. Asserts that pointer is in weak mode.
Definition: weak_ptr.h:93
bool expired() const
Checks if referenced object was already deleted.
Definition: weak_ptr.h:86
WeakPtr< T > WeakPtr_
Alias for self type.
Definition: weak_ptr.h:23
Definition: db_command.h:9
void PrintTo(DateTime value, std::ostream *stream)
Prints value to ostream. Mostly used for debug.
SmartPtrMode
SmartPtr pointer type: weak or shared. Defines whether pointer is being counted when it is being deci...
Definition: smart_ptr.h:68
@ Weak
Weak mode: pointer does not participate in reference counting.
std::ostream & operator<<(std::ostream &stream, DateTime date_time)
Insert data into the stream using UTF-8 encoding.
Definition: date_time.h:729
bool operator==(ArraySegment< T > a, ArraySegment< T > b)
Definition: array_segment.h:151
Traits class to check if specific class is a specialization of System::WeakPtr. Doesn't check if inst...
Definition: weak_ptr.h:102
Trait structs to remove SharedPtr/WeakPtr from argument type.
Definition: weak_ptr.h:150
X type
Definition: weak_ptr.h:150
Trait struct to convert argument type to a weak-pointer, if it is a pointer type.
Definition: weak_ptr.h:159
Tests if specific type is a specialization of specific template. If it is, inherits std::true_type,...
Definition: detail.h:80