YGP::AttributValue Class Reference

Base-class for all attribut-values. More...

Inherited by YGP::ANumeric, YGP::ATime, and YGP::AYear.

List of all members.

Public Member Functions

bool isDefined () const
virtual void undefine ()
virtual void readFromStream (std::istream &)=0 throw (std::invalid_argument)
virtual std::string toUnformattedString () const
virtual std::string toString () const
void toString (std::string &result) const
void toUnformattedString (std::string &result) const

Protected Member Functions

 AttributValue ()
 AttributValue (bool define)
 AttributValue (const AttributValue &other)
virtual ~AttributValue ()
AttributValueoperator= (const AttributValue &other)
virtual void define ()=0
void setDefined ()

Friends

std::istream & operator>> (std::istream &in, AttributValue &inValue)
std::ostream & operator<< (std::ostream &out, const AttributValue &outValue)


Detailed Description

Base-class for all attribut-values.

Attributes can have a value (according to their type) or be undefined (having no value at all).

An attribute is considered defined, if a value is explicitely set or if the defined ()-member is called (where the attribute gets a default-value; depending on its type) -> every derived object must call AttributValue::define () when setting a value!


Constructor & Destructor Documentation

YGP::AttributValue::AttributValue (  )  [inline, protected]

Defaultconstructor; the attribute is not defined.

YGP::AttributValue::AttributValue ( bool  define  )  [inline, protected]

Constructor; the attribute is defined according the parameter.

YGP::AttributValue::AttributValue ( const AttributValue other  )  [inline, protected]

Copy constructor; assigns the value of other.

virtual YGP::AttributValue::~AttributValue (  )  [inline, protected, virtual]

Destructor.


Member Function Documentation

void YGP::AttributValue::define (  )  [inline, protected, pure virtual]

Defines the objects (sets to the default value).

Defines the attribute; to be implemented by derived objects.

Derived objects must call define of their superclass!

Implemented in YGP::ADate, YGP::ANumeric, YGP::ATime, YGP::ATimestamp, and YGP::AYear.

bool YGP::AttributValue::isDefined (  )  const [inline]

Checks if the object is defined.

Reimplemented in YGP::ATimestamp.

AttributValue& YGP::AttributValue::operator= ( const AttributValue other  )  [inline, protected]

Assignment operator; assigns the value of other.

virtual void YGP::AttributValue::readFromStream ( std::istream &   )  throw (std::invalid_argument) [pure virtual]

Reads a value from the passed stream.

To be implemented by derived objects (this class does nothing).

Implemented in YGP::ADate, YGP::ANumeric, YGP::ATime, YGP::ATimestamp, and YGP::AYear.

void YGP::AttributValue::setDefined (  )  [inline, protected]

Defines the attribute; non-virtual method to be called inside define-methods of derived classes.

void YGP::AttributValue::toString ( std::string &  result  )  const [inline]

Converts the attribute into a formatted string.

virtual std::string YGP::AttributValue::toString (  )  const [inline, virtual]

Converts the attribute into a formatted string.

Reimplemented in YGP::ADate, YGP::ANumeric, YGP::ATime, and YGP::ATimestamp.

void YGP::AttributValue::toUnformattedString ( std::string &  result  )  const [inline]

Converts the attribute into an unformatted string.

virtual std::string YGP::AttributValue::toUnformattedString (  )  const [inline, virtual]

Converts the attribute into an unformatted string.

Reimplemented in YGP::ADate, YGP::ANumeric, YGP::ATime, YGP::ATimestamp, and YGP::AYear.

virtual void YGP::AttributValue::undefine (  )  [inline, virtual]

Undefines the object.

Reimplemented in YGP::ATimestamp.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const AttributValue outValue 
) [friend]

Writes the object to the stream using the virtual method toUnformattedString().

std::istream& operator>> ( std::istream &  in,
AttributValue inValue 
) [friend]

Reads the object from the passed stream using the virtual method readFromStream().


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

YGP Version 0.9.31 - Generated on Wed Nov 18 11:25:27 2009 by doxygen 1.5.8