casacore
Loading...
Searching...
No Matches
MorphingArray Class Reference

Array class for which the type is determined only at runtime. More...

#include <MorphingArray.h>

Public Member Functions

 MorphingArray () noexcept=default
template<typename T>
 MorphingArray (size_t size)
 ~MorphingArray () noexcept
 MorphingArray (const MorphingArray &)=delete
MorphingArrayoperator= (const MorphingArray &)=delete
 MorphingArray (MorphingArray &&other) noexcept
MorphingArrayoperator= (MorphingArray &&other) noexcept
template<typename T>
void Resize (size_t new_size)
 Make sure that the array can hold as least the specified number of elements of type T.
template<typename T>
T * Data ()
template<typename T>
const T * Data () const
size_t Size () const

Private Member Functions

template<typename T>
void Allocate ()

Private Attributes

void * data_
size_t size_

Detailed Description

Array class for which the type is determined only at runtime.

It handles run-time allocation and alignment of the type. It simplifies buffer allocation in the StokesIStManColumn class.

Once the array is initialized using Resize(), the user must make sure its type no longer changes.

Definition at line 17 of file MorphingArray.h.

Constructor & Destructor Documentation

◆ MorphingArray() [1/4]

MorphingArray::MorphingArray ( )
defaultnoexcept

◆ MorphingArray() [2/4]

template<typename T>
MorphingArray::MorphingArray ( size_t size)
inline

Definition at line 22 of file MorphingArray.h.

References Allocate(), MorphingArray(), and size_.

◆ ~MorphingArray()

MorphingArray::~MorphingArray ( )
inlinenoexcept

Definition at line 26 of file MorphingArray.h.

References data_, and free().

◆ MorphingArray() [3/4]

MorphingArray::MorphingArray ( const MorphingArray & )
delete

References MorphingArray().

◆ MorphingArray() [4/4]

MorphingArray::MorphingArray ( MorphingArray && other)
inlinenoexcept

Definition at line 31 of file MorphingArray.h.

References MorphingArray().

Member Function Documentation

◆ Allocate()

template<typename T>
void MorphingArray::Allocate ( )
inlineprivate

Definition at line 74 of file MorphingArray.h.

References data_, and size_.

Referenced by MorphingArray(), and Resize().

◆ Data() [1/2]

template<typename T>
T * MorphingArray::Data ( )
inline

Definition at line 59 of file MorphingArray.h.

References data_.

◆ Data() [2/2]

template<typename T>
const T * MorphingArray::Data ( ) const
inline

Definition at line 65 of file MorphingArray.h.

References data_.

◆ operator=() [1/2]

MorphingArray & MorphingArray::operator= ( const MorphingArray & )
delete

References MorphingArray().

◆ operator=() [2/2]

MorphingArray & MorphingArray::operator= ( MorphingArray && other)
inlinenoexcept

Definition at line 35 of file MorphingArray.h.

References data_, free(), MorphingArray(), and size_.

◆ Resize()

template<typename T>
void MorphingArray::Resize ( size_t new_size)
inline

Make sure that the array can hold as least the specified number of elements of type T.

Definition at line 49 of file MorphingArray.h.

References Allocate(), data_, free(), and size_.

◆ Size()

size_t MorphingArray::Size ( ) const
inline

Definition at line 70 of file MorphingArray.h.

References size_.

Member Data Documentation

◆ data_

void* MorphingArray::data_
private

Definition at line 85 of file MorphingArray.h.

Referenced by Allocate(), Data(), Data(), operator=(), Resize(), and ~MorphingArray().

◆ size_

size_t MorphingArray::size_
private

Definition at line 86 of file MorphingArray.h.

Referenced by Allocate(), MorphingArray(), operator=(), Resize(), and Size().


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