Smart Pointers

deep_copy_policy Class Template Reference

#include <smart_ptr.hpp>

List of all members.


Detailed Description

template<class LOCK_POLICY = lock_default_policy>
class deep_copy_policy< LOCK_POLICY >

This is a deep copy (Clone) ownership policy. This policy is similar to most clone smart pointers. However, when use with default allocator policy, this type of policy does NOT require that the pointee have a clone function implementation.
Example Usage.

#include "../shape_test.h"

void example_deep_copy_policy_usage()
{
        smart_ptr<ShapeWithNoCloneLogic, deep_copy_policy<> > 
                pShapeWithNoCloneLogic1 = new CircleWithNoCloneLogic;

        smart_ptr<ShapeWithNoCloneLogic, deep_copy_policy<> > 
                pShapeWithNoCloneLogic2(pShapeWithNoCloneLogic1);
        cout << pShapeWithNoCloneLogic2->GetTypeName() << endl;

        smart_ptr<Shape, deep_copy_policy<> > pShape1 = new Square("Blue");
        smart_ptr<Shape, deep_copy_policy<> > pShape2 = pShape1;
        cout << pShape2->GetShapeName() << endl;
}

See also:
smart_ptr, copy_on_write_policy, shared_ptr_policy, allocator_default_policy, clone_function_allocator_policy, clone_static_function_allocator_policy, intrusive_lock_policy

Definition at line 856 of file smart_ptr.hpp.

Public Member Functions

 deep_copy_policy ()
template<class T1, class F1, class T2>
 deep_copy_policy (deep_copy_policy &, T1 type_src, F1 clone_fct, T2 &type_target)
template<class T, class F, class LCK>
void release (T &type, F clone_fct, LCK &)
template<class T1, class F1, class T2, class F2, class LCK>
void assign (T1 &type1, F1 &clone_fct1, T2 type2, const F2 clone_fct2, deep_copy_policy &, LCK &lck_policy)
template<class T, class F>
T & get_non_constant_ptr (T &type, const F &)


The documentation for this class was generated from the following file:
Generated on Wed Mar 29 21:58:59 2006 for Smart Pointers by  doxygen 1.4.6.Axter [Axter-Extended-Version]