Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

pqxxobject::field< T > Class Template Reference

Database field template class. More...

#include <field.h>

List of all members.

Public Types

typedef T value_type

Public Member Functions

 field ()
 The constructor.

 field (const value_type &value)
 The constructor.

 field (const field< value_type > &rhs)
 The copy constructor.

virtual ~field ()
const value_typeoperator-> () const
 Access member functions.

const value_typeoperator * () const
field< value_type > & operator= (const field< value_type > &rhs)
 Overloaded assignment operator.

field< value_type > & operator= (const value_type &rhs)
 Overloaded assignment operator.

 operator const value_type & () const
 Conversion operator.

value_typeget_value ()
 Get the contained value by reference.

const value_typeget_value () const
 Get the contained value by constant reference.

void set_value (const value_type &value)
 Set the contained value.

SigC::Signal0< void > & signal_changed ()
 Signal emitted on value change.


Private Attributes

value_type m_value
 The contained value.

SigC::Signal0< void > m_signal_changed
 The changed signal.


Detailed Description

template<typename T>
class pqxxobject::field< T >

Database field template class.

This class is used to represent a single field in a row of a table. This is a single value belonging to a column in a row, rather than the whole column.

As well as storing value, the class has the ability to emit signals when the field value is changed. Listeners (e.g. user interface widgets) may connect to the signal and will receive notification of changes as they occur.

Definition at line 58 of file field.h.


Member Typedef Documentation

template<typename T>
typedef T pqxxobject::field< T >::value_type
 

Definition at line 61 of file field.h.

Referenced by pqxxobject::field< T >::field(), pqxxobject::field< T >::get_value(), pqxxobject::field< T >::operator *(), pqxxobject::field< T >::operator->(), pqxxobject::field< T >::operator=(), and pqxxobject::field< T >::set_value().


Constructor & Destructor Documentation

template<typename T>
pqxxobject::field< T >::field  )  [inline]
 

The constructor.

Definition at line 64 of file field.h.

References pqxxobject::field< T >::m_value.

template<typename T>
pqxxobject::field< T >::field const value_type value  )  [inline]
 

The constructor.

Definition at line 69 of file field.h.

References pqxxobject::field< T >::m_value, and pqxxobject::field< T >::value_type.

template<typename T>
pqxxobject::field< T >::field const field< value_type > &  rhs  )  [inline]
 

The copy constructor.

Definition at line 74 of file field.h.

References pqxxobject::field< T >::m_signal_changed, and pqxxobject::field< T >::m_value.

template<typename T>
virtual pqxxobject::field< T >::~field  )  [inline, virtual]
 

Definition at line 79 of file field.h.


Member Function Documentation

template<typename T>
const value_type& pqxxobject::field< T >::get_value  )  const [inline]
 

Get the contained value by constant reference.

Returns:
a constant reference to the value.

Definition at line 126 of file field.h.

References pqxxobject::field< T >::m_value, and pqxxobject::field< T >::value_type.

template<typename T>
value_type& pqxxobject::field< T >::get_value  )  [inline]
 

Get the contained value by reference.

Returns:
a reference to the value.

Definition at line 117 of file field.h.

References pqxxobject::field< T >::m_value, and pqxxobject::field< T >::value_type.

template<typename T>
const value_type& pqxxobject::field< T >::operator *  )  const [inline]
 

Definition at line 88 of file field.h.

References pqxxobject::field< T >::m_value, and pqxxobject::field< T >::value_type.

template<typename T>
pqxxobject::field< T >::operator const value_type &  )  const [inline]
 

Conversion operator.

Definition at line 108 of file field.h.

References pqxxobject::field< T >::m_value.

template<typename T>
const value_type* pqxxobject::field< T >::operator->  )  const [inline]
 

Access member functions.

Definition at line 83 of file field.h.

References pqxxobject::field< T >::m_value, and pqxxobject::field< T >::value_type.

template<typename T>
field<value_type>& pqxxobject::field< T >::operator= const value_type rhs  )  [inline]
 

Overloaded assignment operator.

Definition at line 101 of file field.h.

References pqxxobject::field< T >::set_value(), and pqxxobject::field< T >::value_type.

template<typename T>
field<value_type>& pqxxobject::field< T >::operator= const field< value_type > &  rhs  )  [inline]
 

Overloaded assignment operator.

Definition at line 94 of file field.h.

References pqxxobject::field< T >::m_value, and pqxxobject::field< T >::set_value().

template<typename T>
void pqxxobject::field< T >::set_value const value_type value  )  [inline]
 

Set the contained value.

Parameters:
value the value to set.

Definition at line 135 of file field.h.

References pqxxobject::field< T >::m_signal_changed, pqxxobject::field< T >::m_value, and pqxxobject::field< T >::value_type.

Referenced by pqxxobject::field< T >::operator=().

template<typename T>
SigC::Signal0<void>& pqxxobject::field< T >::signal_changed  )  [inline]
 

Signal emitted on value change.

Returns:
the signal.
For example:
 field<int> col;
 someclass listener;
 col.signal_changed().connect
   ( SigC::slot(listener, &someclass::on_col_changed() );
i.e. a class method (listener.on_col_changed()) will be called when the value is changed.

Definition at line 155 of file field.h.

References pqxxobject::field< T >::m_signal_changed.


Member Data Documentation

template<typename T>
SigC::Signal0<void> pqxxobject::field< T >::m_signal_changed [private]
 

The changed signal.

Definition at line 164 of file field.h.

Referenced by pqxxobject::field< T >::field(), pqxxobject::field< T >::set_value(), and pqxxobject::field< T >::signal_changed().

template<typename T>
value_type pqxxobject::field< T >::m_value [private]
 

The contained value.

Definition at line 162 of file field.h.

Referenced by pqxxobject::field< T >::field(), pqxxobject::field< T >::get_value(), pqxxobject::field< T >::operator *(), pqxxobject::field< T >::operator const value_type &(), pqxxobject::field< T >::operator->(), pqxxobject::field< T >::operator=(), and pqxxobject::field< T >::set_value().


The documentation for this class was generated from the following file:
Generated on Wed Jan 28 21:22:49 2004 for pqxx-object API Reference by doxygen 1.3.4