ecto
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ecto::spore< T > Class Template Reference

The spore is a typed handle for tendrils, making holding onto tendrils a bit easier. More...

#include <spore.hpp>

Public Types

typedef spore< T > this_type
 
typedef T value_type
 
typedef T & reference_type
 
typedef T * pointer_type
 
typedef const T * const_pointer_type
 
typedef tendril_ptr this_type::* unspecified_bool_type
 

Public Member Functions

 spore ()
 
 spore (tendril_ptr t)
 
spore< T > & set_callback (typename boost::function1< void, T > cb)
 
spore< T > & notify ()
 
spore< T > & set_doc (const std::string &doc)
 
spore< T > & set_default_val (const T &val)
 
bool dirty () const
 
void dirty (bool d)
 
bool user_supplied () const
 
bool has_default () const
 
spore< T > & required (bool b)
 
bool required () const
 
pointer_type operator-> ()
 
const_pointer_type operator-> () const
 
reference_type operator* ()
 
const_pointer_type operator* () const
 
 operator unspecified_bool_type () const
 

Private Member Functions

tendril_ptr get ()
 
tendril_cptr get () const
 

Private Attributes

tendril_ptr tendril_
 

Detailed Description

template<typename T>
class ecto::spore< T >

The spore is a typed handle for tendrils, making holding onto tendrils a bit easier.

Member Typedef Documentation

template<typename T>
typedef const T* ecto::spore< T >::const_pointer_type
template<typename T>
typedef T* ecto::spore< T >::pointer_type
template<typename T>
typedef T& ecto::spore< T >::reference_type
template<typename T>
typedef spore<T> ecto::spore< T >::this_type
template<typename T>
typedef tendril_ptr this_type::* ecto::spore< T >::unspecified_bool_type
template<typename T>
typedef T ecto::spore< T >::value_type

Constructor & Destructor Documentation

template<typename T>
ecto::spore< T >::spore ( )
inline

Allocates a spore that doesn't point to anything.

template<typename T>
ecto::spore< T >::spore ( tendril_ptr  t)
inline

implicit constructor from a tendril ptr. Needs to be a shared_ptr and uses this to ensure that the spore always points to valid tendril.

Member Function Documentation

template<typename T>
bool ecto::spore< T >::dirty ( ) const
inline
template<typename T>
void ecto::spore< T >::dirty ( bool  d)
inline
template<typename T>
tendril_ptr ecto::spore< T >::get ( )
inlineprivate

Grab a pointer to the tendril that this spore points to.

Returns
non const pointer to tendril
template<typename T>
tendril_cptr ecto::spore< T >::get ( ) const
inlineprivate

Grab a pointer to the tendril that this spore points to. const overload.

Returns
const pointer to tendril
template<typename T>
bool ecto::spore< T >::has_default ( ) const
inline
template<typename T>
spore<T>& ecto::spore< T >::notify ( )
inline
template<typename T>
ecto::spore< T >::operator unspecified_bool_type ( ) const
inline
template<typename T>
reference_type ecto::spore< T >::operator* ( )
inline
template<typename T>
const_pointer_type ecto::spore< T >::operator* ( ) const
inline
template<typename T>
pointer_type ecto::spore< T >::operator-> ( )
inline
template<typename T>
const_pointer_type ecto::spore< T >::operator-> ( ) const
inline
template<typename T>
spore<T>& ecto::spore< T >::required ( bool  b)
inline
template<typename T>
bool ecto::spore< T >::required ( ) const
inline
template<typename T>
spore<T>& ecto::spore< T >::set_callback ( typename boost::function1< void, T >  cb)
inline

Set a typed callback, that will be called when ever the tendril value is changed by the user.

Parameters
cbThe callback
Returns
ref to this spore, for chaining.
template<typename T>
spore<T>& ecto::spore< T >::set_default_val ( const T &  val)
inline
template<typename T>
spore<T>& ecto::spore< T >::set_doc ( const std::string &  doc)
inline
template<typename T>
bool ecto::spore< T >::user_supplied ( ) const
inline

Member Data Documentation

template<typename T>
tendril_ptr ecto::spore< T >::tendril_
private

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