casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TBData.h
Go to the documentation of this file.
1 //# TBData.h: casacore::Data types used for loaded data.
2 //# Copyright (C) 2005
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id: $
27 #ifndef TBDATA_H_
28 #define TBDATA_H_
29 
31 
32 #include <casa/BasicSL/String.h>
33 #include <casa/Containers/Record.h>
34 #include <casa/Arrays/Array.h>
35 
36 namespace casa {
37 
38 //# Forward Declarations
39 class TBArray;
40 
41 // <summary>
42 // casacore::Data types used for loaded data.
43 // </summary>
44 //
45 // <synopsis>
46 // TBData is the abstract superclass for any data type that the browser knows
47 // about. The idea is to get around templates and other such unpleasantness
48 // that causes unnecessary code copying.
49 // </synopsis>
50 
51 class TBData {
52 public:
53  // Default Constructor.
54  TBData();
55 
56  virtual ~TBData();
57 
58 
59  // See TBData::asString().
61 
62 
63  // asString() must be implemented by any subclass. Returns this data
64  // value in casacore::String form. This method is especially important because
65  // the browser uses this casacore::String to display in the GUI widgets.
66  virtual casacore::String asString() = 0;
67 
68  // asDouble() must be implemented by any subclass, although the returned
69  // value does not have to be valid for classes for which the value cannot
70  // be represented as a double.
71  virtual double asDouble() = 0;
72 
73  // asFloat() must be implemented by any subclass, although the returned
74  // value does not have to be valid for classes for which the value cannot
75  // be represented as a float.
76  virtual float asFloat() = 0;
77 
78  // asInt() must be implemented by any subclass, although the returned
79  // value does not have to be valid for classes for which the value cannot
80  // be represented as an int.
81  virtual int asInt() = 0;
82 
83  // asUInt() must be implemented by any subclass, although the returned
84  // value does not have to be valid for classes for which the value cannot
85  // be represented as an unsigned int.
86  virtual unsigned int asUInt() = 0;
87 
88  // asBool() must be implemented by any subclass, although the returned
89  // value does not have to be valid for classes for which the value cannot
90  // be represented as a boolean.
91  virtual bool asBool() = 0;
92 
93  // asChar() must be implemented by any subclass, although the returned
94  // value does not have to be valid for classes for which the value cannot
95  // be represented as a char.
96  virtual char asChar() = 0;
97 
98  // asUChar() must be implemented by any subclass, although the returned
99  // value does not have to be valid for classes for which the value cannot
100  // be represented as an unsigned character.
101  virtual unsigned char asUChar() = 0;
102 
103  // asShort() must be implemented by any subclass, although the returned
104  // value does not have to be valid for classes for which the value cannot
105  // be represented as a short.
106  virtual short int asShort() = 0;
107 
108  // asComplex() must be implemented by any subclass, although the returned
109  // value does not have to be valid for classes for which the value cannot
110  // be represented as a complex.
111  virtual std::pair<float, float> asComplex() = 0;
112 
113  // asDComplex() must be implemented by any subclass, although the returned
114  // value does not have to be valid for classes for which the value cannot
115  // be represented as a double complex.
116  virtual std::pair<double, double> asDComplex() = 0;
117 
118  // asRecord() must be implemented by any subclass, although the returned
119  // value does not have to be valid for classes for which the value cannot
120  // be represented as a record.
121  virtual casacore::Record* asRecord() = 0;
122 
123 
124  // setValue() must be implemented by any subclass. Sets this data's value
125  // to the value of the given TBData. Note: the behavior of this method
126  // is undefined if the given TBData is not the same type as "this" TBData.
127  virtual void setValue(TBData& value) = 0;
128 
129  // getType() must be implemented by any subclass. Returns this TBData
130  // object's type. Must be one of TBConstants::TYPE_* definitions.
131  virtual casacore::String getType() = 0;
132 
133  // equals() must be implemented by any subclass. Returns true if the
134  // given TBData is equal to this TBData object, false otherwise. Note:
135  // the behavior of this method is undefined if the given TBData is not of
136  // the same type as "this" TBData.
137  virtual bool equals(TBData* data) = 0;
138 
139 
140  // Creates and returns a TBData object representing the given value and
141  // type. May return NULL if the value/type combination is invalid.
142  // NOTE: this method currently does not work for Records in casacore::String form.
144 
145  // Creates a TBArrayData object containing the data in the given TBArray
146  // object with the given type. NOTE: with the restructuring of the
147  // browser to use TBDatas rather than Strings to store data, this method
148  // should NOT be used. It is currently being used as a helper method
149  // for create(casacore::String, casacore::String), but its use is NOT encouraged.
150  static TBData* create(TBArray* array, casacore::String type);
151 
152  // Creates and returns a copy of the given TBData.
153  static TBData* create(TBData& data);
154 };
155 
156 
157 // <summary>
158 // Implementation of TBData for casacore::String data.
159 // </summary>
160 
161 class TBDataString : public TBData {
162 public:
163  // Constructor that takes the casacore::String data.
165 
166  // Constructor that calls setValue().
168 
169  virtual ~TBDataString();
170 
171 
172  // Returns the casacore::String value.
174 
175  // Invalid operations.
176  // <group>
177  double asDouble() { return 0; }
178  float asFloat() { return 0; }
179  int asInt() { return 0; }
180  unsigned int asUInt() { return 0; }
181  bool asBool() { return 0; }
182  char asChar() { return 0; }
183  unsigned char asUChar() { return 0; }
184  short int asShort() { return 0; }
185  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
186  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
187  casacore::Record* asRecord() { return 0; }
188  // </group>
189 
190 
191  // Sets the value to the result of calling asString() on the given TBData.
192  void setValue(TBData& value);
193 
194  // Returns the casacore::String type.
196 
197  // Returns true if the given data is a casacore::String type and the values are
198  // equals, false otherwise.
199  bool equals(TBData* data);
200 
201 private:
202  // Value.
204 };
205 
206 
207 // <summary>
208 // Implementation of TBData for double data.
209 // </summary>
210 
211 class TBDataDouble : public TBData {
212 public:
213  // Constructor that parses a double from the given String.
215 
216  // Constructor that takes the double data.
217  TBDataDouble(double value);
218 
219  // Constructor that calls setValue().
221 
222  virtual ~TBDataDouble();
223 
224 
225  // Returns the value in casacore::String form.
227 
228  // Returns the double value.
229  double asDouble();
230 
231 
232  // Invalid operations.
233  // <group>
234  float asFloat() { return 0; }
235  int asInt() { return 0; }
236  unsigned int asUInt() { return 0; }
237  bool asBool() { return 0; }
238  char asChar() { return 0; }
239  unsigned char asUChar() { return 0; }
240  short int asShort() { return 0; }
241  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
242  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
243  casacore::Record* asRecord() { return 0; }
244  // </group>
245 
246  // If the given TBData is a casacore::String, parses a double from the String.
247  // Otherwise sets the value to the result of the asDouble() call.
248  void setValue(TBData& value);
249 
250  // Returns the double type.
252 
253  // Returns true if the given data is a double type and their values are
254  // equal, false otherwise.
255  bool equals(TBData* data);
256 
257 private:
258  // Value.
259  double value;
260 };
261 
262 
263 // <summary>
264 // Implementation of TBData for float data.
265 // </summary>
266 
267 class TBDataFloat : public TBData {
268 public:
269  // Constructor that parses a float from the given String.
271 
272  // Constructor that takes the float data.
273  TBDataFloat(float value);
274 
275  // Constructor that calls setValue().
277 
278  virtual ~TBDataFloat();
279 
280 
281  // Returns the value in casacore::String form.
283 
284  // Returns the value in double form.
285  double asDouble();
286 
287  // Returns the float value.
288  float asFloat();
289 
290 
291  // Invalid operations.
292  // <group>
293  int asInt() { return 0; }
294  unsigned int asUInt() { return 0; }
295  bool asBool() { return 0; }
296  char asChar() { return 0; }
297  unsigned char asUChar() { return 0; }
298  short int asShort() { return 0; }
299  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
300  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
301  casacore::Record* asRecord() { return 0; }
302  // </group>
303 
304 
305  // If the given TBData is a casacore::String, parses a float from the String.
306  // Otherwise, if the given TBData is a float, sets the float value.
307  void setValue(TBData& value);
308 
309  // Returns the float type.
311 
312  // Returns true if the given data is a float type and their values are
313  // equal, false otherwise.
314  bool equals(TBData* data);
315 
316 private:
317  // Value.
318  float value;
319 };
320 
321 
322 // <summary>
323 // Implementation of TBData for integer data.
324 // </summary>
325 
326 class TBDataInt : public TBData {
327 public:
328  // Constructor that parses an int from the given String.
330 
331  // Constructor that takes the int data.
332  TBDataInt(int value);
333 
334  // Constructor that calls setValue().
336 
337  virtual ~TBDataInt();
338 
339 
340  // Returns the value in casacore::String form.
342 
343  // Returns the value in double form.
344  double asDouble();
345 
346  // Returns the value.
347  int asInt();
348 
349 
350  // Invalid operations.
351  // <group>
352  float asFloat() { return 0; }
353  unsigned int asUInt() { return 0; }
354  bool asBool() { return 0; }
355  char asChar() { return 0; }
356  unsigned char asUChar() { return 0; }
357  short int asShort() { return 0; }
358  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
359  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
360  casacore::Record* asRecord() { return 0; }
361  // </group>
362 
363 
364  // If the given TBData is a casacore::String, parses an int from the casacore::String value.
365  // Otherwise, if the given TBData is an int, sets the int value.
366  void setValue(TBData& value);
367 
368  // Returns the int type.
370 
371  // Returns true if the given data is an int type and their values are
372  // equal, false otherwise
373  bool equals(TBData* data);
374 
375 private:
376  // Value.
377  int value;
378 };
379 
380 
381 // <summary>
382 // Implementation of TBData for unsigned int data.
383 // </summary>
384 
385 class TBDataUInt : public TBData {
386 public:
387  // Constructor that parses an unsigned int from the given String.
389 
390  // Constructor that takes the unsigned int data.
391  TBDataUInt(unsigned int value);
392 
393  // Constructor that calls setValue().
395 
396  virtual ~TBDataUInt();
397 
398 
399  // Returns the value in casacore::String form.
401 
402  // Returns the value in double form.
403  double asDouble();
404 
405  // Returns the value.
406  unsigned int asUInt();
407 
408 
409  // Invalid operations.
410  // <group>
411  float asFloat() { return 0; }
412  int asInt() { return 0; }
413  bool asBool() { return 0; }
414  char asChar() { return 0; }
415  unsigned char asUChar() { return 0; }
416  short int asShort() { return 0; }
417  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
418  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
419  casacore::Record* asRecord() { return 0; }
420  // </group>
421 
422 
423  // If the given TBData is a casacore::String, parses an unsigned int from the String
424  // value. Otherwise, if the given TBData is an unsigned int, sets the
425  // unsigned int value.
426  void setValue(TBData& value);
427 
428  // Returns the unsigned int type.
430 
431  // Returns true if the given data is an unsigned int type and their values
432  // are equal, false otherwise
433  bool equals(TBData* data);
434 
435 private:
436  // Value.
437  unsigned int value;
438 };
439 
440 
441 // <summary>
442 // Implementation of TBData for boolean data.
443 // </summary>
444 
445 class TBDataBool : public TBData {
446 public:
447  // Constructor that parses a boolean from the given String.
449 
450  // Constructor that takes the boolean data.
451  TBDataBool(bool value);
452 
453  // Constructor that calls setValue().
455 
456  virtual ~TBDataBool();
457 
458 
459  // Returns the value in casacore::String form.
461 
462  // Returns the value in double form.
463  double asDouble();
464 
465  // Returns the value in float form.
466  float asFloat();
467 
468  // Returns the value in int form.
469  int asInt();
470 
471  // Returns the value in unsigned int form.
472  unsigned int asUInt();
473 
474  // Returns the value.
475  bool asBool();
476 
477 
478  // Invalid operations.
479  // <group>
480  char asChar() { return 0; }
481  unsigned char asUChar() { return 0; }
482  short int asShort() { return 0; }
483  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
484  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
485  casacore::Record* asRecord() { return 0; }
486  // </group>
487 
488 
489  // If the given TBData is a casacore::String, parses a boolean from the casacore::String value.
490  // Otherwise, if the given TBData is a boolean, sets the boolean value.
491  void setValue(TBData& value);
492 
493  // Returns the boolean type.
495 
496  // Returns true if the given data is a boolean type and their values are
497  // equal, false otherwise
498  bool equals(TBData* data);
499 
500 private:
501  // Value.
502  bool value;
503 };
504 
505 
506 // <summary>
507 // Implementation of TBData for character data.
508 // </summary>
509 
510 class TBDataChar : public TBData {
511 public:
512  // Constructor that takes the first character of the given String.
514 
515  // Constructor that takes the character data.
516  TBDataChar(char value);
517 
518  // Constructor that calls setValue().
520 
521  virtual ~TBDataChar();
522 
523 
524  // Returns the value in casacore::String form.
526 
527  // Returns the value in int form.
528  int asInt();
529 
530  // Returns the value in unsigned int form.
531  unsigned int asUInt();
532 
533  // Returns the value.
534  char asChar();
535 
536 
537  // Invalid operations.
538  // <group>
539  double asDouble() { return 0; }
540  float asFloat() { return 0; }
541  bool asBool() { return 0; }
542  unsigned char asUChar() { return 0; }
543  short int asShort() { return 0; }
544  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
545  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
546  casacore::Record* asRecord() { return 0; }
547  // </group>
548 
549 
550  // If the given TBData is a casacore::String, takes the first character of the
551  // casacore::String value. Otherwise, if the given TBData is a character, sets
552  // the character value.
553  void setValue(TBData& value);
554 
555  // Returns the character type.
557 
558  // Returns true if the given data is a character type and their values are
559  // equal, false otherwise
560  bool equals(TBData* data);
561 
562 private:
563  // Value.
564  char value;
565 };
566 
567 
568 // <summary>
569 // Implementation of TBData for unsigned character data.
570 // </summary>
571 
572 class TBDataUChar : public TBData {
573 public:
574  // Constructor that takes the first character from the given String.
576 
577  // Constructor that takes the unsigned character value.
578  TBDataUChar(unsigned char value);
579 
580  // Constructor that calls setValue().
582 
583  virtual ~TBDataUChar();
584 
585 
586  // Returns the value in casacore::String form.
588 
589  // Returns the value in int form.
590  int asInt();
591 
592  // Returns the value in unsigned int form.
593  unsigned int asUInt();
594 
595  // Returns the value.
596  unsigned char asUChar();
597 
598 
599  // Invalid operations.
600  // <group>
601  double asDouble() { return 0; }
602  float asFloat() { return 0; }
603  bool asBool() { return 0; }
604  char asChar() { return 0; }
605  short int asShort() { return 0; }
606  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
607  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
608  casacore::Record* asRecord() { return 0; }
609  // </group>
610 
611 
612  // If the given TBData is a casacore::String, takes the first character of the
613  // casacore::String value. Otherwise, if the given TBData is an unsigned character,
614  // sets the unsigned character value.
615  void setValue(TBData& value);
616 
617  // Returns the unsigned character type.
619 
620  // Returns true if the given data is an unsigned character type and their
621  // values are equal, false otherwise
622  bool equals(TBData* data);
623 
624 private:
625  // Value.
626  unsigned char value;
627 };
628 
629 
630 // <summary>
631 // Implementation of TBData for short data.
632 // </summary>
633 
634 class TBDataShort : public TBData {
635 public:
636  // Constructor that parses a short from the given String.
638 
639  // Constructor that takes the short data.
640  TBDataShort(short int value);
641 
642  // Constructor that calls setValue().
644 
645  virtual ~TBDataShort();
646 
647 
648  // Returns the value in casacore::String form.
650 
651  // Returns the value in double form.
652  double asDouble();
653 
654  // Returns the value in float form.
655  float asFloat();
656 
657  // Returns the value in int form.
658  int asInt();
659 
660  // Returns the value in unsigned int form.
661  unsigned int asUInt();
662 
663  // Returns the value.
664  short int asShort();
665 
666 
667  // Invalid operations.
668  // <group>
669  bool asBool() { return 0; }
670  char asChar() { return 0; }
671  unsigned char asUChar() { return 0; }
672  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
673  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
674  casacore::Record* asRecord() { return 0; }
675  // </group>
676 
677 
678  // If the given TBData is a casacore::String, parses a short from the casacore::String value.
679  // Otherwise, if the given TBData is a short, sets the short value.
680  void setValue(TBData& value);
681 
682  // Returns the short type.
684 
685  // Returns true if the given data is a short type and their values are
686  // equal, false otherwise
687  bool equals(TBData* data);
688 
689 private:
690  // Value.
691  short int value;
692 };
693 
694 
695 // <summary>
696 // Implementation of TBData for complex data.
697 // </summary>
698 
699 class TBDataComplex : public TBData {
700 public:
701  // Constructor that parses a complex from the given String.
703 
704  // Constructor that takes the complex data.
705  TBDataComplex(std::pair<float, float> value);
706 
707  // Constructor that takes the complex data.
708  TBDataComplex(std::complex<float> value);
709 
710  // Constructor that calls setValue().
712 
713  virtual ~TBDataComplex();
714 
715 
716  // Returns the value in casacore::String form.
718 
719  // Returns the value in double complex form.
720  std::pair<double, double> asDComplex();
721 
722  // Returns the value.
723  std::pair<float, float> asComplex();
724 
725 
726  // Invalid operations.
727  // <group>
728  double asDouble() { return 0; }
729  float asFloat() { return 0; }
730  int asInt() { return 0; }
731  unsigned int asUInt() { return 0; }
732  short int asShort() { return 0; }
733  bool asBool() { return 0; }
734  char asChar() { return 0; }
735  unsigned char asUChar() { return 0; }
736  casacore::Record* asRecord() { return 0; }
737  // </group>
738 
739 
740  // If the given TBData is a casacore::String, parses a complex from the casacore::String value.
741  // Otherwise, if the given TBData is a complex, sets the complex value.
742  void setValue(TBData& value);
743 
744  // Returns the complex type.
746 
747  // Returns true if the given data is a complex type and their values are
748  // equal, false otherwise
749  bool equals(TBData* data);
750 
751 private:
752  // Value.
753  std::pair<float, float> value;
754 };
755 
756 
757 // <summary>
758 // Implementation of TBData for double complex data.
759 // </summary>
760 
761 class TBDataDComplex : public TBData {
762 public:
763  // Constructor that parses a double complex from the given String.
765 
766  // Constructor that takes the double complex data.
767  TBDataDComplex(std::pair<double, double> value);
768 
769  // Constructor that takes the double complex data.
770  TBDataDComplex(std::complex<double> value);
771 
772  // Constructor that calls setValue().
774 
775  virtual ~TBDataDComplex();
776 
777 
778  // Returns the value in casacore::String form.
780 
781  // Returns the value.
782  std::pair<double, double> asDComplex();
783 
784 
785  // Invalid operations.
786  // <group>
787  double asDouble() { return 0; }
788  float asFloat() { return 0; }
789  int asInt() { return 0; }
790  unsigned int asUInt() { return 0; }
791  short int asShort() { return 0; }
792  bool asBool() { return 0; }
793  char asChar() { return 0; }
794  unsigned char asUChar() { return 0; }
795  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
796  casacore::Record* asRecord() { return 0; }
797  // </group>
798 
799 
800  // If the given TBData is a casacore::String, parses a double complex from the
801  // casacore::String value. Otherwise, if the given TBData is a double complex,
802  // sets the double complex value.
803  void setValue(TBData& value);
804 
805  // Returns the double complex type.
807 
808  // Returns true if the given data is a double complex type and their
809  // values are equal, false otherwise
810  bool equals(TBData* data);
811 
812 private:
813  // Value.
814  std::pair<double, double> value;
815 };
816 
817 
818 // <summary>
819 // Implementation of TBData for casacore::Table data.
820 // </summary>
821 //
822 // <synopsis>
823 // Although casacore::Table types are stored differently on disk, for the browser all
824 // we really care about is the location. Therefore TBDataTable is really just
825 // a TBDataString.
826 // </synopsis>
827 
828 class TBDataTable : public TBDataString {
829 public:
830  // Constructor that takes the casacore::String value. See
831  // TBDataString::TBDataString().
833 
834  // Constructor that calls setValue(). See TBDataString::setValue().
836 
838 
839  // Returns the table type.
841 };
842 
843 
844 // <summary>
845 // Implementation of TBData for casacore::Record data.
846 // </summary>
847 
848 class TBDataRecord : public TBData {
849 public:
850  // Constructor that takes the casacore::Record data.
852 
853  // Constructor that takes the casacore::Record data.
855 
856  // Constructor that calls setValue().
858 
859  virtual ~TBDataRecord();
860 
861 
862  // Returns the value in casacore::String form.
864 
865  // Returns the value.
867 
868 
869  // Invalid operations.
870  // <group>
871  double asDouble() { return 0; }
872  float asFloat() { return 0; }
873  int asInt() { return 0; }
874  unsigned int asUInt() { return 0; }
875  short int asShort() { return 0; }
876  bool asBool() { return 0; }
877  char asChar() { return 0; }
878  unsigned char asUChar() { return 0; }
879  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
880  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
881  // </group>
882 
883 
884  // Iff the given TBData is a casacore::Record, sets the casacore::Record value.
885  void setValue(TBData& value);
886 
887  // Returns the casacore::Record type.
889 
890  // Returns true if the given data is a casacore::Record type and their values are
891  // equal, false otherwise
892  bool equals(TBData* data);
893 
894 private:
895  // Value.
897 };
898 
899 
900 // <summary>
901 // Implementation of TBData for date data.
902 // </summary>
903 //
904 // <synopsis>
905 // A date is somewhat special in that the data is stored as a double that
906 // represents Modified Julian Seconds, but when we view the data we want it
907 // in a human-readable form. For this reason, a TBDataDate stores two
908 // values: the double representation and the casacore::String representation.
909 // </synopsis>
910 
911 class TBDataDate : public TBData {
912 public:
913  // Constructor that parses a date from the given casacore::String and then stores
914  // the human-readable value with the given number of decimals.
916 
917  // Constructor that stores the date from the given double and then stores
918  // the human-readable value with the given number of decimals.
919  TBDataDate(double value, int decimals= TBConstants::DEFAULT_DATE_DECIMALS);
920 
921  // Constructor that calls setValue().
923 
924  virtual ~TBDataDate();
925 
926 
927  // Returns the human-readable value.
929 
930  // Returns the value.
931  double asDouble();
932 
933 
934  // Invalid operations.
935  // <group>
936  float asFloat() { return 0; }
937  int asInt() { return 0; }
938  unsigned int asUInt() { return 0; }
939  bool asBool() { return 0; }
940  char asChar() { return 0; }
941  unsigned char asUChar() { return 0; }
942  short int asShort() { return 0; }
943  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
944  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
945  casacore::Record* asRecord() { return 0; }
946  // </group>
947 
948 
949  // If the given TBData is a casacore::String, parses a date from the casacore::String value.
950  // Otherwise, if the given TBData is a double or date, sets the date value.
951  void setValue(TBData& value);
952 
953  // Returns the date type.
955 
956  // Returns true if the given data is a date type and their values are
957  // equal, false otherwise
958  bool equals(TBData* data);
959 
960 private:
961  // Value.
962  double value;
963 
964  // Human-readable representation of value.
966 };
967 
968 
969 // <summary>
970 // casacore::Data type that holds an array.
971 // </summary>
972 //
973 // <synopsis>
974 // TBArrayData is the abstract class for array data types that the browser
975 // knows about. Subclasses of TBArrayData do not have to implement much of
976 // the abstract methods in TBData, but they do have to implement some
977 // array-specific methods. Because of the way the browser is set up, an
978 // array may or may not have actual data loaded into it; generally speaking,
979 // one-dimensional arrays are loaded (copied) immediately upon construction
980 // whereas other arrays must be manually loaded. This is to save space.
981 // </synopsis>
982 
983 class TBArrayData : public TBData {
984 public:
985  // Default Constructor.
986  TBArrayData();
987 
988  ~TBArrayData();
989 
990 
991  // Returns the array's shape.
992  std::vector<int> getShape();
993 
994  // Returns true if the array has data loaded into it, false otherwise.
995  bool isLoaded();
996 
997  // Returns true if the array is one-dimensional, false otherwise.
998  bool isOneDimensional();
999 
1000  // Returns true if the given coordinate is a valid index for this array
1001  // given its shape, false otherwise.
1002  bool coordIsValid(std::vector<int> d);
1003 
1004  // Returns true if the array is empty (i.e., all dimensions have size 0),
1005  // false otherwise.
1006  bool isEmpty();
1007 
1008  // Returns the first item in the array, or NULL if there is no data loaded.
1009  TBData* firstItem();
1010 
1011 
1012  // dataAt() must be implemented by any subclass. Returns a TBData copy
1013  // of the data at the given coordinates, or NULL if the coordinates are
1014  // invalid or there is no loaded data. NOTE: generally speaking, since
1015  // subclasses do not internally store their data as arrays of TBData*,
1016  // the returned TBData object must be deleted by the caller.
1017  virtual TBData* dataAt(std::vector<int> d) = 0;
1018 
1019  // asString() must be implemented by any subclass. Generally speaking,
1020  // should return the array data for one-dimensional arrays or the shape
1021  // and type otherwise.
1022  virtual casacore::String asString() = 0;
1023 
1024  // release() must be implemented by any subclass. If data is loaded,
1025  // release it and free the memory.
1026  virtual bool release() = 0;
1027 
1028  // setDataAt() must be implemented by any subclass. Sets the data at
1029  // the given coordinates to the given value. NOTE: this method's behavior
1030  // is undefined if the type of the TBData does not match the type of the
1031  // array.
1032  virtual void setDataAt(std::vector<int> d, TBData& value) = 0;
1033 
1034 
1035  // Invalid operations.
1036  // <group>
1037  double asDouble() { return 0; }
1038  float asFloat() { return 0; }
1039  int asInt() { return 0; }
1040  unsigned int asUInt() { return 0; }
1041  bool asBool() { return 0; }
1042  char asChar() { return 0; }
1043  unsigned char asUChar() { return 0; }
1044  short int asShort() { return 0; }
1045  std::pair<float, float> asComplex() { return std::pair<float, float>(0, 0); }
1046  std::pair<double, double> asDComplex() { return std::pair<double, double>(0, 0); }
1047  casacore::Record* asRecord() { return 0; }
1048  void setValue(TBData& value) { (void)value; }
1049 
1050  bool equals(TBData* data) { return false; (void)data; }
1051  // </group>
1052 
1053 
1054  // contains() must be implemented by any subclass. Returns true if this
1055  // array has data loaded and contains the given value, false otherwise.
1056  virtual bool contains(TBData* data) = 0;
1057 
1058  // containsBetween() must be implemented by any subclass. Returns true
1059  // if this array has data loaded and contains a value between the two
1060  // given values, false otherwise. NOTE: the behavior is undefined for
1061  // arrays with non-numerical values.
1062  virtual bool containsBetween(TBData* data, TBData* data2) = 0;
1063 
1064  // containsLessThan() must be implemented by any subclass. Returns true
1065  // if this array has data loaded and contains a value less than the
1066  // given value, false otherwise. NOTE: the behavior is undefined for
1067  // arrays with non-numerical values.
1068  virtual bool containsLessThan(TBData* data) = 0;
1069 
1070  // containsGreaterThan() must be implemented by any subclass. Returns true
1071  // if this array has data loaded and contains a value greater than the
1072  // given value, false otherwise. NOTE: the behavior is undefined for
1073  // arrays with non-numerical values.
1074  virtual bool containsGreaterThan(TBData* data) = 0;
1075 
1076  // to1DString() must be implemented by any subclass. Returns a "flattened"
1077  // version of the array.
1078  virtual casacore::String to1DString() = 0;
1079 
1080 protected:
1081  // casacore::Array shape.
1082  std::vector<int> shape;
1083 
1084  // Whether data is loaded.
1085  bool loaded;
1086 
1087  // Whether the array is one-dimensional.
1088  bool oneDim;
1089 };
1090 
1091 
1092 // <summary>
1093 // Implementation of TBArrayData for casacore::String array data.
1094 // </summary>
1095 
1097 public:
1098  // Default constructor. Builds an empty, unloaded array.
1100 
1101  // Constructor that takes the value and whether or not to load (copy) the
1102  // given data or not. Note: data is always loaded for one-dimensional
1103  // arrays.
1104  TBArrayDataString(const casacore::Array<casacore::String>& value, bool full = false);
1105 
1106  // Constructor that copies the given data if it is the correct type.
1108 
1110 
1111 
1112  // See TBArrayData::dataAt(). Returns data of type String.
1113  TBData* dataAt(std::vector<int> d);
1114 
1115  // Returns the value.
1117 
1118  // Returns the casacore::String representation of this array. For one-dimensional,
1119  // loaded arrays returns the values; otherwise returns the shape and type.
1121 
1122  // Loads the given data into the array.
1123  void load(const casacore::Array<casacore::String>& value);
1124 
1125  // Releases the loaded data, if any. Returns whether the release was
1126  // successful or not.
1127  bool release();
1128 
1129  // If the array is loaded, sets the value at the given coordinates (if
1130  // valid) to the given data. This method is not defined if the given
1131  // value is not of the correct type.
1132  void setDataAt(std::vector<int> d, TBData& value);
1133 
1134 
1135  // Returns the casacore::String array type.
1137 
1138  // See TBArrayData::contains(). Returns false if the given data is not
1139  // of type String.
1140  bool contains(TBData* data);
1141 
1142  // See TBArrayData::containsBetween(). Returns false because Strings
1143  // are not numberable.
1144  bool containsBetween(TBData* data, TBData* data2) { return false; (void)data,(void)data2; }
1145 
1146  // See TBArrayData::containsLessThan(). Returns false because Strings
1147  // are not numberable.
1148  bool containsLessThan(TBData* data) { return false; (void)data; }
1149 
1150  // See TBArrayData::containsGreaterThan(). Returns false because Strings
1151  // are not numberable.
1152  bool containsGreaterThan(TBData* data) { (void)data; return false; }
1153 
1154  // See TBArrayData::to1DString().
1156 
1157 private:
1158  // Value.
1160 };
1161 
1162 
1163 // <summary>
1164 // Implementation of TBArrayData for double array data.
1165 // </summary>
1166 
1168 public:
1169  // Default constructor. Builds an empty, unloaded array.
1171 
1172  // Constructor that takes the value and whether or not to load (copy) the
1173  // given data or not. Note: data is always loaded for one-dimensional
1174  // arrays.
1175  TBArrayDataDouble(const casacore::Array<casacore::Double>& value, bool full = false);
1176 
1177  // Constructor that copies the given data if it is the correct type.
1179 
1181 
1182 
1183  // See TBArrayData::dataAt(). Returns data of type double.
1184  TBData* dataAt(std::vector<int> d);
1185 
1186  // Returns the value.
1188 
1189  // Returns the casacore::String representation of this array. For one-dimensional,
1190  // loaded arrays returns the values; otherwise returns the shape and type.
1192 
1193  // Loads the given data into the array.
1194  void load(const casacore::Array<casacore::Double>& value);
1195 
1196  // Releases the loaded data, if any. Returns whether the release was
1197  // successful or not.
1198  bool release();
1199 
1200  // If the array is loaded, sets the value at the given coordinates (if
1201  // valid) to the given data. This method is not defined if the given
1202  // value is not of the correct type.
1203  void setDataAt(std::vector<int> d, TBData& value);
1204 
1205 
1206  // Returns the double array type.
1208 
1209  // See TBArrayData::contains(). Returns false if the given data is not
1210  // of type double.
1211  bool contains(TBData* data);
1212 
1213  // See TBArrayData::containsBetween(). Returns false if either data is
1214  // not of type double.
1215  bool containsBetween(TBData* data, TBData* data2);
1216 
1217  // See TBArrayData::containsLessThan(). Returns false if either data is
1218  // not of type double.
1219  bool containsLessThan(TBData* data);
1220 
1221  // See TBArrayData::containsGreaterThan(). Returns false if either data is
1222  // not of type double.
1223  bool containsGreaterThan(TBData* data);
1224 
1225  // See TBArrayData::to1DString().
1227 
1228 private:
1229  // Value.
1231 };
1232 
1233 
1234 // <summary>
1235 // Implementation of TBArrayData for float array data.
1236 // </summary>
1237 
1239 public:
1240  // Default constructor. Builds an empty, unloaded array.
1241  TBArrayDataFloat();
1242 
1243  // Constructor that takes the value and whether or not to load (copy) the
1244  // given data or not. Note: data is always loaded for one-dimensional
1245  // arrays.
1246  TBArrayDataFloat(const casacore::Array<casacore::Float>& value, bool full = false);
1247 
1248  // Constructor that copies the given data if it is the correct type.
1250 
1252 
1253 
1254  // See TBArrayData::dataAt(). Returns data of type float.
1255  TBData* dataAt(std::vector<int> d);
1256 
1257  // Returns the value.
1259 
1260  // Returns the casacore::String representation of this array. For one-dimensional,
1261  // loaded arrays returns the values; otherwise returns the shape and type.
1263 
1264  // Loads the given data into the array.
1265  void load(const casacore::Array<casacore::Float>& value);
1266 
1267  // Releases the loaded data, if any. Returns whether the release was
1268  // successful or not.
1269  bool release();
1270 
1271  // If the array is loaded, sets the value at the given coordinates (if
1272  // valid) to the given data. This method is not defined if the given
1273  // value is not of the correct type.
1274  void setDataAt(std::vector<int> d, TBData& value);
1275 
1276 
1277  // Returns the float array type.
1279 
1280  // See TBArrayData::contains(). Returns false if the given data is not
1281  // of type float.
1282  bool contains(TBData* data);
1283 
1284  // See TBArrayData::containsBetween(). Returns false if either data is
1285  // not of type float.
1286  bool containsBetween(TBData* data, TBData* data2);
1287 
1288  // See TBArrayData::containsLessThan(). Returns false if either data is
1289  // not of type float.
1290  bool containsLessThan(TBData* data);
1291 
1292  // See TBArrayData::containsGreaterThan(). Returns false if either data is
1293  // not of type float.
1294  bool containsGreaterThan(TBData* data);
1295 
1296  // See TBArrayData::to1DString().
1298 
1299 private:
1300  // Value.
1302 };
1303 
1304 
1305 // <summary>
1306 // Implementation of TBArrayData for int array data.
1307 // </summary>
1308 
1309 class TBArrayDataInt : public TBArrayData {
1310 public:
1311  // Default constructor. Builds an empty, unloaded array.
1312  TBArrayDataInt();
1313 
1314  // Constructor that takes the value and whether or not to load (copy) the
1315  // given data or not. Note: data is always loaded for one-dimensional
1316  // arrays.
1317  TBArrayDataInt(const casacore::Array<casacore::Int>& value, bool full = false);
1318 
1319  // Constructor that copies the given data if it is the correct type.
1321 
1322  ~TBArrayDataInt();
1323 
1324 
1325  // See TBArrayData::dataAt(). Returns data of type int.
1326  TBData* dataAt(std::vector<int> d);
1327 
1328  // Returns the value.
1330 
1331  // Returns the casacore::String representation of this array. For one-dimensional,
1332  // loaded arrays returns the values; otherwise returns the shape and type.
1334 
1335  // Loads the given data into the array.
1336  void load(const casacore::Array<casacore::Int>& value);
1337 
1338  // Releases the loaded data, if any. Returns whether the release was
1339  // successful or not.
1340  bool release();
1341 
1342  // If the array is loaded, sets the value at the given coordinates (if
1343  // valid) to the given data. This method is not defined if the given
1344  // value is not of the correct type.
1345  void setDataAt(std::vector<int> d, TBData& value);
1346 
1347 
1348  // Returns the int array type.
1350 
1351  // See TBArrayData::contains(). Returns false if the given data is not
1352  // of type int.
1353  bool contains(TBData* data);
1354 
1355  // See TBArrayData::containsBetween(). Returns false if either data is
1356  // not of type int.
1357  bool containsBetween(TBData* data, TBData* data2);
1358 
1359  // See TBArrayData::containsLessThan(). Returns false if either data is
1360  // not of type int.
1361  bool containsLessThan(TBData* data);
1362 
1363  // See TBArrayData::containsGreaterThan(). Returns false if either data is
1364  // not of type int.
1365  bool containsGreaterThan(TBData* data);
1366 
1367  // See TBArrayData::to1DString().
1369 
1370 private:
1371  // Value.
1373 };
1374 
1375 
1376 // <summary>
1377 // Implementation of TBArrayData for unsigned int array data.
1378 // </summary>
1379 
1381 public:
1382  // Default constructor. Builds an empty, unloaded array.
1383  TBArrayDataUInt();
1384 
1385  // Constructor that takes the value and whether or not to load (copy) the
1386  // given data or not. Note: data is always loaded for one-dimensional
1387  // arrays.
1388  TBArrayDataUInt(const casacore::Array<casacore::uInt>& value, bool full = false);
1389 
1390  // Constructor that copies the given data if it is the correct type.
1392 
1393  ~TBArrayDataUInt();
1394 
1395 
1396  // See TBArrayData::dataAt(). Returns data of type unsigned int.
1397  TBData* dataAt(std::vector<int> d);
1398 
1399  // Returns the value.
1401 
1402  // Returns the casacore::String representation of this array. For one-dimensional,
1403  // loaded arrays returns the values; otherwise returns the shape and type.
1405 
1406  // Loads the given data into the array.
1407  void load(const casacore::Array<casacore::uInt>& value);
1408 
1409  // Releases the loaded data, if any. Returns whether the release was
1410  // successful or not.
1411  bool release();
1412 
1413  // If the array is loaded, sets the value at the given coordinates (if
1414  // valid) to the given data. This method is not defined if the given
1415  // value is not of the correct type.
1416  void setDataAt(std::vector<int> d, TBData& value);
1417 
1418 
1419  // Returns the unsigned int array type.
1421 
1422  // See TBArrayData::contains(). Returns false if the given data is not
1423  // of type unsigned int.
1424  bool contains(TBData* data);
1425 
1426  // See TBArrayData::containsBetween(). Returns false if either data is
1427  // not of type unsigned int.
1428  bool containsBetween(TBData* data, TBData* data2);
1429 
1430  // See TBArrayData::containsLessThan(). Returns false if either data is
1431  // not of type unsigned int.
1432  bool containsLessThan(TBData* data);
1433 
1434  // See TBArrayData::containsGreaterThan(). Returns false if either data is
1435  // not of type unsigned int.
1436  bool containsGreaterThan(TBData* data);
1437 
1438  // See TBArrayData::to1DString().
1440 
1441 private:
1442  // Value.
1444 };
1445 
1446 
1447 // <summary>
1448 // Implementation of TBArrayData for boolean array data.
1449 // </summary>
1450 
1452 public:
1453  // Default constructor. Builds an empty, unloaded array.
1454  TBArrayDataBool();
1455 
1456  // Constructor that takes the value and whether or not to load (copy) the
1457  // given data or not. Note: data is always loaded for one-dimensional
1458  // arrays.
1459  TBArrayDataBool(const casacore::Array<casacore::Bool>& value, bool full = false);
1460 
1461  // Constructor that copies the given data if it is the correct type.
1463 
1464  ~TBArrayDataBool();
1465 
1466 
1467  // See TBArrayData::dataAt(). Returns data of type boolean.
1468  TBData* dataAt(std::vector<int> d);
1469 
1470  // Returns the value.
1472 
1473  // Returns the casacore::String representation of this array. For one-dimensional,
1474  // loaded arrays returns the values; otherwise returns the shape and type.
1476 
1477  // Loads the given data into the array.
1478  void load(const casacore::Array<casacore::Bool>& value);
1479 
1480  // Releases the loaded data, if any. Returns whether the release was
1481  // successful or not.
1482  bool release();
1483 
1484  // If the array is loaded, sets the value at the given coordinates (if
1485  // valid) to the given data. This method is not defined if the given
1486  // value is not of the correct type.
1487  void setDataAt(std::vector<int> d, TBData& value);
1488 
1489 
1490  // Returns the boolean array type.
1492 
1493  // See TBArrayData::contains(). Returns false if the given data is not
1494  // of type boolean.
1495  bool contains(TBData* data);
1496 
1497  // See TBArrayData::containsBetween(). Returns false if either data is
1498  // not of type boolean.
1499  bool containsBetween(TBData* data, TBData* data2);
1500 
1501  // See TBArrayData::containsLessThan(). Returns false if either data is
1502  // not of type boolean.
1503  bool containsLessThan(TBData* data);
1504 
1505  // See TBArrayData::containsGreaterThan(). Returns false if either data is
1506  // not of type boolean.
1507  bool containsGreaterThan(TBData* data);
1508 
1509  // See TBArrayData::to1DString().
1511 
1512 private:
1513  // Value.
1515 };
1516 
1517 
1518 // <summary>
1519 // Implementation of TBArrayData for character array data.
1520 // </summary>
1521 
1523 public:
1524  // Default constructor. Builds an empty, unloaded array.
1525  TBArrayDataChar();
1526 
1527  // Constructor that takes the value and whether or not to load (copy) the
1528  // given data or not. Note: data is always loaded for one-dimensional
1529  // arrays.
1530  TBArrayDataChar(const casacore::Array<casacore::Char>& value, bool full = false);
1531 
1532  // Constructor that copies the given data if it is the correct type.
1534 
1535  ~TBArrayDataChar();
1536 
1537 
1538  // See TBArrayData::dataAt(). Returns data of type character.
1539  TBData* dataAt(std::vector<int> d);
1540 
1541  // Returns the value.
1543 
1544  // Returns the casacore::String representation of this array. For one-dimensional,
1545  // loaded arrays returns the values; otherwise returns the shape and type.
1547 
1548  // Loads the given data into the array.
1549  void load(const casacore::Array<casacore::Char>& value);
1550 
1551  // Releases the loaded data, if any. Returns whether the release was
1552  // successful or not.
1553  bool release();
1554 
1555  // If the array is loaded, sets the value at the given coordinates (if
1556  // valid) to the given data. This method is not defined if the given
1557  // value is not of the correct type.
1558  void setDataAt(std::vector<int> d, TBData& value);
1559 
1560 
1561  // Returns the character array type.
1563 
1564  // See TBArrayData::contains(). Returns false if the given data is not
1565  // of type character.
1566  bool contains(TBData* data);
1567 
1568  // See TBArrayData::containsBetween(). Returns false if either data is
1569  // not of type character.
1570  bool containsBetween(TBData* data, TBData* data2);
1571 
1572  // See TBArrayData::containsLessThan(). Returns false if either data is
1573  // not of type character.
1574  bool containsLessThan(TBData* data);
1575 
1576  // See TBArrayData::containsGreaterThan(). Returns false if either data is
1577  // not of type character.
1578  bool containsGreaterThan(TBData* data);
1579 
1580  // See TBArrayData::to1DString().
1582 
1583 private:
1584  // Value.
1586 };
1587 
1588 
1589 // <summary>
1590 // Implementation of TBArrayData for unsigned character array data.
1591 // </summary>
1592 
1594 public:
1595  // Default constructor. Builds an empty, unloaded array.
1596  TBArrayDataUChar();
1597 
1598  // Constructor that takes the value and whether or not to load (copy) the
1599  // given data or not. Note: data is always loaded for one-dimensional
1600  // arrays.
1601  TBArrayDataUChar(const casacore::Array<casacore::uChar>& value, bool full = false);
1602 
1603  // Constructor that copies the given data if it is the correct type.
1605 
1607 
1608 
1609  // See TBArrayData::dataAt(). Returns data of type unsigned character.
1610  TBData* dataAt(std::vector<int> d);
1611 
1612  // Returns the value.
1614 
1615  // Returns the casacore::String representation of this array. For one-dimensional,
1616  // loaded arrays returns the values; otherwise returns the shape and type.
1618 
1619  // Loads the given data into the array.
1620  void load(const casacore::Array<casacore::uChar>& value);
1621 
1622  // Releases the loaded data, if any. Returns whether the release was
1623  // successful or not.
1624  bool release();
1625 
1626  // If the array is loaded, sets the value at the given coordinates (if
1627  // valid) to the given data. This method is not defined if the given
1628  // value is not of the correct type.
1629  void setDataAt(std::vector<int> d, TBData& value);
1630 
1631 
1632  // Returns the unsigned character array type.
1634 
1635  // See TBArrayData::contains(). Returns false if the given data is not
1636  // of type unsigned char.
1637  bool contains(TBData* data);
1638 
1639  // See TBArrayData::containsBetween(). Returns false if either data is
1640  // not of type unsigned character.
1641  bool containsBetween(TBData* data, TBData* data2);
1642 
1643  // See TBArrayData::containsLessThan(). Returns false if either data is
1644  // not of type unsigned character.
1645  bool containsLessThan(TBData* data);
1646 
1647  // See TBArrayData::containsGreaterThan(). Returns false if either data is
1648  // not of type unsigned character.
1649  bool containsGreaterThan(TBData* data);
1650 
1651  // See TBArrayData::to1DString().
1653 
1654 private:
1655  // Value.
1657 };
1658 
1659 
1660 // <summary>
1661 // Implementation of TBArrayData for short array data.
1662 // </summary>
1663 
1665 public:
1666  // Default constructor. Builds an empty, unloaded array.
1667  TBArrayDataShort();
1668 
1669  // Constructor that takes the value and whether or not to load (copy) the
1670  // given data or not. Note: data is always loaded for one-dimensional
1671  // arrays.
1672  TBArrayDataShort(const casacore::Array<casacore::Short>& value, bool full = false);
1673 
1674  // Constructor that copies the given data if it is the correct type.
1676 
1678 
1679 
1680  // See TBArrayData::dataAt(). Returns data of type short.
1681  TBData* dataAt(std::vector<int> d);
1682 
1683  // Returns the value.
1685 
1686  // Returns the casacore::String representation of this array. For one-dimensional,
1687  // loaded arrays returns the values; otherwise returns the shape and type.
1689 
1690  // Loads the given data into the array.
1691  void load(const casacore::Array<casacore::Short>& value);
1692 
1693  // Releases the loaded data, if any. Returns whether the release was
1694  // successful or not.
1695  bool release();
1696 
1697  // If the array is loaded, sets the value at the given coordinates (if
1698  // valid) to the given data. This method is not defined if the given
1699  // value is not of the correct type.
1700  void setDataAt(std::vector<int> d, TBData& value);
1701 
1702 
1703  // Returns the short array type.
1705 
1706  // See TBArrayData::contains(). Returns false if the given data is not
1707  // of type short.
1708  bool contains(TBData* data);
1709 
1710  // See TBArrayData::containsBetween(). Returns false if either data is
1711  // not of type short.
1712  bool containsBetween(TBData* data, TBData* data2);
1713 
1714  // See TBArrayData::containsLessThan(). Returns false if either data is
1715  // not of type short.
1716  bool containsLessThan(TBData* data);
1717 
1718  // See TBArrayData::containsGreaterThan(). Returns false if either data is
1719  // not of type short.
1720  bool containsGreaterThan(TBData* data);
1721 
1722  // See TBArrayData::to1DString().
1724 
1725 private:
1726  // Value.
1728 };
1729 
1730 
1731 // <summary>
1732 // Implementation of TBArrayData for complex array data.
1733 // </summary>
1734 
1736 public:
1737  // Default constructor. Builds an empty, unloaded array.
1739 
1740  // Constructor that takes the value and whether or not to load (copy) the
1741  // given data or not. Note: data is always loaded for one-dimensional
1742  // arrays.
1743  TBArrayDataComplex(const casacore::Array<casacore::Complex>& value, bool full = false);
1744 
1745  // Constructor that copies the given data if it is the correct type.
1747 
1749 
1750 
1751  // See TBArrayData::dataAt(). Returns data of type complex.
1752  TBData* dataAt(std::vector<int> d);
1753 
1754  // Returns the value.
1756 
1757  // Returns the casacore::String representation of this array. For one-dimensional,
1758  // loaded arrays returns the values; otherwise returns the shape and type.
1760 
1761  // Loads the given data into the array.
1762  void load(const casacore::Array<casacore::Complex>& value);
1763 
1764  // Releases the loaded data, if any. Returns whether the release was
1765  // successful or not.
1766  bool release();
1767 
1768  // If the array is loaded, sets the value at the given coordinates (if
1769  // valid) to the given data. This method is not defined if the given
1770  // value is not of the correct type.
1771  void setDataAt(std::vector<int> d, TBData& value);
1772 
1773 
1774  // Returns the complex array type.
1776 
1777  // See TBArrayData::contains(). Returns false if the given data is not
1778  // of type complex.
1779  bool contains(TBData* data);
1780 
1781  // See TBArrayData::containsBetween(). Returns false if either data is
1782  // not of type complex.
1783  bool containsBetween(TBData* data, TBData* data2);
1784 
1785  // See TBArrayData::containsLessThan(). Returns false if either data is
1786  // not of type complex.
1787  bool containsLessThan(TBData* data);
1788 
1789  // See TBArrayData::containsGreaterThan(). Returns false if either data is
1790  // not of type complex.
1791  bool containsGreaterThan(TBData* data);
1792 
1793  // See TBArrayData::to1DString().
1795 
1796 private:
1797  // Value.
1799 };
1800 
1801 
1802 // <summary>
1803 // Implementation of TBArrayData for double complex array data.
1804 // </summary>
1805 
1807 public:
1808  // Default constructor. Builds an empty, unloaded array.
1810 
1811  // Constructor that takes the value and whether or not to load (copy) the
1812  // given data or not. Note: data is always loaded for one-dimensional
1813  // arrays.
1815 
1816  // Constructor that copies the given data if it is the correct type.
1818 
1820 
1821 
1822  // See TBArrayData::dataAt(). Returns data of type double complex.
1823  TBData* dataAt(std::vector<int> d);
1824 
1825  // Returns the value.
1827 
1828  // Returns the casacore::String representation of this array. For one-dimensional,
1829  // loaded arrays returns the values; otherwise returns the shape and type.
1831 
1832  // Loads the given data into the array.
1833  void load(const casacore::Array<casacore::DComplex>& value);
1834 
1835  // Releases the loaded data, if any. Returns whether the release was
1836  // successful or not.
1837  bool release();
1838 
1839  // If the array is loaded, sets the value at the given coordinates (if
1840  // valid) to the given data. This method is not defined if the given
1841  // value is not of the correct type.
1842  void setDataAt(std::vector<int> d, TBData& value);
1843 
1844 
1845  // Returns the double complex array type.
1847 
1848  // See TBArrayData::contains(). Returns false if the given data is not
1849  // of type double complex.
1850  bool contains(TBData* data);
1851 
1852  // See TBArrayData::containsBetween(). Returns false if either data is
1853  // not of type double complex.
1854  bool containsBetween(TBData* data, TBData* data2);
1855 
1856  // See TBArrayData::containsLessThan(). Returns false if either data is
1857  // not of type double complex.
1858  bool containsLessThan(TBData* data);
1859 
1860  // See TBArrayData::containsGreaterThan(). Returns false if either data is
1861  // not of type double complex.
1862  bool containsGreaterThan(TBData* data);
1863 
1864  // See TBArrayData::to1DString().
1866 
1867 private:
1868  // Value.
1870 };
1871 
1872 }
1873 
1874 #endif /*TBDATA_H_*/
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:482
casacore::String getType()
Returns the double complex array type.
Definition: TBData.h:1846
virtual void setDataAt(std::vector< int > d, TBData &value)=0
setDataAt() must be implemented by any subclass.
void load(const casacore::Array< casacore::Complex > &value)
Loads the given data into the array.
bool release()
Releases the loaded data, if any.
TBDataUChar(casacore::String value)
Constructor that takes the first character from the given String.
virtual ~TBDataDate()
casacore::Record * asRecord()
Returns the value.
void setValue(TBData &value)
If the given TBData is a casacore::String, parses an unsigned int from the String value...
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
casacore::String asString()
Returns the human-readable value.
casacore::String displayValue()
See TBData::asString().
int asInt()
Returns the value in int form.
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:671
bool release()
Releases the loaded data, if any.
void setValue(TBData &value)
If the given TBData is a casacore::String, takes the first character of the casacore::String value...
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:300
casacore::String getType()
Returns the float array type.
Definition: TBData.h:1278
casacore::Array< casacore::Float > & data()
Returns the value.
Definition: TBData.h:1258
double asDouble()
Returns the value.
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:1042
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:544
static const casacore::String TYPE_SHORT
Definition: TBConstants.h:252
static const int DEFAULT_DATE_DECIMALS
Holds the default number of decimals displayed in a date.
Definition: TBConstants.h:352
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:734
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:794
virtual TBData * dataAt(std::vector< int > d)=0
dataAt() must be implemented by any subclass.
bool equals(TBData *data)
equals() must be implemented by any subclass.
Definition: TBData.h:1050
TBArrayDataShort()
Default constructor.
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
Definition: TBData.h:1148
int asInt()
asInt() must be implemented by any subclass, although the returned value does not have to be valid fo...
Definition: TBData.h:1039
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:358
casacore::String to1DString()
See TBArrayData::to1DString().
std::pair< double, double > asDComplex()
Returns the value.
TBDataChar(casacore::String value)
Constructor that takes the first character of the given String.
casacore::String asString()
Returns the casacore::String representation of this array.
virtual bool asBool()=0
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
virtual casacore::Record * asRecord()=0
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
std::vector< int > shape
casacore::Array shape.
Definition: TBData.h:1082
virtual unsigned char asUChar()=0
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Implementation of TBArrayData for complex array data.
Definition: TBData.h:1735
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:243
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:1044
bool contains(TBData *data)
See TBArrayData::contains().
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:606
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:608
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:240
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
casacore::String asString()
Returns the value in casacore::String form.
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:940
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:878
static const casacore::String TYPE_ARRAY_CHAR
Definition: TBConstants.h:265
bool contains(TBData *data)
See TBArrayData::contains().
static const casacore::String TYPE_UCHAR
Definition: TBConstants.h:251
casacore::String to1DString()
See TBArrayData::to1DString().
static const casacore::String TYPE_BOOL
Definition: TBConstants.h:249
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:791
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:877
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
double asDouble()
Invalid operations.
Definition: TBData.h:728
casacore::String getType()
Returns the unsigned int type.
Definition: TBData.h:429
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
TBDataShort(casacore::String value)
Constructor that parses a short from the given String.
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:242
unsigned int asUInt()
asUInt() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:938
bool asBool()
Returns the value.
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:670
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:238
static const casacore::String TYPE_INT
Definition: TBConstants.h:247
unsigned int asUInt()
Returns the value in unsigned int form.
void setValue(TBData &value)
Sets the value to the result of calling asString() on the given TBData.
void load(const casacore::Array< casacore::DComplex > &value)
Loads the given data into the array.
double value
Value.
Definition: TBData.h:259
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
bool contains(TBData *data)
See TBArrayData::contains().
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
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
casacore::String getType()
Returns the int array type.
Definition: TBData.h:1349
casacore::Array< casacore::Int > value
Value.
Definition: TBData.h:1372
bool isOneDimensional()
Returns true if the array is one-dimensional, false otherwise.
void setValue(TBData &value)
If the given TBData is a casacore::String, parses a complex from the casacore::String value...
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:1045
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
Implementation of TBArrayData for casacore::String array data.
Definition: TBData.h:1096
float asFloat()
Returns the float value.
bool asBool()
Invalid operations.
Definition: TBData.h:669
casacore::String to1DString()
See TBArrayData::to1DString().
virtual Type type()
Return the type enum.
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:542
void setValue(TBData &value)
If the given TBData is a casacore::String, parses a date from the casacore::String value...
bool contains(TBData *data)
See TBArrayData::contains().
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:187
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:237
virtual bool release()=0
release() must be implemented by any subclass.
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:419
casacore::Data types used for loaded data.
Definition: TBData.h:51
Implementation of TBArrayData for double array data.
Definition: TBData.h:1167
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:603
bool equals(TBData *data)
Returns true if the given data is a double complex type and their values are equal, false otherwise.
Implementation of TBData for date data.
Definition: TBData.h:911
virtual char asChar()=0
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
virtual bool containsLessThan(TBData *data)=0
containsLessThan() must be implemented by any subclass.
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:939
int asInt()
asInt() must be implemented by any subclass, although the returned value does not have to be valid fo...
Definition: TBData.h:873
casacore::String getType()
Returns the unsigned character type.
Definition: TBData.h:618
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:413
virtual ~TBDataUChar()
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:604
unsigned int asUInt()
Returns the value in unsigned int form.
virtual ~TBDataInt()
Implementation of TBArrayData for unsigned character array data.
Definition: TBData.h:1593
casacore::String to1DString()
See TBArrayData::to1DString().
TBDataTable(casacore::String value)
Constructor that takes the casacore::String value.
Definition: TBData.h:832
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:181
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:355
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:483
static const casacore::String TYPE_ARRAY_INT
Definition: TBConstants.h:262
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:297
static const casacore::String TYPE_COMPLEX
Definition: TBConstants.h:253
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
casacore::String to1DString()
See TBArrayData::to1DString().
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:239
casacore::String asString()
Returns the value in casacore::String form.
void load(const casacore::Array< casacore::Double > &value)
Loads the given data into the array.
bool release()
Releases the loaded data, if any.
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:673
casacore::String asString()
Returns the casacore::String representation of this array.
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:295
unsigned int asUInt()
Returns the value.
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
casacore::String asString()
Returns the casacore::String representation of this array.
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
bool isLoaded()
Returns true if the array has data loaded into it, false otherwise.
int asInt()
asInt() must be implemented by any subclass, although the returned value does not have to be valid fo...
Definition: TBData.h:789
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
Implementation of TBData for short data.
Definition: TBData.h:634
unsigned char value
Value.
Definition: TBData.h:626
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:184
void load(const casacore::Array< casacore::Int > &value)
Loads the given data into the array.
casacore::String to1DString()
See TBArrayData::to1DString().
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
casacore::String getType()
Returns the complex array type.
Definition: TBData.h:1775
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:298
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
casacore::String getType()
Returns the double type.
Definition: TBData.h:251
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
Implementation of TBData for unsigned int data.
Definition: TBData.h:385
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:354
static const casacore::String TYPE_FLOAT
Definition: TBConstants.h:246
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
TBArrayDataString()
Default constructor.
virtual double asDouble()=0
asDouble() must be implemented by any subclass, although the returned value does not have to be valid...
float asFloat()
asFloat() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:872
casacore::String getType()
Returns the casacore::String type.
Definition: TBData.h:195
casacore::String to1DString()
See TBArrayData::to1DString().
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:186
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:299
casacore::Array< casacore::uInt > value
Value.
Definition: TBData.h:1443
TBArrayData()
Default Constructor.
TBArrayDataFloat()
Default constructor.
short int asShort()
Returns the value.
Implementation of TBArrayData for short array data.
Definition: TBData.h:1664
virtual ~TBDataShort()
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:672
Implementation of TBArrayData for double complex array data.
Definition: TBData.h:1806
double asDouble()
Invalid operations.
Definition: TBData.h:1037
double asDouble()
Returns the value in double form.
bool contains(TBData *data)
See TBArrayData::contains().
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:546
void setValue(TBData &value)
If the given TBData is a casacore::String, parses a double complex from the casacore::String value...
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:415
virtual bool containsBetween(TBData *data, TBData *data2)=0
containsBetween() must be implemented by any subclass.
double asDouble()
Invalid operations.
Definition: TBData.h:871
unsigned int asUInt()
asUInt() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:294
std::pair< float, float > value
Value.
Definition: TBData.h:753
casacore::String asString()
Returns the value in casacore::String form.
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:1047
casacore::String asString()
Returns the value in casacore::String form.
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
casacore::String getType()
Returns the float type.
Definition: TBData.h:310
casacore::String asString()
Returns the value in casacore::String form.
casacore::Array< casacore::DComplex > value
Value.
Definition: TBData.h:1869
unsigned int asUInt()
asUInt() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:236
static const casacore::String TYPE_CHAR
Definition: TBConstants.h:250
virtual int asInt()=0
asInt() must be implemented by any subclass, although the returned value does not have to be valid fo...
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:943
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:793
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
static TBData * create(casacore::String value, casacore::String type)
Creates and returns a TBData object representing the given value and type.
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:605
casacore::String asString()
Returns the value in casacore::String form.
bool oneDim
Whether the array is one-dimensional.
Definition: TBData.h:1088
unsigned int asUInt()
asUInt() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:790
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
Implementation of TBData for casacore::String data.
Definition: TBData.h:161
static const casacore::String TYPE_ARRAY_BOOL
Definition: TBConstants.h:264
int asInt()
asInt() must be implemented by any subclass, although the returned value does not have to be valid fo...
Definition: TBData.h:235
virtual float asFloat()=0
asFloat() must be implemented by any subclass, although the returned value does not have to be valid ...
int asInt()
Invalid operations.
Definition: TBData.h:293
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
casacore::Data type that holds an array.
Definition: TBData.h:983
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:674
unsigned int value
Value.
Definition: TBData.h:437
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
bool contains(TBData *data)
See TBArrayData::contains().
float asFloat()
asFloat() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:540
static const casacore::String TYPE_ARRAY_DCOMPLEX
Definition: TBConstants.h:269
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:359
std::pair< double, double > asDComplex()
Returns the value in double complex form.
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:875
void setValue(TBData &value)
If the given TBData is a casacore::String, parses a short from the casacore::String value...
static const casacore::String TYPE_ARRAY_COMPLEX
Definition: TBConstants.h:268
bool equals(TBData *data)
Returns true if the given data is an int type and their values are equal, false otherwise.
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
casacore::Array< casacore::Short > value
Value.
Definition: TBData.h:1727
std::vector< int > getShape()
Returns the array&#39;s shape.
casacore::String asString()
Returns the value in casacore::String form.
Implementation of TBData for character data.
Definition: TBData.h:510
void setValue(TBData &value)
If the given TBData is a casacore::String, parses an int from the casacore::String value...
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:481
Implementation of TBData for complex data.
Definition: TBData.h:699
virtual ~TBDataDComplex()
Implementation of TBArrayData for int array data.
Definition: TBData.h:1309
TBDataInt(casacore::String value)
Constructor that parses an int from the given String.
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
void load(const casacore::Array< casacore::Float > &value)
Loads the given data into the array.
void load(const casacore::Array< casacore::uChar > &value)
Loads the given data into the array.
Implementation of TBData for double data.
Definition: TBData.h:211
virtual ~TBDataComplex()
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:417
casacore::String to1DString()
See TBArrayData::to1DString().
virtual ~TBDataDouble()
casacore::Array< casacore::DComplex > & data()
Returns the value.
Definition: TBData.h:1826
casacore::String asString()
Returns the value in casacore::String form.
int asInt()
asInt() must be implemented by any subclass, although the returned value does not have to be valid fo...
Definition: TBData.h:412
char value
Value.
Definition: TBData.h:564
void setValue(TBData &value)
If the given TBData is a casacore::String, parses a boolean from the casacore::String value...
float asFloat()
Invalid operations.
Definition: TBData.h:352
casacore::String getType()
Returns the character type.
Definition: TBData.h:556
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:183
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:1043
casacore::String valueStr
Human-readable representation of value.
Definition: TBData.h:965
void setValue(TBData &value)
If the given TBData is a casacore::String, takes the first character of the casacore::String value...
TBArrayDataBool()
Default constructor.
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:484
bool equals(TBData *data)
Returns true if the given data is an unsigned int type and their values are equal, false otherwise.
bool value
Value.
Definition: TBData.h:502
virtual casacore::String to1DString()=0
to1DString() must be implemented by any subclass.
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:607
bool contains(TBData *data)
See TBArrayData::contains().
casacore::String getType()
Returns the short type.
Definition: TBData.h:683
bool equals(TBData *data)
Returns true if the given data is a casacore::String type and the values are equals, false otherwise.
float asFloat()
Invalid operations.
Definition: TBData.h:234
bool equals(TBData *data)
Returns true if the given data is a character type and their values are equal, false otherwise...
virtual unsigned int asUInt()=0
asUInt() must be implemented by any subclass, although the returned value does not have to be valid f...
casacore::Array< casacore::Double > value
Value.
Definition: TBData.h:1230
bool loaded
Whether data is loaded.
Definition: TBData.h:1085
static const casacore::String TYPE_ARRAY_FLOAT
Definition: TBConstants.h:261
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:876
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:541
casacore::Array< casacore::uChar > & data()
Returns the value.
Definition: TBData.h:1613
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
Definition: TBData.h:1144
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
void load(const casacore::Array< casacore::String > &value)
Loads the given data into the array.
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
Definition: TBData.h:1152
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:942
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
casacore::Array< casacore::Char > value
Value.
Definition: TBData.h:1585
float value
Value.
Definition: TBData.h:318
virtual bool containsGreaterThan(TBData *data)=0
containsGreaterThan() must be implemented by any subclass.
casacore::Array< casacore::Bool > & data()
Returns the value.
Definition: TBData.h:1471
virtual std::pair< float, float > asComplex()=0
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:1046
casacore::Array< casacore::String > value
Value.
Definition: TBData.h:1159
casacore::Array< casacore::Short > & data()
Returns the value.
Definition: TBData.h:1684
TBArrayDataDComplex()
Default constructor.
static const casacore::String TYPE_DATE
Definition: TBConstants.h:257
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:543
virtual ~TBDataChar()
casacore::Array< casacore::Complex > & data()
Returns the value.
Definition: TBData.h:1755
static const casacore::String TYPE_ARRAY_STRING
Definition: TBConstants.h:259
casacore::String getType()
Returns the int type.
Definition: TBData.h:369
int asInt()
Returns the value in int form.
Implementation of TBData for double complex data.
Definition: TBData.h:761
static const casacore::String TYPE_ARRAY_SHORT
Definition: TBConstants.h:267
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:182
virtual ~TBDataBool()
bool contains(TBData *data)
See TBArrayData::contains().
static const casacore::String TYPE_RECORD
Definition: TBConstants.h:256
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool release()
Releases the loaded data, if any.
casacore::String asString()
Returns the casacore::String representation of this array.
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:414
bool equals(TBData *data)
Returns true if the given data is an unsigned character type and their values are equal...
virtual casacore::String getType()=0
getType() must be implemented by any subclass.
int asInt()
Returns the value in int form.
void load(const casacore::Array< casacore::uInt > &value)
Loads the given data into the array.
static const casacore::String TYPE_ARRAY_UCHAR
Definition: TBConstants.h:266
bool release()
Releases the loaded data, if any.
TBArrayDataInt()
Default constructor.
TBDataFloat(casacore::String value)
Constructor that parses a float from the given String.
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
double asDouble()
Invalid operations.
Definition: TBData.h:177
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:941
casacore::String getType()
Returns the date type.
Definition: TBData.h:954
TBArrayDataChar()
Default constructor.
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:733
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:416
static const casacore::String TYPE_STRING
casacore::Table data types.
Definition: TBConstants.h:244
casacore::String getType()
Returns the casacore::String array type.
Definition: TBData.h:1136
Implementation of TBArrayData for character array data.
Definition: TBData.h:1522
bool isEmpty()
Returns true if the array is empty (i.e., all dimensions have size 0), false otherwise.
unsigned int asUInt()
Returns the value in unsigned int form.
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
static const casacore::String TYPE_DOUBLE
Definition: TBConstants.h:245
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
void setValue(TBData &value)
Iff the given TBData is a casacore::Record, sets the casacore::Record value.
float asFloat()
Returns the value in float form.
bool release()
Releases the loaded data, if any.
casacore::String asString()
Returns the casacore::String representation of this array.
casacore::String asString()
Returns the casacore::String representation of this array.
unsigned int asUInt()
asUInt() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:731
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
virtual casacore::String asString()=0
asString() must be implemented by any subclass.
bool equals(TBData *data)
Returns true if the given data is a double type and their values are equal, false otherwise...
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:485
bool equals(TBData *data)
Returns true if the given data is a date type and their values are equal, false otherwise.
int asInt()
Returns the value in int form.
double asDouble()
Returns the value in double form.
casacore::String to1DString()
See TBArrayData::to1DString().
std::pair< float, float > asComplex()
Returns the value.
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:795
casacore::Array< casacore::uInt > & data()
Returns the value.
Definition: TBData.h:1400
Implementation of TBArrayData for unsigned int array data.
Definition: TBData.h:1380
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:796
bool contains(TBData *data)
See TBArrayData::contains().
casacore::String asString()
Returns the casacore::String value.
casacore::String asString()
Returns the value in casacore::String form.
bool equals(TBData *data)
Returns true if the given data is a boolean type and their values are equal, false otherwise...
casacore::String asString()
Returns the value in casacore::String form.
virtual ~TBDataUInt()
virtual bool equals(TBData *data)=0
equals() must be implemented by any subclass.
virtual ~TBDataRecord()
TBData * firstItem()
Returns the first item in the array, or NULL if there is no data loaded.
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:357
float asFloat()
asFloat() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:788
TBDataComplex(casacore::String value)
Constructor that parses a complex from the given String.
TBArrayDataDouble()
Default constructor.
bool release()
Releases the loaded data, if any.
virtual casacore::String asString()=0
asString() must be implemented by any subclass.
bool release()
Releases the loaded data, if any.
char asChar()
asChar() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:296
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:736
Implementation of TBData for boolean data.
Definition: TBData.h:445
casacore::Array< casacore::Bool > value
Value.
Definition: TBData.h:1514
unsigned int asUInt()
asUInt() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:353
casacore::String getType()
Returns the table type.
Definition: TBData.h:840
Implementation of TBData for casacore::Record data.
Definition: TBData.h:848
TBData()
Default Constructor.
void setValue(TBData &value)
If the given TBData is a casacore::String, parses a float from the String.
TBDataDate(casacore::String value, int decimals=TBConstants::DEFAULT_DATE_DECIMALS)
Constructor that parses a date from the given casacore::String and then stores the human-readable val...
static const casacore::String TYPE_ARRAY_UINT
Definition: TBConstants.h:263
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:241
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:944
TBArrayDataComplex()
Default constructor.
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
int asInt()
asInt() must be implemented by any subclass, although the returned value does not have to be valid fo...
Definition: TBData.h:937
bool release()
Releases the loaded data, if any.
casacore::String getType()
Returns the boolean type.
Definition: TBData.h:494
unsigned int asUInt()
asUInt() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:874
virtual short int asShort()=0
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
casacore::Array< casacore::Double > & data()
Returns the value.
Definition: TBData.h:1187
unsigned char asUChar()
Returns the value.
casacore::Array< casacore::Complex > value
Value.
Definition: TBData.h:1798
unsigned int asUInt()
Returns the value in unsigned int form.
bool equals(TBData *data)
Returns true if the given data is a short type and their values are equal, false otherwise.
virtual ~TBData()
unsigned int asUInt()
asUInt() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:1040
Implementation of TBArrayData for boolean array data.
Definition: TBData.h:1451
casacore::String to1DString()
See TBArrayData::to1DString().
casacore::String to1DString()
See TBArrayData::to1DString().
bool release()
Releases the loaded data, if any.
bool coordIsValid(std::vector< int > d)
Returns true if the given coordinate is a valid index for this array given its shape, false otherwise.
void load(const casacore::Array< casacore::Short > &value)
Loads the given data into the array.
casacore::String getType()
Returns the character array type.
Definition: TBData.h:1562
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
bool contains(TBData *data)
See TBArrayData::contains().
TBDataUInt(casacore::String value)
Constructor that parses an unsigned int from the given String.
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:301
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
char asChar()
Returns the value.
virtual std::pair< double, double > asDComplex()=0
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
virtual void setValue(TBData &value)=0
setValue() must be implemented by any subclass.
casacore::String getType()
Returns the double complex type.
Definition: TBData.h:806
casacore::String value
Value.
Definition: TBData.h:203
int value
Value.
Definition: TBData.h:377
virtual ~TBDataFloat()
TBDataBool(casacore::String value)
Constructor that parses a boolean from the given String.
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:545
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:185
TBDataDComplex(casacore::String value)
Constructor that parses a double complex from the given String.
bool equals(TBData *data)
Returns true if the given data is a complex type and their values are equal, false otherwise...
casacore::String getType()
Returns the short array type.
Definition: TBData.h:1704
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
String: the storage and methods of handling collections of characters.
Definition: String.h:223
float asFloat()
Returns the value in float form.
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:1041
TBDataTable(TBData &data)
Constructor that calls setValue().
Definition: TBData.h:835
casacore::String getType()
Returns the unsigned int array type.
Definition: TBData.h:1420
TBDataString(casacore::String value)
Constructor that takes the casacore::String data.
std::pair< float, float > asComplex()
asComplex() must be implemented by any subclass, although the returned value does not have to be vali...
Definition: TBData.h:879
TBArrayDataUChar()
Default constructor.
TBDataRecord(const casacore::RecordInterface &value)
Constructor that takes the casacore::Record data.
void setDataAt(std::vector< int > d, TBData &value)
If the array is loaded, sets the value at the given coordinates (if valid) to the given data...
void load(const casacore::Array< casacore::Bool > &value)
Loads the given data into the array.
static const casacore::String TYPE_ARRAY_DOUBLE
Definition: TBConstants.h:260
casacore::String getType()
Returns the casacore::Record type.
Definition: TBData.h:888
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
virtual bool contains(TBData *data)=0
contains() must be implemented by any subclass.
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
double asDouble()
Invalid operations.
Definition: TBData.h:601
Implementation of TBArrayData for float array data.
Definition: TBData.h:1238
casacore::String getType()
Returns the boolean array type.
Definition: TBData.h:1491
float asFloat()
Invalid operations.
Definition: TBData.h:411
casacore::String asString()
Returns the casacore::String representation of this array.
float asFloat()
asFloat() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:602
casacore::Record value
Value.
Definition: TBData.h:896
void setValue(TBData &value)
If the given TBData is a casacore::String, parses a double from the String.
casacore::Array< casacore::String > & data()
Returns the value.
Definition: TBData.h:1116
double value
Value.
Definition: TBData.h:962
int asInt()
Returns the value.
casacore::String getType()
Returns the complex type.
Definition: TBData.h:745
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
Abstract base class for Record classes.
casacore::Array< casacore::Char > & data()
Returns the value.
Definition: TBData.h:1542
casacore::String asString()
Returns the casacore::String representation of this array.
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:735
casacore::String asString()
Returns the casacore::String representation of this array.
virtual ~TBDataString()
double asDouble()
Invalid operations.
Definition: TBData.h:787
float asFloat()
Invalid operations.
Definition: TBData.h:936
Implementation of TBData for casacore::Table data.
Definition: TBData.h:828
TBArrayDataUInt()
Default constructor.
bool contains(TBData *data)
See TBArrayData::contains().
double asDouble()
Returns the value in double form.
std::pair< double, double > value
Value.
Definition: TBData.h:814
short int value
Value.
Definition: TBData.h:691
int asInt()
asInt() must be implemented by any subclass, although the returned value does not have to be valid fo...
Definition: TBData.h:179
void load(const casacore::Array< casacore::Char > &value)
Loads the given data into the array.
double asDouble()
Returns the value in double form.
TBDataDouble(casacore::String value)
Constructor that parses a double from the given String.
void setValue(TBData &value)
setValue() must be implemented by any subclass.
Definition: TBData.h:1048
unsigned char asUChar()
asUChar() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:356
float asFloat()
asFloat() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:1038
Implementation of TBData for float data.
Definition: TBData.h:267
bool release()
Releases the loaded data, if any.
casacore::String asString()
Returns the casacore::String representation of this array.
double asDouble()
Returns the double value.
short int asShort()
asShort() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:732
bool containsGreaterThan(TBData *data)
See TBArrayData::containsGreaterThan().
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
Implementation of TBData for integer data.
Definition: TBData.h:326
static const casacore::String TYPE_TABLE
Definition: TBConstants.h:255
bool equals(TBData *data)
Returns true if the given data is a casacore::Record type and their values are equal, false otherwise.
static const casacore::String TYPE_UINT
Definition: TBConstants.h:248
casacore::Array< casacore::Int > & data()
Returns the value.
Definition: TBData.h:1329
float asFloat()
asFloat() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:729
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:360
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
bool containsLessThan(TBData *data)
See TBArrayData::containsLessThan().
char asChar()
Invalid operations.
Definition: TBData.h:480
casacore::String getType()
Returns the unsigned character array type.
Definition: TBData.h:1633
float asFloat()
asFloat() must be implemented by any subclass, although the returned value does not have to be valid ...
Definition: TBData.h:178
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:418
double asDouble()
Invalid operations.
Definition: TBData.h:539
casacore::String asString()
Returns the casacore::String representation of this array.
Implementation of TBData for unsigned character data.
Definition: TBData.h:572
int asInt()
asInt() must be implemented by any subclass, although the returned value does not have to be valid fo...
Definition: TBData.h:730
casacore::Array< casacore::Float > value
Value.
Definition: TBData.h:1301
bool asBool()
asBool() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:792
bool equals(TBData *data)
Returns true if the given data is a float type and their values are equal, false otherwise.
Holds a potentially multi-dimensional array.
Definition: TBArray.h:52
double asDouble()
Returns the value in double form.
casacore::Record * asRecord()
asRecord() must be implemented by any subclass, although the returned value does not have to be valid...
Definition: TBData.h:945
TBData * dataAt(std::vector< int > d)
See TBArrayData::dataAt().
std::pair< double, double > asDComplex()
asDComplex() must be implemented by any subclass, although the returned value does not have to be val...
Definition: TBData.h:880
static const casacore::String TYPE_DCOMPLEX
Definition: TBConstants.h:254
casacore::String getType()
Returns the double array type.
Definition: TBData.h:1207
unsigned int asUInt()
asUInt() must be implemented by any subclass, although the returned value does not have to be valid f...
Definition: TBData.h:180
casacore::String asString()
Returns the value in casacore::String form.
bool containsBetween(TBData *data, TBData *data2)
See TBArrayData::containsBetween().
casacore::Array< casacore::uChar > value
Value.
Definition: TBData.h:1656