casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VisBufferImpl2Internal.h
Go to the documentation of this file.
1 /*
2  * VisBufferImpl2Internal.h
3  *
4  * Created on: Aug 22, 2013
5  * Author: jjacobs
6  */
7 
8 #ifndef VISBUFFERIMPL2INTERNAL_H_
9 #define VISBUFFERIMPL2INTERNAL_H_
10 
12 #include <cassert>
13 #include <sstream>
14 
15 namespace casa {
16 
17 namespace ms {
18  class Vbi2MsRow;
19 }
20 
21 namespace vi {
22 
24 //
25 // Auxiliary Classes are contained in the "vb" namespace.
26 //
27 // These include VbCacheItemBase, VbCacheItem, VisBufferCache
28 // and VisBufferState.
29 
30 
31 
32 
33 // Possible array shapes of data coming from the main table cells.
34 
36 
37 class VisBufferCache;
38 
40 
41  // Provides a common base class for all of the cached value classes.
42  // This is required because the actualy value classes use a template
43  // to capture the underlying value type.
44 
45  friend class VisBufferImpl2;
46 
47 public:
48 
50  : isKey_p (false),
51  isMutable_p (isMutable),
53  vb_p (0) {}
54 
55  virtual ~VbCacheItemBase () {}
56 
57  virtual void appendRows (casacore::Int nRowsToAdd, casacore::Bool truncate = false) = 0;
58  virtual void clear (casacore::Bool clearStatusOnly = false) = 0;
59  virtual void clearDirty () = 0;
60  virtual void copyRowElement (casacore::Int sourceRow, casacore::Int destinationRow) = 0;
61  virtual void fill () const = 0;
63  getComponent () const
64  {
65  return vbComponent_p;
66  }
67  virtual casacore::Bool isArray () const = 0;
68  virtual casacore::Bool isDirty () const = 0;
69  virtual casacore::Bool isPresent () const = 0;
70  virtual casacore::Bool isShapeOk () const = 0;
71  virtual void resize (casacore::Bool /*copyValues*/) {}
72  virtual void resizeRows (casacore::Int /*newNRows*/) {}
73  virtual void setDirty () = 0;
74  virtual casacore::String shapeErrorMessage () const = 0;
75 
76 protected:
77 
78  virtual void copy (const VbCacheItemBase * other, casacore::Bool fetchIfNeeded) = 0;
79 
80  VisBufferImpl2 * getVb () const
81  {
82  return vb_p;
83  }
84 
85  virtual void initialize (VisBufferCache * cache, VisBufferImpl2 * vb, VisBufferComponent2 component,
86  casacore::Bool isKey = true);
87 
88  casacore::Bool isKey () const { return isKey_p;}
89  bool isMutable () const { return isMutable_p; }
90 
91  virtual void setAsPresent (casacore::Bool isPresent = true) const = 0;
93  {
94  isKey_p = isKey;
95  }
96 
97 private:
98 
100  const bool isMutable_p;
102  VisBufferImpl2 * vb_p; // [use]
103 
104 };
105 
106 typedef std::vector<VbCacheItemBase *> CacheRegistry;
107 
108 template <typename T, casacore::Bool IsComputed = false>
109 class VbCacheItem : public VbCacheItemBase {
110 
111  friend class VisBufferImpl2;
112 
113 public:
114 
115  typedef T DataType;
116  typedef void (VisBufferImpl2::* Filler) (T &) const;
117 
118  VbCacheItem (bool isMutable = false)
120  {}
121 
122  virtual ~VbCacheItem () {}
123 
125  {
126  // Noop for scalars
127  }
128 
129  virtual void
130  clear (casacore::Bool clearStatusOnly)
131  {
132  if (! clearStatusOnly) {
133  clearValue (item_p);
134  }
135  setAsPresent (false);
136  clearDirty ();
137  }
138 
139  virtual void
141  {
142  isDirty_p = false;
143  }
144 
145  virtual void copyRowElement (casacore::Int /*sourceRow*/, casacore::Int /*destinationRow*/) {} // noop
146 
147 
148  virtual void
149  fill () const
150  {
151  const VisBufferImpl2 * vb = getVb();
152 
153  ThrowIf (! vb->isAttached (),
154  casacore::String::format ("Can't fill VisBuffer component %s: Not attached to VisibilityIterator",
156 
157  ThrowIf (! IsComputed && ! vb->isFillable (),
158  casacore::String::format ("Cannot fill VisBuffer component %s: %s",
160  vb->getFillErrorMessage ().c_str()));
161 
162  (vb ->* filler_p) (item_p);
163  }
164 
165  const T &
166  get () const
167  {
168  if (! isPresent()){
169  fill ();
170  setAsPresent ();
171  isDirty_p = false;
172  }
173 
174  return item_p;
175  }
176 
177  T &
178  getRef (casacore::Bool fillIfAbsent = true)
179  {
180  if (! isPresent() && fillIfAbsent){
181  fill ();
182  }
183  setAsPresent();
184 
185  // Caller is getting a modifiabled reference to the
186  // datum (otherwise they would use "get"): assume
187  // that it will be used to modify the datum and mark
188  // it as dirty.
189 
190  isDirty_p = true;
191 
192  return item_p;
193  }
194 
195  void
198  casacore::Bool isKey = true)
199  {
200  VbCacheItemBase::initialize (cache, vb, component, isKey);
201  filler_p = filler;
202  }
203 
205  {
206  return false;
207  }
208 
210  isDirty () const
211  {
212  return isDirty_p;
213  }
214 
216  isPresent () const
217  {
218  return isPresent_p;
219  }
220 
221  virtual casacore::Bool
222  isShapeOk () const
223  {
224  return true;
225  }
226 
227  virtual void
228  set (const T & newItem)
229  {
230  ThrowIf (! isMutable () && ! getVb()->isWritable (), "This VisBuffer is readonly");
231 
232  ThrowIf (isKey() && ! getVb()->isRekeyable (),
233  "This VisBuffer is does not allow row key values to be changed.");
234 
235  // Set operations to a rekeyable VB are allowed to change the shapes of the
236  // values. When T derives from casacore::Array, the assign method will use casacore::Array::assign
237  // which resizes the destination value to match the source value. For nonkeyable
238  // VBs, the normal operator= method is used which for Arrays will throw an
239  // exception when a shape incompatibility exists between the source and destination.
240 
241  if (isKey ()){
242  assign (item_p, newItem);
243  }
244  else{
245  item_p = newItem;
246  }
247 
249 
250  setAsPresent();
251  isDirty_p = true;
252  }
253 
254 
255  template <typename U>
256  void
257  set (const U & newItem)
258  {
259  ThrowIf (! isMutable () && ! getVb()->isWritable (), "This VisBuffer is readonly");
260 
261  ThrowIf (isKey () && ! getVb()->isRekeyable (),
262  "This VisBuffer is does not allow row key values to be changed.");
263 
264  item_p = newItem;
265 
267 
268  setAsPresent();
269  isDirty_p = true;
270  }
271 
272  template <typename U>
273  void
274  setSpecial (const U & newItem)
275  {
276  // For internal use for items which aren't really demand-fetched
277 
278  item_p = newItem;
279  setAsPresent();
280  isDirty_p = false;
281  }
282 
283  virtual void
285  {
286  isDirty_p = true;
287  }
288 
289  virtual casacore::String
291  {
292  ThrowIf (true, "Scalar shapes should not have shape errors.");
293 
294  return casacore::String();
295  }
296 
297 protected:
298 
299  void
300  assign (T & lhs, const T & rhs)
301  {
302  lhs = rhs;
303  }
304 
305  template <typename E>
307  value.resize();
308  }
309 
310  static void clearValue (casacore::Int & value){
311  value = 0;
312  }
313 
315  value = casacore::MDirection ();
316  }
317 
318 
319 // virtual void
320 // copy (const VbCacheItemBase * otherRaw, casacore::Bool markAsCached)
321 // {
322 // // Convert generic pointer to one pointint to this
323 // // cache item type.
324 //
325 // const VbCacheItem * other = dynamic_cast <const VbCacheItem *> (otherRaw);
326 // Assert (other != 0);
327 //
328 // // Capture the cached status of the other item
329 //
330 // isPresent_p = other->isPresent_p;
331 //
332 // // If the other item was cached then copy it over
333 // // otherwise clear out this item.
334 //
335 // if (isPresent_p){
336 // item_p = other->item_p;
337 // }
338 // else {
339 // item_p = T ();
340 //
341 // if (markAsCached){
342 // isPresent_p = true;
343 // }
344 // }
345 // }
346 
347  virtual void
348  copy (const VbCacheItemBase * otherRaw, casacore::Bool fetchIfNeeded)
349  {
350  const VbCacheItem<T, IsComputed> * other =
351  dynamic_cast <const VbCacheItem<T, IsComputed> *> (otherRaw);
352  copyAux (other, fetchIfNeeded);
353  }
354 
355  void
356  copyAux (const VbCacheItem<T, IsComputed> * other, bool fetchIfNeeded)
357  {
358  if (other->isPresent()){
359 
360  item_p = other->item_p;
361  setAsPresent ();
362  isDirty_p = false;
363  }
364  else if (fetchIfNeeded){
365  set (other->get());
366  }
367  else {
368 
369  setAsPresent (false);
370  isDirty_p = false;
371  }
372  }
373 
374  T &
375  getItem () const
376  {
377  return item_p;
378  }
379 
380  void
382  {
384  }
385 
386 private:
387 
391  mutable T item_p;
392 };
393 
394 template <typename T, casacore::Bool IsComputed = false>
395 class VbCacheItemArray : public VbCacheItem<T, IsComputed> {
396 public:
397 
398  typedef typename VbCacheItem<T>::Filler Filler;
399  typedef typename T::IteratorSTL::value_type ElementType;
400 
402  : VbCacheItem<T, IsComputed> (isMutable), capacity_p (0), shapePattern_p (NoCheck) {}
403  virtual ~VbCacheItemArray () {}
404 
405  virtual void appendRows (casacore::Int nRows, casacore::Bool truncate)
406  {
407 
408  // Only used when time averaging
409 
410  casacore::IPosition shape = this->getItem().shape();
411  casacore::Int nDims = shape.size();
412 
413  if (nDims == 0 || shapePattern_p == NoCheck){
414  // This item is empty or unfillable so leave it alone.
415  }
416  else if (truncate){
417 
418  // Make any excess rows disappear with a little hack to
419  // avoid a copy. This leaves the storage unchanged and merely
420  // changes the associated bookkeeping values.
421 
422  AssertCc (nRows <= shape.last());
423 
424  shape.last() = nRows;
425 
426  this->getItem().adjustLastAxis (shape);
427 
428  }
429  else{
430 
431  // The array needs to resized to hold nRows worth of data. If the
432  // shape of the existing array is the same as the existing one ignoring
433  // the number of rows then we expect the array
434 
435  this->setAsPresent(); // This VB is being filled manually
436  casacore::IPosition desiredShape = this->getVb()->getValidShape (shapePattern_p);
437  casacore::IPosition currentShape = getShape();
438 
439  // Determine if the existing shape is the same as the desired shape
440  // ignoring rows. If is the same, then the existing data will need
441  // to be copied in the event that the array needs to be resized
442  // (i.e., reallocated).
443 
444  casacore::Bool shapeOk = true; // will ignore last dimension
445  for (casacore::uInt i = 0; i < currentShape.nelements() - 1; i++){
446  shapeOk = shapeOk && desiredShape [i] == currentShape [i];
447  }
448 
449  desiredShape.last() = nRows;
450 
451  if (shapeOk){
452 
453  // Only the number of rows differs from the current shape.
454  // This call will preserve any existing data.
455 
456  this->getItem().adjustLastAxis (desiredShape, 20);
457  }
458  else {
459 
460  // Since the core shape is changing, the existing data is
461  // not useful; this call will not preserve it.
462 
463  this->getItem().reformOrResize (desiredShape);
464  }
465  }
466  }
467 
468  virtual void copyRowElement (casacore::Int sourceRow, casacore::Int destinationRow)
469  {
470  copyRowElementAux (this->getItem(), sourceRow, destinationRow);
471  }
472 
474  {
475  return this->getItem().shape();
476  }
477 
478 
479  void
481  VisBufferImpl2 * vb,
482  Filler filler,
483  VisBufferComponent2 component,
484  ShapePattern shapePattern,
486  {
487  VbCacheItem<T, IsComputed>::initialize (cache, vb, filler, component, isKey);
488  shapePattern_p = shapePattern;
489  }
490 
491 
492  virtual casacore::Bool
493  isShapeOk () const
494  {
495  // Check to see if the shape of this data item is consistent
496  // with the expected shape.
497 
498  casacore::Bool result = shapePattern_p == NoCheck ||
499  this->getItem().shape() == this->getVb()->getValidShape (shapePattern_p);
500 
501  return result;
502  }
503 
504 
506  {
507  return true;
508  }
509 
510  void
511  resize (casacore::Bool copyValues)
512  {
513  if (shapePattern_p != NoCheck){
514 
515  casacore::IPosition desiredShape = this->getVb()->getValidShape (shapePattern_p);
516 
517  this->getItem().resize (desiredShape, copyValues);
518  capacity_p = desiredShape.last();
519 
520  if (! copyValues){
521  this->getItem() = typename T::value_type();
522  }
523 
524  }
525  }
526 
527  void
529  {
530  casacore::IPosition shape = this->getItem().shape();
531 
532  if (shapePattern_p != NoCheck){
533 
534  // Change the last dimension to be the new number of rows,
535  // then resize, copying values.
536 
537  shape.last() = newNRows;
538 
539  this->getItem().resize (shape, true);
540 
541  this->setDirty();
542  }
543  }
544 
545  virtual void
546  set (const T & newItem)
547  {
548  ThrowIf (! this->isMutable() && ! this->getVb()->isWritable (), "This VisBuffer is readonly");
549 
550  ThrowIf (this->isKey() && ! this->getVb()->isRekeyable (),
551  "This VisBuffer is does not allow row key values to be changed.");
552 
553  // Now check for a conformant shape.
554 
555  casacore::IPosition itemShape = newItem.shape();
556  casacore::Bool parameterShapeOk = shapePattern_p == NoCheck ||
557  itemShape == this->getVb()->getValidShape (shapePattern_p);
558  ThrowIf (! parameterShapeOk,
559  "Invalid parameter shape:: " + shapeErrorMessage (& itemShape));
560 
562  }
563 
564  template <typename U>
565  void
566  set (const U & newItem)
567  {
568  if (! this->isPresent()){ // Not present so give it a shape
569  set (T (this->getVb()->getValidShape (shapePattern_p)));
570  }
571 
573  }
574 
575  virtual casacore::String
576  shapeErrorMessage (const casacore::IPosition * badShape = 0) const
577  {
578 
580  "No shape error message for NoCheck type array");
581 
582  ThrowIf (isShapeOk () && badShape == 0,
583  "Shape is OK so no error message.");
584 
585  casacore::String badShapeString = (badShape != 0) ? badShape->toString()
586  : this->getItem().shape().toString();
587 
588  std::ostringstream os;
589 
590  os << "VisBuffer::ShapeError: "
592  << " should have shape "
594  << " but had shape "
595  << badShapeString;
596 
597  return os.str();
598  }
599 
600 protected:
601 
602  void
603  assign (T & dst, const T & src)
604  {
605  dst.assign (src);
606  }
607 
608  static void
610  {
612  casacore::Int nI = shape(1);
613  casacore::Int nJ = shape(0);
614 
615  for (casacore::Int i = 0; i < nI; i++){
616  for (casacore::Int j = 0; j < nJ; j++){
617  cube (j, i, destinationRow) = cube (j, i, sourceRow);
618  }
619  }
620  }
621 
622  static void
624  {
625  casacore::IPosition shape = matrix.shape();
626  casacore::Int nJ = shape(0);
627 
628  for (casacore::Int j = 0; j < nJ; j++){
629  matrix (j, destinationRow) = matrix (j, sourceRow);
630  }
631  }
632 
633  static void
635  {
636  casacore::IPosition shape = array.shape();
637  AssertCc (shape.nelements() == 4);
638 
639  casacore::Int nH = shape(2);
640  casacore::Int nI = shape(1);
641  casacore::Int nJ = shape(0);
642 
643  for (casacore::Int h = 0; h < nH; h++){
644  for (casacore::Int i = 0; i < nI; i++){
645  for (casacore::Int j = 0; j < nJ; j++){
646  array (casacore::IPosition (4, j, i, h, destinationRow)) =
647  array (casacore::IPosition (4, j, i, h, sourceRow));
648  }
649  }
650  }
651  }
652 
653  static void
655  {
656  vector (destinationRow) = vector (sourceRow);
657  }
658 
659 private:
660 
663 };
664 
666 
667  // Holds the cached values for a VisBuffer object.
668 
669 public:
670 
672 
673  void appendComplete ();
675  void initialize (VisBufferImpl2 * vb);
676  void registerItem (VbCacheItemBase * item);
677 
678  // The values that are potentially cached.
679 
685 // VbCacheItemArray <casacore::Matrix<CStokesVector> > correctedVisibility_p;
689  VbCacheItemArray <casacore::Vector<casacore::MDirection> > direction1_p; //where the first antenna/feed is pointed to
690  VbCacheItemArray <casacore::Vector<casacore::MDirection> > direction2_p; //where the second antenna/feed is pointed to
697 // VbCacheItemArray <casacore::Matrix<casacore::Bool> > flag_p;
704 // VbCacheItemArray <casacore::Matrix<CStokesVector> > modelVisibility_p;
717  //VbCacheItemArray <casacore::Matrix<casacore::Float> > sigmaMat_p;
725 // VbCacheItemArray <casacore::Matrix<CStokesVector> > visibility_p;
727  //VbCacheItemArray <casacore::Matrix<casacore::Float> > weightMat_p;
730 
732 
733  template <typename T, typename U>
734  static void
736  casacore::IPosition & mat, U & tmp, casacore::Bool sort)
737  {
738 
739  T & data = dataItem.getRef ();
740  U p1, p2, p3;
741 
742  if (dataItem.isPresent() && data.nelements() > 0) {
743 
744  blc(0) = trc(0) = 1;
745  p1.reference(data (blc, trc).reform(mat));
746 
747  blc(0) = trc(0) = 2;
748  p2.reference(data (blc, trc).reform(mat));
749 
750  blc(0) = trc(0) = 3;
751  p3.reference(data (blc, trc).reform(mat));
752 
753  if (sort){ // casacore::Sort correlations: (PP,QQ,PQ,QP) -> (PP,PQ,QP,QQ)
754 
755  tmp = p1;
756  p1 = p2;
757  p2 = p3;
758  p3 = tmp;
759  }
760  else { // Unsort correlations: (PP,PQ,QP,QQ) -> (PP,QQ,PQ,QP)
761 
762  tmp = p3;
763  p3 = p2;
764  p2 = p1;
765  p1 = tmp;
766  }
767  }
768  }
769 };
770 
772 
773 public:
774 
775  template<typename T>
777  public:
778 
780 
782  : frame_p (-1),
783  msId_p (-1),
784  spectralWindowId_p (-1),
785  time_p (-1),
786  updater_p (updater)
787  {}
788 
795 
796  void
797  flush ()
798  {
799  time_p = -1; // will be enough to cause a reload
800  }
801 
802  void
804  casacore::Int rowInBuffer,
805  casacore::Int frame,
806  const VisBufferImpl2 * vb)
807  {
808  casacore::Int msId = vb->msId();
809  casacore::Int spectralWindowId = vb->spectralWindows()(rowInBuffer);
810  casacore::Double time = vb->time()(rowInBuffer);
811 
812  if (time == time_p && frame == frame_p && msId == msId_p &&
813  spectralWindowId == spectralWindowId_p){
814  return;
815  }
816 
817  time_p = time;
818  frame_p = frame;
819  msId_p = msId;
820  spectralWindowId_p = spectralWindowId;
821 
822  values_p.assign ((rovi ->* updater_p) (time_p, frame_p, spectralWindowId_p, msId_p));
823  }
824  };
825 
827  : appendCapacity_p (0),
828  appendSize_p (0),
829  areCorrelationsSorted_p (false),
830  channelNumbers_p (& ViImplementation2::getChannels),
832  frequencies_p (& ViImplementation2::getFrequencies),
833  isAttached_p (false),
834  isFillable_p (false),
835  isNewMs_p (false),
836  isNewArrayId_p (false),
837  isNewFieldId_p (false),
838  isNewSpectralWindow_p (false),
839  isRekeyable_p (false),
840  isWritable_p (false),
841  msId_p (-1),
844  vi_p (0),
845  visModelData_p (0),
846  weightScaling_p ( )
847  {}
848 
851  casacore::Bool areCorrelationsSorted_p; // Have correlations been sorted by sortCorr?
870  Subchunk subchunk_p;
875 };
876 
877 
878 }
879 
880 }
881 
882 
883 #endif /* VISBUFFERIMPL2INTERNAL_H_ */
virtual void clearDirty()=0
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
VbCacheItemArray< casacore::Cube< casacore::Float > > weightSpectrum_p
VbCacheItemArray &lt;casacore::Matrix&lt;casacore::Float&gt; &gt; weightMat_p;.
casacore::Vector< casacore::IPosition > validShapes_p
void initialize(VisBufferCache *cache, VisBufferImpl2 *vb, Filler filler, VisBufferComponent2 component, ShapePattern shapePattern, casacore::Bool isKey)
VbCacheItemArray< casacore::Matrix< casacore::Float > > imagingWeight_p
A Measure: astronomical direction.
Definition: MDirection.h:174
VbCacheItemArray< casacore::Vector< casacore::Double > > timeCentroid_p
T & getRef(casacore::Bool fillIfAbsent=true)
A 1-D Specialization of the Array class.
int Int
Definition: aipstype.h:50
virtual void copy(const VbCacheItemBase *other, casacore::Bool fetchIfNeeded)=0
VbCacheItemArray< casacore::Matrix< casacore::Float > > weight_p
VbCacheItemArray &lt;casacore::Matrix&lt;CStokesVector&gt; &gt; visibility_p;.
casacore::Bool isDirty() const
static void sortCorrelationItem(vi::VbCacheItem< T > &dataItem, casacore::IPosition &blc, casacore::IPosition &trc, casacore::IPosition &mat, U &tmp, casacore::Bool sort)
void initialize(VisBufferImpl2 *vb)
virtual casacore::String shapeErrorMessage() const
const IPosition & shape() const
The length of each axis of the Matrix.
Definition: Matrix.h:295
VbCacheItem< casacore::Int > nCorrelations_p
VbCacheItemArray< casacore::Cube< casacore::Complex > > visCube_p
void resize(casacore::Bool copyValues)
virtual casacore::Bool isPresent() const =0
VbCacheItemArray< casacore::Matrix< casacore::Double > > uvw_p
VbCacheItemArray< casacore::Cube< casacore::Float > > sigmaSpectrum_p
virtual void copyRowElement(casacore::Int sourceRow, casacore::Int destinationRow)
static casacore::String name(VisBufferComponent2 id)
casacore::Bool isPresent() const
virtual casacore::String getFillErrorMessage() const
VbCacheItemArray< casacore::Vector< casacore::uInt > > rowIds_p
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Definition: ExprNode.h:1886
void assign(T &dst, const T &src)
virtual casacore::String shapeErrorMessage() const =0
VbCacheItemArray< casacore::Vector< casacore::Int > > feed1_p
static void copyRowElementAux(casacore::Cube< typename T::value_type > &cube, casacore::Int sourceRow, casacore::Int destinationRow)
VbCacheItemArray< casacore::Vector< casacore::SquareMatrix< casacore::Complex, 2 > >, true > cjones_p
FrequencyCache< casacore::Int > channelNumbers_p
const IPosition & shape() const
The length of each axis of the cube.
Definition: Cube.h:292
VbCacheItem< casacore::MDirection > phaseCenter_p
A 3-D Specialization of the Array class.
FrequencyCache< casacore::Double > frequencies_p
virtual void set(const T &newItem)
ABSTRACT TOOL CLASSES A PlotTool is a higher level event handler for a PlotCanvas The idea is to take common tasks which may require multiple events and put them in one place PlotTools also provide additional functionality in that they can be active and blocking non blocking The PlotCanvas will only send events to active and will not send events to later tools or event handlers if the latest tool was blocking In this way a single tool can be used to handle ALL user interaction via the GUI at one time
Definition: PlotTool.h:43
virtual void fill() const =0
virtual casacore::IPosition getValidShape(casacore::Int) const
VbCacheItemArray< casacore::Vector< casacore::Int > > stateId_p
void(VisBufferImpl2::* Filler)(T &) const
VbCacheItem(bool isMutable=false)
A 2-D Specialization of the Array class.
casacore::Vector< T >(ViImplementation2::* Updater)(casacore::Double, casacore::Int, casacore::Int, casacore::Int) const
void assign(T &lhs, const T &rhs)
void setAsPresent(casacore::Bool isPresent=true) const
virtual void clear(casacore::Bool clearStatusOnly)
virtual void appendRows(casacore::Int nRowsToAdd, casacore::Bool truncate=false)=0
casacore::Bool isArray() const
VbCacheItemArray< casacore::Cube< casacore::Bool > > flagCube_p
VbCacheItemArray< casacore::Vector< casacore::Int > > feed2_p
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
VbCacheItemArray< casacore::Vector< casacore::Bool > > flagRow_p
virtual void resize()
Make this array a different shape.
VbCacheItemArray< casacore::Vector< casacore::Int > > spectralWindows_p
VbCacheItemArray &lt;casacore::Matrix&lt;casacore::Float&gt; &gt; sigmaMat_p;.
static void copyRowElementAux(casacore::Array< typename T::value_type > &array, casacore::Int sourceRow, casacore::Int destinationRow)
casacore::Bool isKey() const
VbCacheItemArray< casacore::Array< casacore::Bool > > flagCategory_p
VbCacheItemArray &lt;casacore::Matrix&lt;casacore::Bool&gt; &gt; flag_p;.
VbCacheItemArray< casacore::Vector< casacore::Int > > observationId_p
VbCacheItemArray< casacore::Cube< casacore::Complex > > modelVisCube_p
VisBufferImpl2 * getVb() const
VbCacheItemArray< casacore::Vector< casacore::Int > > antenna2_p
VbCacheItemArray< casacore::Vector< casacore::Int > > processorId_p
VbCacheItemArray< casacore::Vector< casacore::Int > > fieldId_p
VisBufferComponents2 dirtyComponents_p
std::vector< VbCacheItemBase * > CacheRegistry
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
VbCacheItemArray< casacore::Vector< casacore::Int > > arrayId_p
VbCacheItemArray< casacore::Vector< casacore::Int > > corrType_p
VbCacheItemArray &lt;casacore::Matrix&lt;CStokesVector&gt; &gt; correctedVisibility_p;.
VbCacheItem< casacore::Int > nChannels_p
void setIsKey(casacore::Bool isKey)
casacore::Int appendRow()
virtual const casacore::Vector< casacore::Double > & time() const
VbCacheItemArray< casacore::Vector< casacore::Float > > feed2Pa_p
casacore::Bool isArray() const
VbCacheItemArray(bool isMutable=false)
static void clearValue(casacore::Int &value)
double Double
Definition: aipstype.h:55
virtual void clear(casacore::Bool clearStatusOnly=false)=0
ssize_t & last(uInt index=0)
Index into the IPosition from the end.
Definition: IPosition.h:587
void resizeRows(casacore::Int newNRows)
virtual casacore::Bool isShapeOk() const
virtual casacore::Int msId() const
VisBufferComponent2 getComponent() const
const Char * c_str() const
Get char array.
Definition: String.h:555
virtual void resize(casacore::Bool)
virtual void copy(const VbCacheItemBase *otherRaw, casacore::Bool fetchIfNeeded)
virtual void copy (const VbCacheItemBase * otherRaw, casacore::Bool markAsCached) { Convert generic ...
virtual casacore::IPosition getShape() const
T::IteratorSTL::value_type ElementType
VbCacheItemArray< casacore::Vector< casacore::MDirection > > direction1_p
virtual casacore::Bool isDirty() const =0
VbCacheItem< casacore::Int > polFrame_p
virtual void fill() const
void initialize(VisBufferCache *cache, VisBufferImpl2 *vb, Filler filler, VisBufferComponent2 component=VisBufferComponent2::Unknown, casacore::Bool isKey=true)
static void copyRowElementAux(casacore::Matrix< typename T::value_type > &matrix, casacore::Int sourceRow, casacore::Int destinationRow)
VbCacheItem< casacore::Int > nRows_p
virtual const casacore::Vector< casacore::Int > & spectralWindows() const
virtual const casacore::Matrix&lt;casacore::Float&gt; &amp; sigmaMat () const; virtual casacore::Int spectralWi...
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void updateCacheIfNeeded(const ViImplementation2 *rovi, casacore::Int rowInBuffer, casacore::Int frame, const VisBufferImpl2 *vb)
TableExprNode cube(const TableExprNode &node)
Definition: ExprNode.h:1308
VbCacheItemArray< casacore::Cube< casacore::Float > > floatDataCube_p
static String format(const char *picture,...)
Create a formatted string using the given printf format string.
#define ThrowIf(c, m)
Throw an AipsError exception if the condition is true.
Definition: Error.h:89
virtual casacore::String shapeErrorMessage(const casacore::IPosition *badShape=0) const
VbCacheItemArray< casacore::Vector< casacore::Float > > feed1Pa_p
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1944
VbCacheItem< T >::Filler Filler
template &lt;class T, class U&gt; class vector;
Definition: MSFlagger.h:37
VisBufferCache(VisBufferImpl2 *vb)
Holds the cached values for a VisBuffer object.
void set(const U &newItem)
virtual casacore::Bool isAttached() const
virtual void resizeRows(casacore::Int)
value_type & reference
Definition: IPosition.h:386
void setSpecial(const U &newItem)
virtual casacore::Bool isShapeOk() const =0
casacore::CountedPtr< WeightScaling > weightScaling_p
VbCacheItemArray< casacore::Vector< casacore::Int > > scan_p
VbCacheItemArray< casacore::Vector< casacore::Double > > exposure_p
casacore::Vector< casacore::Int > correlations_p
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
casacore::Vector< casacore::Stokes::StokesTypes > correlationsSelected_p
virtual void setAsPresent(casacore::Bool isPresent=true) const =0
virtual void appendRows(casacore::Int, casacore::Bool)
virtual void appendRows(casacore::Int nRows, casacore::Bool truncate)
void copyAux(const VbCacheItem< T, IsComputed > *other, bool fetchIfNeeded)
uInt size() const
Definition: IPosition.h:548
casacore::Vector< casacore::Stokes::StokesTypes > correlationsDefined_p
String: the storage and methods of handling collections of characters.
Definition: String.h:223
VbCacheItemArray< casacore::Vector< casacore::Int > > antenna1_p
The values that are potentially cached.
void registerItem(VbCacheItemBase *item)
VbCacheItemArray< casacore::Vector< casacore::Int > > dataDescriptionIds_p
VbCacheItem< casacore::Int > polarizationId_p
VbCacheItem< casacore::Int > nAntennas_p
VbCacheItemArray &lt;casacore::Matrix&lt;CStokesVector&gt; &gt; modelVisibility_p;.
This class encapsulates an enum with values corresponding to the various data components accessible v...
static void clearValue(casacore::MDirection &value)
virtual casacore::Bool isArray() const =0
virtual void initialize(VisBufferCache *cache, VisBufferImpl2 *vb, VisBufferComponent2 component, casacore::Bool isKey=true)
virtual void copyRowElement(casacore::Int sourceRow, casacore::Int destinationRow)=0
VisBufferImpls encapsulate one chunk of visibility data for processing.
VbCacheItemArray< casacore::Vector< casacore::Double > > time_p
VbCacheItemArray< casacore::Cube< casacore::Complex > > correctedVisCube_p
uInt nelements() const
The number of elements in this IPosition.
Definition: IPosition.h:544
String toString() const
Write the IPosition into a String.
virtual void setDirty()=0
virtual casacore::Bool isShapeOk() const
virtual void set(const T &newItem)
VbCacheItemArray< casacore::Vector< casacore::Double > > timeInterval_p
VbCacheItemArray< casacore::Matrix< casacore::Float > > sigma_p
static void clearValue(casacore::Array< E > &value)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
#define AssertCc(c)
The Assert macro is an alias to the standard assert macro when NDEBUG is defined. ...
Definition: Error.h:57
virtual casacore::Bool isFillable() const
unsigned int uInt
Definition: aipstype.h:51
VbCacheItemArray< casacore::Vector< casacore::MDirection > > direction2_p
static void copyRowElementAux(casacore::Vector< typename T::value_type > &vector, casacore::Int sourceRow, casacore::Int destinationRow)
const IPosition & shape() const
The length of each axis.
Definition: ArrayBase.h:121
static String toString(const T &value)
Convert a value to a String.
Definition: String.h:614
virtual void copyRowElement(casacore::Int, casacore::Int)
VbCacheItem< casacore::Int > dataDescriptionId_p