k3d::data::node_storage< value_t, signal_policy_t > Class Template Reference

Storage policy for data containers that store a pointer to a document node that could be deleted by the user at any time - note that value_t should be the interface type used to access the node. More...

#include <data.h>

List of all members.

Classes

class  value_container
 Provides an implementation of istate_container for storing nodes by value (ValueType must have a copy constructor and assignment operator). More...

Public Member Functions

value_t internal_value ()
 Returns an interface pointer to the node (could be NULL).
inodeinternal_node ()
 Returns the underlying node (could be NULL).
bool allow_none ()
 Returns true iff the value is allowed to be NULL.
bool allow (iplugin_factory &Factory)
 Returns true iff the given factory creates an node that could be stored by this container.
bool allow (inode &Object)
 Returns true iff the given node coult be stored by this container.

Protected Member Functions

template<typename init_t >
 node_storage (const init_t &Init)
virtual ~node_storage ()
void on_node_deleted ()
void start_recording (istate_recorder &StateRecorder)
 Optionally called to store the original state of the data prior to modification.
void set_value (value_t Value, ihint *const Hint)
 Sets a new value for the data.
void finish_recording (istate_recorder &StateRecorder)
 Optionally called to store the new state of the data after one-or-more modifications.

Private Member Functions

virtual void internal_set_value (const value_t &, ihint *const)
 This little bit of magic allows us to "call" the derived undo policy when our state is modified internally, e.g. if the node is deleted.

Private Attributes

inodem_node
 Local storage for the node stored by this policy.
sigc::connection m_node_deleted_connection
sigc::connection m_node_changed_connection

Detailed Description

template<typename value_t, class signal_policy_t>
class k3d::data::node_storage< value_t, signal_policy_t >

Storage policy for data containers that store a pointer to a document node that could be deleted by the user at any time - note that value_t should be the interface type used to access the node.


Constructor & Destructor Documentation

template<typename value_t , class signal_policy_t >
template<typename init_t >
k3d::data::node_storage< value_t, signal_policy_t >::node_storage ( const init_t &  Init  )  [inline, protected]
template<typename value_t , class signal_policy_t >
virtual k3d::data::node_storage< value_t, signal_policy_t >::~node_storage (  )  [inline, protected, virtual]

Member Function Documentation

template<typename value_t , class signal_policy_t >
bool k3d::data::node_storage< value_t, signal_policy_t >::allow ( inode Object  )  [inline]

Returns true iff the given node coult be stored by this container.

template<typename value_t , class signal_policy_t >
bool k3d::data::node_storage< value_t, signal_policy_t >::allow ( iplugin_factory Factory  )  [inline]

Returns true iff the given factory creates an node that could be stored by this container.

References k3d::iplugin_factory::implements().

template<typename value_t , class signal_policy_t >
bool k3d::data::node_storage< value_t, signal_policy_t >::allow_none (  )  [inline]

Returns true iff the value is allowed to be NULL.

template<typename value_t , class signal_policy_t >
void k3d::data::node_storage< value_t, signal_policy_t >::finish_recording ( istate_recorder StateRecorder  )  [inline, protected]

Optionally called to store the new state of the data after one-or-more modifications.

References k3d::istate_recorder::current_change_set(), k3d::data::node_storage< value_t, signal_policy_t >::m_node, and k3d::state_change_set::record_new_state().

template<typename value_t , class signal_policy_t >
inode* k3d::data::node_storage< value_t, signal_policy_t >::internal_node (  )  [inline]

Returns the underlying node (could be NULL).

References k3d::data::node_storage< value_t, signal_policy_t >::m_node.

template<typename value_t , class signal_policy_t >
virtual void k3d::data::node_storage< value_t, signal_policy_t >::internal_set_value ( const value_t &  ,
ihint const 
) [inline, private, virtual]

This little bit of magic allows us to "call" the derived undo policy when our state is modified internally, e.g. if the node is deleted.

Referenced by k3d::data::node_storage< value_t, signal_policy_t >::on_node_deleted().

template<typename value_t , class signal_policy_t >
value_t k3d::data::node_storage< value_t, signal_policy_t >::internal_value (  )  [inline]

Returns an interface pointer to the node (could be NULL).

References k3d::data::node_storage< value_t, signal_policy_t >::m_node.

template<typename value_t , class signal_policy_t >
void k3d::data::node_storage< value_t, signal_policy_t >::on_node_deleted (  )  [inline, protected]
template<typename value_t , class signal_policy_t >
void k3d::data::node_storage< value_t, signal_policy_t >::set_value ( value_t  Value,
ihint *const   Hint 
) [inline, protected]
template<typename value_t , class signal_policy_t >
void k3d::data::node_storage< value_t, signal_policy_t >::start_recording ( istate_recorder StateRecorder  )  [inline, protected]

Optionally called to store the original state of the data prior to modification.

References k3d::istate_recorder::current_change_set(), k3d::data::node_storage< value_t, signal_policy_t >::m_node, and k3d::state_change_set::record_old_state().


Member Data Documentation

template<typename value_t , class signal_policy_t >
inode* k3d::data::node_storage< value_t, signal_policy_t >::m_node [private]
template<typename value_t , class signal_policy_t >
sigc::connection k3d::data::node_storage< value_t, signal_policy_t >::m_node_changed_connection [private]
template<typename value_t , class signal_policy_t >
sigc::connection k3d::data::node_storage< value_t, signal_policy_t >::m_node_deleted_connection [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