28 #ifndef PTLIB_SHAREDPTR_H
29 #define PTLIB_SHAREDPTR_H
38 #if __cplusplus < 201103L
63 {
ptr = v.release(); }
120 template <
typename T>
using PSharedPtr = std::shared_ptr<T>;
122 #endif // __cplusplus
124 #endif // PTLIB_SHAREDPTR_H
virtual PBoolean MakeUnique()
Make this instance to be the one and only reference to the container contents.
PSharedPtr(std::auto_ptr< element_type > &v)
Definition: psharedptr.h:62
void DestroyContents()
Destroy the container contents.
Definition: psharedptr.h:104
void Destruct()
Internal function called from container destructors.
PBoolean SetSize(PINDEX)
Set the new current size of the container.
Definition: psharedptr.h:74
PSharedPtr(const PSharedPtr &c)
Definition: psharedptr.h:58
element_type * operator->() const
Definition: psharedptr.h:92
virtual PBoolean MakeUnique()
Make this instance to be the one and only reference to the container contents.
Definition: psharedptr.h:71
PSharedPtr & operator=(const PSharedPtr &c)
Definition: psharedptr.h:65
virtual void AssignContents(const PContainer &c)
Copy the container contents.
element_type & operator*() const
Definition: psharedptr.h:89
PSharedPtr(element_type *p=NULL)
Definition: psharedptr.h:55
bool PBoolean
Definition: object.h:174
P_DEPRECATED void Reset()
Definition: psharedptr.h:86
void CopyContents(const PContainer &c)
Definition: psharedptr.h:110
Abstract class to embody the base functionality of a container.
Definition: contain.h:99
void CloneContents(const PContainer *src)
Definition: psharedptr.h:107
PSharedPtr(int dummy, const PSharedPtr *c)
Definition: psharedptr.h:97
virtual ~PSharedPtr()
Definition: psharedptr.h:68
#define P_DEPRECATED
Definition: object.h:141
T element_type
Definition: psharedptr.h:53
element_type * ptr
Definition: psharedptr.h:114
void reset(element_type *p=NULL)
Definition: psharedptr.h:83
void AssignContents(const PContainer &c)
Copy the container contents.
Definition: psharedptr.h:101
These templates implement an pointner class with an integral reference count based on the PContainer ...
Definition: psharedptr.h:49
P_DEPRECATED element_type * Get() const
Definition: psharedptr.h:80