casacore
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members

More...

#include <ValueHolderRep.h>

Public Member Functions

 ValueHolderRep (Bool value)
 Create the object for the given value. More...
 
 ValueHolderRep (uChar value)
 
 ValueHolderRep (Short value)
 
 ValueHolderRep (uShort value)
 
 ValueHolderRep (Int value)
 
 ValueHolderRep (uInt value)
 
 ValueHolderRep (Int64 value)
 
 ValueHolderRep (Float value)
 
 ValueHolderRep (Double value)
 
 ValueHolderRep (const Complex &value)
 
 ValueHolderRep (const DComplex &value)
 
 ValueHolderRep (const Char *value)
 
 ValueHolderRep (const String &value)
 
 ValueHolderRep (const Array< Bool > &value)
 
 ValueHolderRep (const Array< uChar > &value)
 
 ValueHolderRep (const Array< Short > &value)
 
 ValueHolderRep (const Array< uShort > &value)
 
 ValueHolderRep (const Array< Int > &value)
 
 ValueHolderRep (const Array< uInt > &value)
 
 ValueHolderRep (const Array< Int64 > &value)
 
 ValueHolderRep (const Array< Float > &value)
 
 ValueHolderRep (const Array< Double > &value)
 
 ValueHolderRep (const Array< Complex > &value)
 
 ValueHolderRep (const Array< DComplex > &value)
 
 ValueHolderRep (const Array< String > &value)
 
 ValueHolderRep (const Record &value)
 
 ValueHolderRep (uInt ndim, Bool dummy)
 Create an empty N-dim array. More...
 
 ~ValueHolderRep ()
 Destructor. More...
 
DataType dataType () const
 Get the data type (as defined in DataType.h). More...
 
Bool asBool () const
 Get the value. More...
 
uChar asuChar () const
 
Short asShort () const
 
uShort asuShort () const
 
Int asInt () const
 
uInt asuInt () const
 
Int64 asInt64 () const
 
Float asFloat () const
 
Double asDouble () const
 
Complex asComplex () const
 
DComplex asDComplex () const
 
const StringasString () const
 
const Array< BoolasArrayBool () const
 
const Array< uCharasArrayuChar () const
 
const Array< ShortasArrayShort () const
 
const Array< uShortasArrayuShort () const
 
const Array< IntasArrayInt () const
 
const Array< uIntasArrayuInt () const
 
const Array< Int64asArrayInt64 () const
 
const Array< FloatasArrayFloat () const
 
const Array< DoubleasArrayDouble () const
 
const Array< Complex > asArrayComplex () const
 
const Array< DComplex > asArrayDComplex () const
 
const Array< StringasArrayString () const
 
const RecordasRecord () const
 
void toRecord (Record &, const RecordFieldId &) const
 Put the value as a field in a record. More...
 
std::ostream & write (std::ostream &os) const
 Write the ValueHolderRep to an output stream. More...
 
bool operator< (const ValueHolderRep &right) const
 Compare two ValueHolder objects. More...
 

Static Public Member Functions

static ValueHolderRepfromRecord (const Record &rec, const RecordFieldId &)
 Construct the object from the value in a record. More...
 

Private Member Functions

 ValueHolderRep (const ValueHolderRep &)
 Forbid copy ctor and assignment. More...
 
ValueHolderRepoperator= (const ValueHolderRep &)
 

Private Attributes

uInt itsNdim
 
DataType itsType
 
union {
   Bool   itsBool
 
   Int64   itsInt64
 
   Float   itsFloat
 
   Double   itsDouble
 
   void *   itsPtr
 
}; 
 

Detailed Description

A holder for a value of any basic type.

Intended use:

Internal

Review Status

Test programs:
tValueHolder

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.

Definition at line 65 of file ValueHolderRep.h.

Constructor & Destructor Documentation

◆ ValueHolderRep() [1/28]

casacore::ValueHolderRep::ValueHolderRep ( Bool  value)
explicit

Create the object for the given value.

◆ ValueHolderRep() [2/28]

casacore::ValueHolderRep::ValueHolderRep ( uChar  value)
explicit

◆ ValueHolderRep() [3/28]

casacore::ValueHolderRep::ValueHolderRep ( Short  value)
explicit

◆ ValueHolderRep() [4/28]

casacore::ValueHolderRep::ValueHolderRep ( uShort  value)
explicit

◆ ValueHolderRep() [5/28]

casacore::ValueHolderRep::ValueHolderRep ( Int  value)
explicit

◆ ValueHolderRep() [6/28]

casacore::ValueHolderRep::ValueHolderRep ( uInt  value)
explicit

◆ ValueHolderRep() [7/28]

casacore::ValueHolderRep::ValueHolderRep ( Int64  value)
explicit

◆ ValueHolderRep() [8/28]

casacore::ValueHolderRep::ValueHolderRep ( Float  value)
explicit

◆ ValueHolderRep() [9/28]

casacore::ValueHolderRep::ValueHolderRep ( Double  value)
explicit

◆ ValueHolderRep() [10/28]

casacore::ValueHolderRep::ValueHolderRep ( const Complex &  value)
explicit

◆ ValueHolderRep() [11/28]

casacore::ValueHolderRep::ValueHolderRep ( const DComplex &  value)
explicit

◆ ValueHolderRep() [12/28]

casacore::ValueHolderRep::ValueHolderRep ( const Char value)
explicit

◆ ValueHolderRep() [13/28]

casacore::ValueHolderRep::ValueHolderRep ( const String value)
explicit

◆ ValueHolderRep() [14/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< Bool > &  value)
explicit

◆ ValueHolderRep() [15/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< uChar > &  value)
explicit

◆ ValueHolderRep() [16/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< Short > &  value)
explicit

◆ ValueHolderRep() [17/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< uShort > &  value)
explicit

◆ ValueHolderRep() [18/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< Int > &  value)
explicit

◆ ValueHolderRep() [19/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< uInt > &  value)
explicit

◆ ValueHolderRep() [20/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< Int64 > &  value)
explicit

◆ ValueHolderRep() [21/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< Float > &  value)
explicit

◆ ValueHolderRep() [22/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< Double > &  value)
explicit

◆ ValueHolderRep() [23/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< Complex > &  value)
explicit

◆ ValueHolderRep() [24/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< DComplex > &  value)
explicit

◆ ValueHolderRep() [25/28]

casacore::ValueHolderRep::ValueHolderRep ( const Array< String > &  value)
explicit

◆ ValueHolderRep() [26/28]

casacore::ValueHolderRep::ValueHolderRep ( const Record value)
explicit

◆ ValueHolderRep() [27/28]

casacore::ValueHolderRep::ValueHolderRep ( uInt  ndim,
Bool  dummy 
)

Create an empty N-dim array.

◆ ~ValueHolderRep()

casacore::ValueHolderRep::~ValueHolderRep ( )

Destructor.

◆ ValueHolderRep() [28/28]

casacore::ValueHolderRep::ValueHolderRep ( const ValueHolderRep )
private

Forbid copy ctor and assignment.

Member Function Documentation

◆ asArrayBool()

const Array<Bool> casacore::ValueHolderRep::asArrayBool ( ) const

◆ asArrayComplex()

const Array<Complex> casacore::ValueHolderRep::asArrayComplex ( ) const

◆ asArrayDComplex()

const Array<DComplex> casacore::ValueHolderRep::asArrayDComplex ( ) const

◆ asArrayDouble()

const Array<Double> casacore::ValueHolderRep::asArrayDouble ( ) const

◆ asArrayFloat()

const Array<Float> casacore::ValueHolderRep::asArrayFloat ( ) const

◆ asArrayInt()

const Array<Int> casacore::ValueHolderRep::asArrayInt ( ) const

◆ asArrayInt64()

const Array<Int64> casacore::ValueHolderRep::asArrayInt64 ( ) const

◆ asArrayShort()

const Array<Short> casacore::ValueHolderRep::asArrayShort ( ) const

◆ asArrayString()

const Array<String> casacore::ValueHolderRep::asArrayString ( ) const

◆ asArrayuChar()

const Array<uChar> casacore::ValueHolderRep::asArrayuChar ( ) const

◆ asArrayuInt()

const Array<uInt> casacore::ValueHolderRep::asArrayuInt ( ) const

◆ asArrayuShort()

const Array<uShort> casacore::ValueHolderRep::asArrayuShort ( ) const

◆ asBool()

Bool casacore::ValueHolderRep::asBool ( ) const

Get the value.

If possible, it converts the data as needed.

◆ asComplex()

Complex casacore::ValueHolderRep::asComplex ( ) const

◆ asDComplex()

DComplex casacore::ValueHolderRep::asDComplex ( ) const

◆ asDouble()

Double casacore::ValueHolderRep::asDouble ( ) const

◆ asFloat()

Float casacore::ValueHolderRep::asFloat ( ) const

◆ asInt()

Int casacore::ValueHolderRep::asInt ( ) const

◆ asInt64()

Int64 casacore::ValueHolderRep::asInt64 ( ) const

◆ asRecord()

const Record& casacore::ValueHolderRep::asRecord ( ) const

◆ asShort()

Short casacore::ValueHolderRep::asShort ( ) const

◆ asString()

const String& casacore::ValueHolderRep::asString ( ) const

◆ asuChar()

uChar casacore::ValueHolderRep::asuChar ( ) const

◆ asuInt()

uInt casacore::ValueHolderRep::asuInt ( ) const

◆ asuShort()

uShort casacore::ValueHolderRep::asuShort ( ) const

◆ dataType()

DataType casacore::ValueHolderRep::dataType ( ) const
inline

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

Definition at line 178 of file ValueHolderRep.h.

References itsType.

◆ fromRecord()

static ValueHolderRep* casacore::ValueHolderRep::fromRecord ( const Record rec,
const RecordFieldId  
)
static

Construct the object from the value in a record.

Referenced by casacore::ValueHolder::fromRecord().

◆ operator<()

bool casacore::ValueHolderRep::operator< ( const ValueHolderRep right) const

Compare two ValueHolder objects.

They must have the same data type.

◆ operator=()

ValueHolderRep& casacore::ValueHolderRep::operator= ( const ValueHolderRep )
private

◆ toRecord()

void casacore::ValueHolderRep::toRecord ( Record ,
const RecordFieldId  
) const

Put the value as a field in a record.

◆ write()

std::ostream& casacore::ValueHolderRep::write ( std::ostream &  os) const

Write the ValueHolderRep to an output stream.

Arrays are written as normal arrays using ArrayIO.h.

Member Data Documentation

◆ 

union { ... }

◆ itsBool

Bool casacore::ValueHolderRep::itsBool

Definition at line 169 of file ValueHolderRep.h.

◆ itsDouble

Double casacore::ValueHolderRep::itsDouble

Definition at line 172 of file ValueHolderRep.h.

◆ itsFloat

Float casacore::ValueHolderRep::itsFloat

Definition at line 171 of file ValueHolderRep.h.

◆ itsInt64

Int64 casacore::ValueHolderRep::itsInt64

Definition at line 170 of file ValueHolderRep.h.

◆ itsNdim

uInt casacore::ValueHolderRep::itsNdim
private

Definition at line 166 of file ValueHolderRep.h.

◆ itsPtr

void* casacore::ValueHolderRep::itsPtr

Definition at line 173 of file ValueHolderRep.h.

◆ itsType

DataType casacore::ValueHolderRep::itsType
private

Definition at line 167 of file ValueHolderRep.h.

Referenced by dataType().


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