Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Protected Attributes | List of all members
net_instaweb::RefCountedObj< T > Class Template Reference

#include "ref_counted_ptr.h"


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< Datadata_ptr_

Detailed Description

template<class T>
class net_instaweb::RefCountedObj< T >

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.

Member Function Documentation

template<class T>
void net_instaweb::RefCountedObj< T >::reset ( const T &  val)

Sets the object to contain a new value, detaching it from any other RefCountedObj instances that were previously sharing data.

template<class T>
bool net_instaweb::RefCountedObj< T >::unique ( ) const

Determines whether any other RefCountedObj objects share the same storage. This can be used to create copy-on-write semantics if desired.

The documentation for this class was generated from the following file: