Loading...
Searching...
No Matches
casacore::ValueHolderRep Class Reference
casa package (libcasa_casa) » Containers_module » Containers_module_internal_classes

More...

`#include <ValueHolderRep.h>`

## Public Member Functions

| ValueHolderRep (Bool value)
| Create the object for the given value.
| 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.
| ~ValueHolderRep ()
| Destructor.
| ValueHolderRep (const ValueHolderRep &)=delete
| Forbid copy ctor and assignment.
ValueHolderRep & | operator= (const ValueHolderRep &)=delete
DataType | dataType () const
| Get the data type (as defined in DataType.h).
Bool | asBool () const
| Get the value.
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 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< Int64 > | asArrayInt64 () 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
| Put the value as a field in a record.
std::ostream & | write (std::ostream &os) const
| Write the ValueHolderRep to an output stream.
bool | operator< (const ValueHolderRep &right) const
| Compare two ValueHolder objects.

## Static Public Member Functions

static ValueHolderRep * | fromRecord (const Record &rec, const RecordFieldId &)
| Construct the object from the value in a record.

## 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 62 of file ValueHolderRep.h.

## Constructor & Destructor Documentation

## ValueHolderRep() [1/28]

casacore::ValueHolderRep::ValueHolderRep | ( | Bool | value | ) |

explicit

Create the object for the given value.

References casacore::NewDelAllocator< T >::value.

Referenced by fromRecord(), operator<(), operator=(), and ValueHolderRep().

## ValueHolderRep() [2/28]

casacore::ValueHolderRep::ValueHolderRep | ( | uChar | value | ) |

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [3/28]

casacore::ValueHolderRep::ValueHolderRep | ( | Short | value | ) |

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [4/28]

casacore::ValueHolderRep::ValueHolderRep | ( | uShort | value | ) |

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [5/28]

casacore::ValueHolderRep::ValueHolderRep | ( | Int | value | ) |

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [6/28]

casacore::ValueHolderRep::ValueHolderRep | ( | uInt | value | ) |

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [7/28]

casacore::ValueHolderRep::ValueHolderRep | ( | Int64 | value | ) |

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [8/28]

casacore::ValueHolderRep::ValueHolderRep | ( | Float | value | ) |

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [9/28]

casacore::ValueHolderRep::ValueHolderRep | ( | Double | value | ) |

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [10/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [11/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [12/28]

casacore::ValueHolderRep::ValueHolderRep | ( | const Char * | value | ) |

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [13/28]

casacore::ValueHolderRep::ValueHolderRep | ( | const String & | value | ) |

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [14/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [15/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [16/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [17/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [18/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [19/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [20/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [21/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [22/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [23/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [24/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [25/28]

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

explicit

References casacore::NewDelAllocator< T >::value.

## ValueHolderRep() [26/28]

casacore::ValueHolderRep::ValueHolderRep | ( | const Record & | value | ) |

explicit

References casacore::NewDelAllocator< T >::value, and casacore::Record().

## ValueHolderRep() [27/28]

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

Create an empty N-dim array.

References casacore::ndim().

## ~ValueHolderRep()

casacore::ValueHolderRep::~ValueHolderRep | ( |  | ) |

Destructor.

## ValueHolderRep() [28/28]

casacore::ValueHolderRep::ValueHolderRep | ( | const ValueHolderRep & |  | ) |

delete

Forbid copy ctor and assignment.

References ValueHolderRep().

## 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

References casacore::Record().

## 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 175 of file ValueHolderRep.h.

References itsType.

## fromRecord()

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

static

Construct the object from the value in a record.

References casacore::Record(), and ValueHolderRep().

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.

References ValueHolderRep().

## operator=()

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

delete

References ValueHolderRep().

## toRecord()

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

Put the value as a field in a record.

References casacore::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]

union { ... } casacore::ValueHolderRep

## itsBool

Bool casacore::ValueHolderRep::itsBool

Definition at line 166 of file ValueHolderRep.h.

## itsDouble

Double casacore::ValueHolderRep::itsDouble

Definition at line 169 of file ValueHolderRep.h.

## itsFloat

Float casacore::ValueHolderRep::itsFloat

Definition at line 168 of file ValueHolderRep.h.

## itsInt64

Int64 casacore::ValueHolderRep::itsInt64

Definition at line 167 of file ValueHolderRep.h.

## itsNdim

uInt casacore::ValueHolderRep::itsNdim

private

Definition at line 163 of file ValueHolderRep.h.

## itsPtr

void* casacore::ValueHolderRep::itsPtr

Definition at line 170 of file ValueHolderRep.h.

## itsType

DataType casacore::ValueHolderRep::itsType

private

Definition at line 164 of file ValueHolderRep.h.

Referenced by dataType().

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

- casa/Containers/ValueHolderRep.h