casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | Friends | List of all members
casa::vi::VbCacheItem< T, IsComputed > Class Template Reference

#include <VisBufferImpl2Internal.h>

Inheritance diagram for casa::vi::VbCacheItem< T, IsComputed >:
casa::vi::VbCacheItemBase casa::vi::VbCacheItemArray< T, IsComputed >

Public Types

typedef T DataType
 
typedef void(VisBufferImpl2::* Filler )(T &) const
 

Public Member Functions

 VbCacheItem (bool isMutable=false)
 
virtual ~VbCacheItem ()
 
virtual void appendRows (casacore::Int, casacore::Bool)
 
virtual void clear (casacore::Bool clearStatusOnly)
 
virtual void clearDirty ()
 
virtual void copyRowElement (casacore::Int, casacore::Int)
 
virtual void fill () const
 
const T & get () const
 
T & getRef (casacore::Bool fillIfAbsent=true)
 
void initialize (VisBufferCache *cache, VisBufferImpl2 *vb, Filler filler, VisBufferComponent2 component=VisBufferComponent2::Unknown, casacore::Bool isKey=true)
 
casacore::Bool isArray () const
 
casacore::Bool isDirty () const
 
casacore::Bool isPresent () const
 
virtual casacore::Bool isShapeOk () const
 
virtual void set (const T &newItem)
 
template<typename U >
void set (const U &newItem)
 
template<typename U >
void setSpecial (const U &newItem)
 
virtual void setDirty ()
 
virtual casacore::String shapeErrorMessage () const
 
- Public Member Functions inherited from casa::vi::VbCacheItemBase
 VbCacheItemBase (bool isMutable)
 
virtual ~VbCacheItemBase ()
 
VisBufferComponent2 getComponent () const
 
virtual void resize (casacore::Bool)
 
virtual void resizeRows (casacore::Int)
 

Protected Member Functions

void assign (T &lhs, const T &rhs)
 
virtual void copy (const VbCacheItemBase *otherRaw, casacore::Bool fetchIfNeeded)
 
virtual void

copy (const VbCacheItemBase * otherRaw, casacore::Bool markAsCached) { Convert generic pointer to one pointint to this cache item type. More...

 
void copyAux (const VbCacheItem< T, IsComputed > *other, bool fetchIfNeeded)
 
T & getItem () const
 
void setAsPresent (casacore::Bool isPresent=true) const
 
- Protected Member Functions inherited from casa::vi::VbCacheItemBase
VisBufferImpl2getVb () const
 
virtual void initialize (VisBufferCache *cache, VisBufferImpl2 *vb, VisBufferComponent2 component, casacore::Bool isKey=true)
 
casacore::Bool isKey () const
 
bool isMutable () const
 
void setIsKey (casacore::Bool isKey)
 

Static Protected Member Functions

template<typename E >
static void clearValue (casacore::Array< E > &value)
 
static void clearValue (casacore::Int &value)
 
static void clearValue (casacore::MDirection &value)
 

Private Attributes

Filler filler_p
 
casacore::Bool isDirty_p
 
casacore::Bool isPresent_p
 
item_p
 

Friends

class VisBufferImpl2
 

Detailed Description

template<typename T, casacore::Bool IsComputed = false>
class casa::vi::VbCacheItem< T, IsComputed >

Definition at line 109 of file VisBufferImpl2Internal.h.

Member Typedef Documentation

template<typename T, casacore::Bool IsComputed = false>
typedef T casa::vi::VbCacheItem< T, IsComputed >::DataType

Definition at line 115 of file VisBufferImpl2Internal.h.

template<typename T, casacore::Bool IsComputed = false>
typedef void(VisBufferImpl2::* casa::vi::VbCacheItem< T, IsComputed >::Filler)(T &) const

Definition at line 116 of file VisBufferImpl2Internal.h.

Constructor & Destructor Documentation

template<typename T, casacore::Bool IsComputed = false>
casa::vi::VbCacheItem< T, IsComputed >::VbCacheItem ( bool  isMutable = false)
inline

Definition at line 118 of file VisBufferImpl2Internal.h.

template<typename T, casacore::Bool IsComputed = false>
virtual casa::vi::VbCacheItem< T, IsComputed >::~VbCacheItem ( )
inlinevirtual

Definition at line 122 of file VisBufferImpl2Internal.h.

Member Function Documentation

template<typename T, casacore::Bool IsComputed = false>
virtual void casa::vi::VbCacheItem< T, IsComputed >::appendRows ( casacore::Int  ,
casacore::Bool   
)
inlinevirtual
template<typename T, casacore::Bool IsComputed = false>
void casa::vi::VbCacheItem< T, IsComputed >::assign ( T &  lhs,
const T &  rhs 
)
inlineprotected
template<typename T, casacore::Bool IsComputed = false>
virtual void casa::vi::VbCacheItem< T, IsComputed >::clear ( casacore::Bool  clearStatusOnly)
inlinevirtual

Implements casa::vi::VbCacheItemBase.

Definition at line 130 of file VisBufferImpl2Internal.h.

template<typename T, casacore::Bool IsComputed = false>
virtual void casa::vi::VbCacheItem< T, IsComputed >::clearDirty ( )
inlinevirtual
template<typename T, casacore::Bool IsComputed = false>
template<typename E >
static void casa::vi::VbCacheItem< T, IsComputed >::clearValue ( casacore::Array< E > &  value)
inlinestaticprotected
template<typename T, casacore::Bool IsComputed = false>
static void casa::vi::VbCacheItem< T, IsComputed >::clearValue ( casacore::Int value)
inlinestaticprotected

Definition at line 310 of file VisBufferImpl2Internal.h.

template<typename T, casacore::Bool IsComputed = false>
static void casa::vi::VbCacheItem< T, IsComputed >::clearValue ( casacore::MDirection value)
inlinestaticprotected

Definition at line 314 of file VisBufferImpl2Internal.h.

template<typename T, casacore::Bool IsComputed = false>
virtual void casa::vi::VbCacheItem< T, IsComputed >::copy ( const VbCacheItemBase otherRaw,
casacore::Bool  fetchIfNeeded 
)
inlineprotectedvirtual

virtual void

copy (const VbCacheItemBase * otherRaw, casacore::Bool markAsCached) { Convert generic pointer to one pointint to this cache item type.

const VbCacheItem * other = dynamic_cast <const VbCacheItem *> (otherRaw); Assert (other != 0);

Capture the cached status of the other item

isPresent_p = other->isPresent_p;

If the other item was cached then copy it over otherwise clear out this item.

if (isPresent_p){ item_p = other->item_p; } else { item_p = T ();

if (markAsCached){ isPresent_p = true; } } }

Implements casa::vi::VbCacheItemBase.

Definition at line 348 of file VisBufferImpl2Internal.h.

template<typename T, casacore::Bool IsComputed = false>
void casa::vi::VbCacheItem< T, IsComputed >::copyAux ( const VbCacheItem< T, IsComputed > *  other,
bool  fetchIfNeeded 
)
inlineprotected
template<typename T, casacore::Bool IsComputed = false>
virtual void casa::vi::VbCacheItem< T, IsComputed >::copyRowElement ( casacore::Int  ,
casacore::Int   
)
inlinevirtual
template<typename T, casacore::Bool IsComputed = false>
virtual void casa::vi::VbCacheItem< T, IsComputed >::fill ( ) const
inlinevirtual
template<typename T, casacore::Bool IsComputed = false>
const T& casa::vi::VbCacheItem< T, IsComputed >::get ( ) const
inline
template<typename T, casacore::Bool IsComputed = false>
T& casa::vi::VbCacheItem< T, IsComputed >::getItem ( ) const
inlineprotected
template<typename T, casacore::Bool IsComputed = false>
T& casa::vi::VbCacheItem< T, IsComputed >::getRef ( casacore::Bool  fillIfAbsent = true)
inline

Caller is getting a modifiabled reference to the datum (otherwise they would use "get"): assume that it will be used to modify the datum and mark it as dirty.

Definition at line 178 of file VisBufferImpl2Internal.h.

Referenced by casa::vi::VisBufferCache::sortCorrelationItem().

template<typename T, casacore::Bool IsComputed = false>
void casa::vi::VbCacheItem< T, IsComputed >::initialize ( VisBufferCache cache,
VisBufferImpl2 vb,
Filler  filler,
VisBufferComponent2  component = VisBufferComponent2::Unknown,
casacore::Bool  isKey = true 
)
inline
template<typename T, casacore::Bool IsComputed = false>
casacore::Bool casa::vi::VbCacheItem< T, IsComputed >::isArray ( ) const
inlinevirtual
template<typename T, casacore::Bool IsComputed = false>
casacore::Bool casa::vi::VbCacheItem< T, IsComputed >::isDirty ( ) const
inlinevirtual

Implements casa::vi::VbCacheItemBase.

Definition at line 210 of file VisBufferImpl2Internal.h.

template<typename T, casacore::Bool IsComputed = false>
casacore::Bool casa::vi::VbCacheItem< T, IsComputed >::isPresent ( ) const
inlinevirtual
template<typename T, casacore::Bool IsComputed = false>
virtual casacore::Bool casa::vi::VbCacheItem< T, IsComputed >::isShapeOk ( ) const
inlinevirtual
template<typename T, casacore::Bool IsComputed = false>
virtual void casa::vi::VbCacheItem< T, IsComputed >::set ( const T &  newItem)
inlinevirtual

Set operations to a rekeyable VB are allowed to change the shapes of the values. When T derives from casacore::Array, the assign method will use casacore::Array::assign which resizes the destination value to match the source value. For nonkeyable VBs, the normal operator= method is used which for Arrays will throw an exception when a shape incompatibility exists between the source and destination.

Reimplemented in casa::vi::VbCacheItemArray< T, IsComputed >, casa::vi::VbCacheItemArray< casacore::casacore::Vector< casacore::casacore::SquareMatrix< casacore::Complex, 2 > >, true >, casa::vi::VbCacheItemArray< casacore::casacore::Cube< casacore::Float > >, casa::vi::VbCacheItemArray< casacore::casacore::Vector< casacore::casacore::MDirection > >, casa::vi::VbCacheItemArray< casacore::casacore::Vector< casacore::Bool > >, casa::vi::VbCacheItemArray< casacore::casacore::Array< casacore::Bool > >, casa::vi::VbCacheItemArray< casacore::casacore::Vector< casacore::Int > >, casa::vi::VbCacheItemArray< casacore::casacore::Vector< casacore::Double > >, casa::vi::VbCacheItemArray< casacore::casacore::Vector< casacore::Float > >, casa::vi::VbCacheItemArray< casacore::casacore::Matrix< casacore::Double > >, casa::vi::VbCacheItemArray< casacore::casacore::Cube< casacore::Bool > >, casa::vi::VbCacheItemArray< casacore::casacore::Matrix< casacore::Float > >, casa::vi::VbCacheItemArray< casacore::casacore::Cube< casacore::Complex > >, and casa::vi::VbCacheItemArray< casacore::casacore::Vector< casacore::uInt > >.

Definition at line 228 of file VisBufferImpl2Internal.h.

Referenced by casa::vi::VbCacheItem< casacore::Int >::copyAux(), and casa::vi::VbCacheItemArray< casacore::casacore::Vector< casacore::uInt > >::set().

template<typename T, casacore::Bool IsComputed = false>
template<typename U >
void casa::vi::VbCacheItem< T, IsComputed >::set ( const U &  newItem)
inline

Definition at line 257 of file VisBufferImpl2Internal.h.

template<typename T, casacore::Bool IsComputed = false>
void casa::vi::VbCacheItem< T, IsComputed >::setAsPresent ( casacore::Bool  isPresent = true) const
inlineprotectedvirtual
template<typename T, casacore::Bool IsComputed = false>
virtual void casa::vi::VbCacheItem< T, IsComputed >::setDirty ( )
inlinevirtual
template<typename T, casacore::Bool IsComputed = false>
template<typename U >
void casa::vi::VbCacheItem< T, IsComputed >::setSpecial ( const U &  newItem)
inline

For internal use for items which aren't really demand-fetched

Definition at line 274 of file VisBufferImpl2Internal.h.

template<typename T, casacore::Bool IsComputed = false>
virtual casacore::String casa::vi::VbCacheItem< T, IsComputed >::shapeErrorMessage ( ) const
inlinevirtual

Friends And Related Function Documentation

template<typename T, casacore::Bool IsComputed = false>
friend class VisBufferImpl2
friend

Definition at line 111 of file VisBufferImpl2Internal.h.

Member Data Documentation

template<typename T, casacore::Bool IsComputed = false>
Filler casa::vi::VbCacheItem< T, IsComputed >::filler_p
private
template<typename T, casacore::Bool IsComputed = false>
casacore::Bool casa::vi::VbCacheItem< T, IsComputed >::isDirty_p
mutableprivate
template<typename T, casacore::Bool IsComputed = false>
casacore::Bool casa::vi::VbCacheItem< T, IsComputed >::isPresent_p
mutableprivate
template<typename T, casacore::Bool IsComputed = false>
T casa::vi::VbCacheItem< T, IsComputed >::item_p
mutableprivate

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