#include <ptr_field.h>
Inheritance diagram for pqxxobject::ptr_field< T >:
Public Types | |
typedef T | value_type |
Public Member Functions | |
ptr_field () | |
The constructor. | |
ptr_field (const value_type &value) | |
The constructor. | |
ptr_field (const ptr_field< value_type > &rhs) | |
The copy constructor. | |
virtual | ~ptr_field () |
const value_type * | operator-> () const |
Access member functions. | |
const value_type & | operator * () const |
ptr_field< value_type > & | operator= (const ptr_field< value_type > &rhs) |
Overloaded assignment operator. | |
ptr_field< value_type > & | operator= (const value_type &rhs) |
Overloaded assignment operator. | |
ptr_field< value_type > & | operator+= (const ptr_field< value_type > &rhs) |
ptr_field< value_type > & | operator-= (const ptr_field< value_type > &rhs) |
ptr_field< value_type > & | operator *= (const ptr_field< value_type > &rhs) |
ptr_field< value_type > & | operator/= (const ptr_field< value_type > &rhs) |
ptr_field< value_type > & | operator%= (const ptr_field< value_type > &rhs) |
ptr_field< value_type > & | operator++ () |
ptr_field< value_type > | operator++ (int) |
ptr_field< value_type > & | operator-- () |
ptr_field< value_type > | operator-- (int) |
operator const value_type & () const | |
Conversion operator. | |
value_type & | get_value () |
Get the contained value by reference. | |
const value_type & | get_value () const |
Get the contained value by constant reference. | |
void | set_value (const value_type &value) |
Set the contained value. | |
void | set_null () |
Set the contained value to NULL. | |
bool | is_null () const |
Check if the contained value is NULL. | |
bool | is_not_null () const |
Check if the contained value is not NULL. | |
Private Attributes | |
value_type * | m_value |
The contained value. | |
Friends | |
ptr_field< value_type > | operator+ (const ptr_field< value_type > &lhs, const ptr_field< value_type > &rhs) |
ptr_field< value_type > | operator- (const ptr_field< value_type > &lhs, const ptr_field< value_type > &rhs) |
ptr_field< value_type > | operator * (const ptr_field< value_type > &lhs, const ptr_field< value_type > &rhs) |
ptr_field< value_type > | operator/ (const ptr_field< value_type > &lhs, const ptr_field< value_type > &rhs) |
ptr_field< value_type > | operator% (const ptr_field< value_type > &lhs, const ptr_field< value_type > &rhs) |
bool | operator== (const ptr_field< value_type > &lhs, const ptr_field< value_type > &rhs) |
bool | operator!= (const ptr_field< value_type > &lhs, const ptr_field< value_type > &rhs) |
ptr_field< value_type > | operator- (const ptr_field< value_type > &rhs) |
ptr_field< value_type > | operator+ (const ptr_field< value_type > &rhs) |
std::ostream & | operator<< (std::ostream &output_stream, const ptr_field< value_type > &rhs) |
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. Like a database field, the value may be NULL. If set to NULL, it is important not to call any of the object member functions, or access the object itself (this would dereference a NULL pointer).
The class has some similarity with std::auto_ptr, but the copying semantics are different: on copy, the value is copied, which may involve memory allocation. There is no transfer of pointer ownership. Contained objects must posess a copy constructor.
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 71 of file ptr_field.h.
|
|
The constructor.
Definition at line 77 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
The constructor.
Definition at line 82 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value, pqxxobject::ptr_field< T >::set_value(), and pqxxobject::ptr_field< T >::value_type. |
|
The copy constructor.
Definition at line 89 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value, and pqxxobject::ptr_field< T >::set_value(). |
|
Definition at line 97 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Get the contained value by constant reference.
Definition at line 261 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value, and pqxxobject::ptr_field< T >::value_type. |
|
Get the contained value by reference.
Definition at line 251 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value, and pqxxobject::ptr_field< T >::value_type. |
|
Check if the contained value is not NULL.
Implements pqxxobject::field_base. Definition at line 305 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Check if the contained value is NULL.
Implements pqxxobject::field_base. Definition at line 296 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Definition at line 110 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value, and pqxxobject::ptr_field< T >::value_type. |
|
Definition at line 151 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Conversion operator.
Definition at line 241 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Definition at line 169 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Definition at line 186 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Definition at line 178 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Definition at line 133 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Definition at line 203 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Definition at line 195 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Definition at line 142 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Access member functions.
Definition at line 104 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value, and pqxxobject::ptr_field< T >::value_type. |
|
Definition at line 160 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. |
|
Overloaded assignment operator.
Definition at line 127 of file ptr_field.h. References pqxxobject::ptr_field< T >::set_value(), and pqxxobject::ptr_field< T >::value_type. |
|
Overloaded assignment operator.
Definition at line 117 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value, pqxxobject::ptr_field< T >::set_null(), and pqxxobject::ptr_field< T >::set_value(). |
|
Set the contained value to NULL.
Definition at line 283 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value. Referenced by pqxxobject::ptr_field< T >::operator=(). |
|
Set the contained value.
Definition at line 271 of file ptr_field.h. References pqxxobject::ptr_field< T >::m_value, and pqxxobject::ptr_field< T >::value_type. Referenced by pqxxobject::ptr_field< T >::operator=(), and pqxxobject::ptr_field< T >::ptr_field(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|