casacore
Loading...
Searching...
No Matches
casacore::PtrBlock< T > Class Template Reference

A drop-in replacement for Block<T*>. More...

#include <Block.h>

Public Member Functions

 PtrBlock ()
 PtrBlock (size_t n)
 PtrBlock (size_t n, T val)
 PtrBlock (size_t n, T *&storagePointer, Bool takeOverStorage=True)
 PtrBlock (const PtrBlock< T > &other)
PtrBlock< T > & operator= (const PtrBlock< T > &other)
 ~PtrBlock ()
void resize (size_t n, Bool forceSmaller, Bool copyElements)
void resize (size_t n)
void resize (size_t n, Bool forceSmaller)
void remove (size_t whichOne, Bool forceSmaller)
void remove (size_t whichOne)
void replaceStorage (size_t n, T *&storagePointer, Bool takeOverStorage=True)
T & operator[] (size_t index)
const T & operator[] (size_t index) const
void set (const T &val)
PtrBlock< T > & operator= (const T &val)
T * storage ()
const T * storage () const
size_t nelements () const
size_t size () const
Bool empty () const

Private Attributes

Block< void * > block_p

Detailed Description

template<class T>
class casacore::PtrBlock< T >

A drop-in replacement for Block<T*>.

Intended use:

Public interface

Prerequisite

Synopsis

PtrBlock<T*> has exactly the same interface as Block<T*> and should be used in preference to the latter. It's purpose is solely to reduce the number of template instantiations.

To Do

  • Partial template specialization is another implementation choice that will be possible eventually.
  • It might be useful to have functions that know the template parameter is a pointer, e.g. that delete all the non-null pointers.

Definition at line 812 of file Block.h.

Constructor & Destructor Documentation

◆ PtrBlock() [1/5]

template<class T>
casacore::PtrBlock< T >::PtrBlock ( )
inline

Definition at line 814 of file Block.h.

References block_p.

Referenced by operator=(), operator=(), and PtrBlock().

◆ PtrBlock() [2/5]

template<class T>
casacore::PtrBlock< T >::PtrBlock ( size_t n)
inlineexplicit

Definition at line 815 of file Block.h.

References block_p.

◆ PtrBlock() [3/5]

template<class T>
casacore::PtrBlock< T >::PtrBlock ( size_t n,
T val )
inline

Definition at line 816 of file Block.h.

References block_p.

◆ PtrBlock() [4/5]

template<class T>
casacore::PtrBlock< T >::PtrBlock ( size_t n,
T *& storagePointer,
Bool takeOverStorage = True )
inline

Definition at line 817 of file Block.h.

References block_p, and casacore::True.

◆ PtrBlock() [5/5]

template<class T>
casacore::PtrBlock< T >::PtrBlock ( const PtrBlock< T > & other)
inline

Definition at line 819 of file Block.h.

References block_p, and PtrBlock().

◆ ~PtrBlock()

template<class T>
casacore::PtrBlock< T >::~PtrBlock ( )
inline

Definition at line 822 of file Block.h.

Member Function Documentation

◆ empty()

template<class T>
Bool casacore::PtrBlock< T >::empty ( ) const
inline

Definition at line 841 of file Block.h.

References block_p.

◆ nelements()

template<class T>
size_t casacore::PtrBlock< T >::nelements ( ) const
inline

Definition at line 839 of file Block.h.

References block_p.

◆ operator=() [1/2]

template<class T>
PtrBlock< T > & casacore::PtrBlock< T >::operator= ( const PtrBlock< T > & other)
inline

Definition at line 820 of file Block.h.

References block_p, and PtrBlock().

◆ operator=() [2/2]

template<class T>
PtrBlock< T > & casacore::PtrBlock< T >::operator= ( const T & val)
inline

Definition at line 836 of file Block.h.

References PtrBlock(), and set().

◆ operator[]() [1/2]

template<class T>
T & casacore::PtrBlock< T >::operator[] ( size_t index)
inline

Definition at line 833 of file Block.h.

References block_p.

◆ operator[]() [2/2]

template<class T>
const T & casacore::PtrBlock< T >::operator[] ( size_t index) const
inline

Definition at line 834 of file Block.h.

References block_p.

◆ remove() [1/2]

template<class T>
void casacore::PtrBlock< T >::remove ( size_t whichOne)
inline

Definition at line 829 of file Block.h.

References block_p.

◆ remove() [2/2]

template<class T>
void casacore::PtrBlock< T >::remove ( size_t whichOne,
Bool forceSmaller )
inline

Definition at line 827 of file Block.h.

References block_p.

◆ replaceStorage()

template<class T>
void casacore::PtrBlock< T >::replaceStorage ( size_t n,
T *& storagePointer,
Bool takeOverStorage = True )
inline

Definition at line 830 of file Block.h.

References block_p, and casacore::True.

◆ resize() [1/3]

template<class T>
void casacore::PtrBlock< T >::resize ( size_t n)
inline

Definition at line 825 of file Block.h.

References block_p.

◆ resize() [2/3]

template<class T>
void casacore::PtrBlock< T >::resize ( size_t n,
Bool forceSmaller )
inline

Definition at line 826 of file Block.h.

References block_p.

◆ resize() [3/3]

template<class T>
void casacore::PtrBlock< T >::resize ( size_t n,
Bool forceSmaller,
Bool copyElements )
inline

Definition at line 823 of file Block.h.

References block_p.

◆ set()

template<class T>
void casacore::PtrBlock< T >::set ( const T & val)
inline

Definition at line 835 of file Block.h.

References block_p.

Referenced by operator=().

◆ size()

template<class T>
size_t casacore::PtrBlock< T >::size ( ) const
inline

Definition at line 840 of file Block.h.

References block_p.

◆ storage() [1/2]

template<class T>
T * casacore::PtrBlock< T >::storage ( )
inline

Definition at line 837 of file Block.h.

References block_p.

◆ storage() [2/2]

template<class T>
const T * casacore::PtrBlock< T >::storage ( ) const
inline

Definition at line 838 of file Block.h.

References block_p.

Member Data Documentation

◆ block_p


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