k3d::data::pointer_storage< pointer_t, signal_policy_t > Class Template Reference

Read-only storage policy that stores a value by pointer, created on-demand. More...

#include <data.h>

List of all members.

Public Types

typedef boost::remove_pointer
< pointer_t >::type 
non_pointer_t
typedef pointer_storage
< pointer_t, signal_policy_t > 
this_t

Public Member Functions

void set_initialize_slot (const sigc::slot< void, non_pointer_t & > &Slot)
 Set a slot that will be called to initialize the value when first created.
void set_update_slot (const sigc::slot< void, non_pointer_t & > &Slot)
 Set the slot that will be called to update the value whenever it changes.
sigc::slot< void, ihint * > make_reset_slot ()
 Returns a slot that will invoke the reset() method.
sigc::slot< void, ihint * > make_update_slot ()
 Returns a slot that will invoke the update() method.
void reset (pointer_t NewValue=0, ihint *const Hint=0)
 Store an object as the new value, taking control of its lifetime.
void update (ihint *const Hint=0)
 Schedule an update for the value the next time it's read.
pointer_t internal_value ()
 Accesses the underlying value, creating it if it doesn't already exist.

Protected Member Functions

template<typename init_t >
 pointer_storage (const init_t &Init)

Private Member Functions

 BOOST_STATIC_ASSERT ((boost::is_pointer< pointer_t >::value))

Private Attributes

std::auto_ptr< non_pointer_tm_value
 Storage for this policy's value.
bool m_update
 Set to true if this policy's value is stale and needs to be updated.
sigc::slot< void, non_pointer_t & > m_initialize_slot
 Stores a slot that will be executed to initialize this policy's value.
sigc::slot< void, non_pointer_t & > m_update_slot
 Stores a slot that will be executed to update this policy's value.
bool m_executing
 Set to true during initialization / update of the policy value, to prevent problems with recursion.

Detailed Description

template<typename pointer_t, typename signal_policy_t>
class k3d::data::pointer_storage< pointer_t, signal_policy_t >

Read-only storage policy that stores a value by pointer, created on-demand.

Deprecated:
Use pointer_demand_storage instead

Member Typedef Documentation

template<typename pointer_t , typename signal_policy_t >
typedef boost::remove_pointer<pointer_t>::type k3d::data::pointer_storage< pointer_t, signal_policy_t >::non_pointer_t
template<typename pointer_t , typename signal_policy_t >
typedef pointer_storage<pointer_t, signal_policy_t> k3d::data::pointer_storage< pointer_t, signal_policy_t >::this_t

Constructor & Destructor Documentation

template<typename pointer_t , typename signal_policy_t >
template<typename init_t >
k3d::data::pointer_storage< pointer_t, signal_policy_t >::pointer_storage ( const init_t &  Init  )  [inline, protected]

Member Function Documentation

template<typename pointer_t , typename signal_policy_t >
k3d::data::pointer_storage< pointer_t, signal_policy_t >::BOOST_STATIC_ASSERT ( (boost::is_pointer< pointer_t >::value)   )  [private]
template<typename pointer_t , typename signal_policy_t >
pointer_t k3d::data::pointer_storage< pointer_t, signal_policy_t >::internal_value (  )  [inline]
template<typename pointer_t , typename signal_policy_t >
sigc::slot<void, ihint*> k3d::data::pointer_storage< pointer_t, signal_policy_t >::make_reset_slot (  )  [inline]

Returns a slot that will invoke the reset() method.

References k3d::data::pointer_storage< pointer_t, signal_policy_t >::reset().

template<typename pointer_t , typename signal_policy_t >
sigc::slot<void, ihint*> k3d::data::pointer_storage< pointer_t, signal_policy_t >::make_update_slot (  )  [inline]

Returns a slot that will invoke the update() method.

References k3d::data::pointer_storage< pointer_t, signal_policy_t >::update().

template<typename pointer_t , typename signal_policy_t >
void k3d::data::pointer_storage< pointer_t, signal_policy_t >::reset ( pointer_t  NewValue = 0,
ihint *const   Hint = 0 
) [inline]
template<typename pointer_t , typename signal_policy_t >
void k3d::data::pointer_storage< pointer_t, signal_policy_t >::set_initialize_slot ( const sigc::slot< void, non_pointer_t & > &  Slot  )  [inline]

Set a slot that will be called to initialize the value when first created.

References k3d::data::pointer_storage< pointer_t, signal_policy_t >::m_initialize_slot, and k3d::data::pointer_storage< pointer_t, signal_policy_t >::reset().

template<typename pointer_t , typename signal_policy_t >
void k3d::data::pointer_storage< pointer_t, signal_policy_t >::set_update_slot ( const sigc::slot< void, non_pointer_t & > &  Slot  )  [inline]

Set the slot that will be called to update the value whenever it changes.

References k3d::data::pointer_storage< pointer_t, signal_policy_t >::m_update_slot, and k3d::data::pointer_storage< pointer_t, signal_policy_t >::update().

template<typename pointer_t , typename signal_policy_t >
void k3d::data::pointer_storage< pointer_t, signal_policy_t >::update ( ihint *const   Hint = 0  )  [inline]

Member Data Documentation

template<typename pointer_t , typename signal_policy_t >
bool k3d::data::pointer_storage< pointer_t, signal_policy_t >::m_executing [private]
template<typename pointer_t , typename signal_policy_t >
sigc::slot<void, non_pointer_t&> k3d::data::pointer_storage< pointer_t, signal_policy_t >::m_initialize_slot [private]
template<typename pointer_t , typename signal_policy_t >
bool k3d::data::pointer_storage< pointer_t, signal_policy_t >::m_update [private]
template<typename pointer_t , typename signal_policy_t >
sigc::slot<void, non_pointer_t&> k3d::data::pointer_storage< pointer_t, signal_policy_t >::m_update_slot [private]
template<typename pointer_t , typename signal_policy_t >
std::auto_ptr<non_pointer_t> k3d::data::pointer_storage< pointer_t, signal_policy_t >::m_value [private]

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

Generated on Mon Mar 21 07:42:19 2011 for K-3D by doxygen 1.6.3