FieldValue Class Reference

This class contains the value of one cell in a table. More...

#include <FieldValue.h>

Inheritance diagram for FieldValue:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 FieldValue (FieldImplPtr field)
 Constructs a Value object with no value (e.g., a NULL cell).
 FieldValue (FieldImplPtr field, cstring value)
 Constructs a Value object with a string value (e.g., a Text cell).
 FieldValue (FieldImplPtr field, value_type value)
 Constructs a Value object with a value_type valueu (e.g.
virtual ~FieldValue ()
 Value destructor, a noop.
FieldImplPtr getField () const
 Returns what field this Value belongs to.
TableImplPtr getTable () const
 Returns the table of the field this Value belongs to.
cstring getName () const
 Returns the name of the field this value belongs to.
const std::string & getStringValue () const
 Returns the string value of this Value, only valid if this value belongs to a Text cell.
value_type getIntegerValue () const
 Returns the integer value of this Value, only valid if this value does not belong to a Text cell.
bool getBoolValue () const
 Returns the boolean value of this Value, oly valid if this value does not belong to a Text cell.
bool isDirty () const
 Returns wether this Value is 'dirty', e.g., if it has been changed without being saved.
virtual bool isKey () const
 Whether this field is a key field.
void setTextValue (const std::string &value)
 Sets the text value of this Value, only valid if this value belongs to a Text cell.
void setIntegerValue (value_type value)
 Sets the integer value of this Value, only valid if this value does not belong to a Text cell.
void setBoolValue (bool value)
 Sets the integer valueu of this Value to 0 or 1, only valid if this value does not belong to a Text cell.
void setDirty (bool dirty)
 Sets this Value's dirtyness, e.g., if it has been changed without being saved.


Detailed Description

This class contains the value of one cell in a table.

A value belongs to a specific field. Values are strongly typed, this is asserted at runtime.

Definition at line 37 of file FieldValue.h.


Constructor & Destructor Documentation

FieldValue::FieldValue ( FieldImplPtr  field  ) 

Constructs a Value object with no value (e.g., a NULL cell).

FieldValue::FieldValue ( FieldImplPtr  field,
cstring  value 
)

Constructs a Value object with a string value (e.g., a Text cell).

FieldValue::FieldValue ( FieldImplPtr  field,
value_type  value 
)

Constructs a Value object with a value_type valueu (e.g.

an Integer cell).

virtual FieldValue::~FieldValue (  )  [virtual]

Value destructor, a noop.


Member Function Documentation

FieldImplPtr FieldValue::getField (  )  const

Returns what field this Value belongs to.

TableImplPtr FieldValue::getTable (  )  const

Returns the table of the field this Value belongs to.

cstring FieldValue::getName (  )  const

Returns the name of the field this value belongs to.

const std::string& FieldValue::getStringValue (  )  const

Returns the string value of this Value, only valid if this value belongs to a Text cell.

value_type FieldValue::getIntegerValue (  )  const

Returns the integer value of this Value, only valid if this value does not belong to a Text cell.

bool FieldValue::getBoolValue (  )  const

Returns the boolean value of this Value, oly valid if this value does not belong to a Text cell.

bool FieldValue::isDirty (  )  const

Returns wether this Value is 'dirty', e.g., if it has been changed without being saved.

Reimplemented in KeyValue.

virtual bool FieldValue::isKey (  )  const [inline, virtual]

Whether this field is a key field.

Reimplemented in KeyValue.

Definition at line 74 of file FieldValue.h.

void FieldValue::setTextValue ( const std::string &  value  ) 

Sets the text value of this Value, only valid if this value belongs to a Text cell.

void FieldValue::setIntegerValue ( value_type  value  ) 

Sets the integer value of this Value, only valid if this value does not belong to a Text cell.

void FieldValue::setBoolValue ( bool  value  ) 

Sets the integer valueu of this Value to 0 or 1, only valid if this value does not belong to a Text cell.

void FieldValue::setDirty ( bool  dirty  ) 

Sets this Value's dirtyness, e.g., if it has been changed without being saved.

Reimplemented in KeyValue.


Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo