net/instaweb/util/public/ref_counted_ptr.h File Reference

#include "net/instaweb/util/public/basictypes.h"
#include "base/memory/ref_counted.h"

Go to the source code of this file.

Classes

class  net_instaweb::RefCounted< T >
class  net_instaweb::RefCountedPtr< T >
class  net_instaweb::RefCountedObj< T >
struct  net_instaweb::RefCountedObj< T >::Data

Namespaces

namespace  net_instaweb
 

NOLINT.


Defines

#define REFCOUNT_SHARED_MEM_IMPL_CLASS   base::RefCountedThreadSafe
#define REFCOUNT_FRIEND_DECLARATION(class_name)   friend class REFCOUNT_SHARED_MEM_IMPL_CLASS<class_name>

Detailed Description

Implements a generic ref-counted class, with full sharing. This class does *not* implement copy-on-write semantics, but it provides 'unique()', which helps implement COW at a higher level.

There are two pointer templates here:

Todo:
TODO(jmaessen): explore adding C++x0 shared_ptr support

Define Documentation

#define REFCOUNT_FRIEND_DECLARATION ( class_name   )     friend class REFCOUNT_SHARED_MEM_IMPL_CLASS<class_name>

Macro for users implementing C++ ref-counted classes to prevent explicit destruction. Once a class is reference counted, it should never be stack-allocated or explicitly deleted. It should only be deleted by the reference count object. Put this declaration in the 'protected:' or 'private:' section, and group it with a destructor declaration.

This is only required for RefCountedPtr<T>, not RefCountedObj<T>.

#define REFCOUNT_SHARED_MEM_IMPL_CLASS   base::RefCountedThreadSafe

Helper macro to allow declaration of user-visible macro REFCOUNT_DISALLOW_EXPLICIT_DESTROY which is used to generate compile-time errors for code that deletes ref-counted objects explicitly.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:33:45 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3