ValueHolderRep.h

Classes

ValueHolderRep -- A holder for a value of any basic type. (full description)

class ValueHolderRep

Interface

Public Members
explicit ValueHolderRep (Bool value)
explicit ValueHolderRep (uChar value)
explicit ValueHolderRep (Short value)
explicit ValueHolderRep (uShort value)
explicit ValueHolderRep (Int value)
explicit ValueHolderRep (uInt value)
explicit ValueHolderRep (Float value)
explicit ValueHolderRep (Double value)
explicit ValueHolderRep (const Complex& value)
explicit ValueHolderRep (const DComplex& value)
explicit ValueHolderRep (const Char* value)
explicit ValueHolderRep (const String& value)
explicit ValueHolderRep (const Array<Bool>& value)
explicit ValueHolderRep (const Array<uChar>& value)
explicit ValueHolderRep (const Array<Short>& value)
explicit ValueHolderRep (const Array<uShort>& value)
explicit ValueHolderRep (const Array<Int>& value)
explicit ValueHolderRep (const Array<uInt>& value)
explicit ValueHolderRep (const Array<Float>& value)
explicit ValueHolderRep (const Array<Double>& value)
explicit ValueHolderRep (const Array<Complex>& value)
explicit ValueHolderRep (const Array<DComplex>& value)
explicit ValueHolderRep (const Array<Array>& value)
explicit ValueHolderRep (const Record& value)
~ValueHolderRep()
void link()
static void unlink (ValueHolderRep* rep)
DataType dataType() const
Bool asBool () const
uChar asuChar () const
Short asShort () const
uShort asuShort () const
Int asInt () const
uInt asuInt () const
Float asFloat () const
Double asDouble () const
Complex asComplex () const
DComplex asDComplex() const
const String& asString () const
const Array<Bool> asArrayBool () const
const Array<uChar> asArrayuChar () const
const Array<Short> asArrayShort () const
const Array<uShort> asArrayuShort () const
const Array<Int> asArrayInt () const
const Array<uInt> asArrayuInt () const
const Array<Float> asArrayFloat () const
const Array<Double> asArrayDouble () const
const Array<Complex> asArrayComplex () const
const Array<DComplex> asArrayDComplex() const
const Array<String> asArrayString () const
const Record& asRecord () const
void toRecord (Record&, const RecordFieldId&) const
static ValueHolderRep* fromRecord (const Record& rec, const RecordFieldId&)
Private Members
ValueHolderRep (const ValueHolderRep&)
ValueHolderRep& operator= (const ValueHolderRep&)

Description

Review Status

Programs:
Tests:

Synopsis

Class ValueHolderRep is the letter class for the envelope class ValueHolder. See that class for more information.

Motivation

Copying ValueHolders should be as cheap as possible, so a counted referenced letter class is used.

Member Description

explicit ValueHolderRep (Bool value)
explicit ValueHolderRep (uChar value)
explicit ValueHolderRep (Short value)
explicit ValueHolderRep (uShort value)
explicit ValueHolderRep (Int value)
explicit ValueHolderRep (uInt value)
explicit ValueHolderRep (Float value)
explicit ValueHolderRep (Double value)
explicit ValueHolderRep (const Complex& value)
explicit ValueHolderRep (const DComplex& value)
explicit ValueHolderRep (const Char* value)
explicit ValueHolderRep (const String& value)
explicit ValueHolderRep (const Array<Bool>& value)
explicit ValueHolderRep (const Array<uChar>& value)
explicit ValueHolderRep (const Array<Short>& value)
explicit ValueHolderRep (const Array<uShort>& value)
explicit ValueHolderRep (const Array<Int>& value)
explicit ValueHolderRep (const Array<uInt>& value)
explicit ValueHolderRep (const Array<Float>& value)
explicit ValueHolderRep (const Array<Double>& value)
explicit ValueHolderRep (const Array<Complex>& value)
explicit ValueHolderRep (const Array<DComplex>& value)
explicit ValueHolderRep (const Array<Array>& value)
explicit ValueHolderRep (const Record& value)

Create the object for the given value.

~ValueHolderRep()

Destructor.

void link()

static void unlink (ValueHolderRep* rep)

DataType dataType() const

Get the data type (as defined in DataType.h).

Bool asBool () const
uChar asuChar () const
Short asShort () const
uShort asuShort () const
Int asInt () const
uInt asuInt () const
Float asFloat () const
Double asDouble () const
Complex asComplex () const
DComplex asDComplex() const
const String& asString () const
const Array<Bool> asArrayBool () const
const Array<uChar> asArrayuChar () const
const Array<Short> asArrayShort () const
const Array<uShort> asArrayuShort () const
const Array<Int> asArrayInt () const
const Array<uInt> asArrayuInt () const
const Array<Float> asArrayFloat () const
const Array<Double> asArrayDouble () const
const Array<Complex> asArrayComplex () const
const Array<DComplex> asArrayDComplex() const
const Array<String> asArrayString () const
const Record& asRecord () const

Get the value. It throws an exception if the data type is incorrect.

void toRecord (Record&, const RecordFieldId&) const

Put the value as a field in a record.

static ValueHolderRep* fromRecord (const Record& rec, const RecordFieldId&)

Construct the object from the value in a record.

ValueHolderRep (const ValueHolderRep&)
ValueHolderRep& operator= (const ValueHolderRep&)

Forbid copy ctor and assignment.