Page Speed Optimization Libraries  1.2.24.1
Classes | Public Member Functions | Friends
RefCountedOwner< T > Class Template Reference

See file comment. NET_INSTAWEB_UTIL_PUBLIC_REF_COUNTED_OWNER_H_. More...

#include "ref_counted_owner.h"

List of all members.

Classes

class  Family

Public Member Functions

 RefCountedOwner (Family *family)
bool Attach ()
void Initialize (T *value)
T * Get ()
const T * Get () const

Friends

class Family

Detailed Description

template<typename T>
class RefCountedOwner< T >

See file comment. NET_INSTAWEB_UTIL_PUBLIC_REF_COUNTED_OWNER_H_.


Constructor & Destructor Documentation

template<typename T >
RefCountedOwner< T >::RefCountedOwner ( Family family) [inline, explicit]

Instances of RefCountedOwner that share the same 'family' object will share an instance of T.


Member Function Documentation

template<typename T >
bool RefCountedOwner< T >::Attach ( ) [inline]

If an another member of the family has already created the managed object, Attach() will return true and attach 'this' to it, making the object accessible via get() and pointer operations.

Otherwise, it returns false, and you should call Initialize() to set the object.

< we are already attached, no need to initialize.

Someone already made an instance

If need to create it.

template<typename T >
T* RefCountedOwner< T >::Get ( ) [inline]

Note that you must call Attach() (and Initialize() if it returned false) before using these.

template<typename T >
void RefCountedOwner< T >::Initialize ( T *  value) [inline]

Sets the value of the object our family will share. Pre-condition: one must not have been set already (in other words, this must only be called if Attach() returned false).


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines