Free Electron
Public Member Functions | Private Member Functions | Private Attributes | List of all members
fe::cp< T > Class Template Reference

Copy-On-Write shared pointer. More...

#include <Protectable.h>

Inheritance diagram for fe::cp< T >:
Inheritance graph
[legend]

Public Member Functions

 cp (T *pT)
 
 cp (const cp< T > &rcpT)
 
 cp (const sp< T > &rspT)
 
template<typename X >
 cp (const cp< X > &rcpX)
 
template<typename X >
 cp (const sp< X > &rspX)
 
template<typename X >
 cp (const hp< X > &rhpX)
 
cp< T > & operator= (T *pT)
 
cp< T > & operator= (const cp< T > &rcpT)
 
cp< T > & operator= (const sp< T > &rspT)
 
template<typename X >
cp< T > & operator= (const cp< X > &rcpX)
 
template<typename X >
cp< T > & operator= (const sp< X > &rspX)
 
template<typename X >
cp< T > & operator= (const hp< X > &rhpX)
 
const T * operator-> (void) const
 
const T * raw (void) const
 
T * writable (void)
 
I32 protection (void) const
 
void protect (void)
 
void unprotect (void)
 
- Public Member Functions inherited from fe::sp< T >
 sp (T *pT)
 
 sp (const sp< T > &rspT)
 
template<typename X >
 sp (const sp< X > &rspX)
 
template<typename X >
 sp (const hp< X > &rhpX)
 
sp< T > & operator= (T *pT)
 
sp< T > & operator= (const sp< T > &rspT)
 
template<typename X >
sp< T > & operator= (const sp< X > &rspX)
 
template<typename X >
bool is (void)
 
template<typename X >
sp< T > & operator= (const hp< X > &rhpX)
 
T & operator* (void)
 
const T & operator* (void) const
 
T * operator-> (void) const
 
const T * asConst (void) const
 
T * abandon (void)
 
T * raw (void) const
 
BWORD isValid (void) const
 
BWORD isNull (void) const
 

Private Member Functions

void releaseProtection (void)
 

Private Attributes

I32 m_protection
 

Additional Inherited Members

Detailed Description

template<typename T>
class fe::cp< T >

Copy-On-Write shared pointer.

This mechanism is very similar to sp<> except that the plain pointer operator will return only as const.

To access a member in a writable fashion, you must use the writable() method. If the shared object is protected by any cp<> except the caller, the writable() method will clone the object. A clone starts unprotected.


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