Page Speed Optimization Libraries
1.13.35.1
|
#include "ref_counted_ptr.h"
Classes | |
struct | Data |
Public Member Functions | |
RefCountedObj (const T &val) | |
bool | unique () const |
T * | get () |
const T * | get () const |
T * | operator-> () |
const T * | operator-> () const |
T & | operator* () |
const T & | operator* () const |
void | reset (const T &val) |
Protected Attributes | |
RefCountedPtr< Data > | data_ptr_ |
If you can't inherit off RefCounted due to using a pre-existing class, you can use RefCountedObj instead. This however is limited to having a single type (so no polymorphism). It also has slightly different semantics in that it initializes to a default-constructed object and not NULL.
|
inline |
Sets the object to contain a new value, detaching it from any other RefCountedObj instances that were previously sharing data.
|
inline |
Determines whether any other RefCountedObj objects share the same storage. This can be used to create copy-on-write semantics if desired.