casacore
Loading...
Searching...
No Matches
ImageAttrGroupCasa.h
Go to the documentation of this file.
1//# ImageAttrGroupCasa.h: Attribute group for a CASA image
2//# Copyright (C) 2012
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: casa-feedback@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#ifndef IMAGES_IMAGEATTRGROUPCASA_H
27#define IMAGES_IMAGEATTRGROUPCASA_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/images/Images/ImageAttrGroup.h>
32#include <casacore/tables/Tables/TableProxy.h>
33
34namespace casacore {
35
36// <summary>
37// Attribute group for a CASA image.
38// </summary>
39//
40// <use visibility=export>
41//
42// <reviewed reviewer="" date="" tests="tPagedmage.cc" demos="dPagedImage.cc">
43// </reviewed>
44//
45// <prerequisite>
46// <li> <linkto class=ImageAttrGroup>ImageAttrGroup</linkto>
47// </prerequisite>
48//
49// <synopsis>
50// This is the implementation of base class class ImageAttrGroup for an image
51// stored in the casacore table format.
52// See the base class for more information.
53// </synopsis>
54
56{
57public:
58 // The default constructor creates a null object.
61
62 // Construct the object for an attribute group in the image table.
63 // Note that the group name is the name of a subtable containing the info.
64 ImageAttrGroupCasa (const Table& image, const String& attrGroupName);
65
67
68 // Test if it is a null object.
69 Bool isNull() const
70 { return itsTable.table().isNull(); }
71
72 // Flush the attibrutes if needed.
73 void flush();
74
75 // Get the number of rows in the group.
76 virtual uInt nrows() const;
77
78 // Test if an attribute exists.
79 virtual Bool hasAttr (const String& attrName) const;
80
81 // Get all attribute names.
82 virtual Vector<String> attrNames() const;
83
84 // Get the datatype of a attribute.
85 // It returns TpOther if the attribute is not defined.
86 virtual DataType dataType (const String& attrName) const;
87
88 // Get the data of the given attribute.
89 virtual ValueHolder getData (const String& attrName, uInt rownr);
90
91 // Get the data of all attributes in a rows.
92 virtual Record getDataRow (uInt rownr);
93
94 // Get the possible units of the values.
95 // An empty vector is returned if the attribute has no units.
96 virtual Vector<String> getUnit (const String& attrName);
97
98 // Get the possible measure info as type and Ref.
99 // An empty vector is returned if the attribute has no MEASINFO.
100 virtual Vector<String> getMeasInfo (const String& attrName);
101
102 // Put the data of the given attribute.
103 // If the table does not contain data yet, it will be sized to the size
104 // of the vector. Otherwise the vector size has to match the table size.
105 // <br>If not empty, the units and MEASINFO will be put as column keywords.
106 // The MEASINFO vector must be given as type,Ref.
107 virtual void putData (const String& attrName, uInt rownr,
108 const ValueHolder& data,
109 const Vector<String>& units = Vector<String>(),
110 const Vector<String>& measInfo = Vector<String>());
111
112private:
113 // Check if the size matches the number of rows.
114 // Add rows if the table is still empty.
115 void checkRows (const String& attrName, uInt size);
116
117 // Add a new column for the given attribute for the data type in the value.
118 Bool addNewColumn (const String& attrName, const ValueHolder&);
119
120 //# Data members.
122};
123
124} //# NAMESPACE CASACORE - END
125
126#endif
virtual void putData(const String &attrName, uInt rownr, const ValueHolder &data, const Vector< String > &units=Vector< String >(), const Vector< String > &measInfo=Vector< String >())
Put the data of the given attribute.
virtual Vector< String > getUnit(const String &attrName)
Get the possible units of the values.
virtual DataType dataType(const String &attrName) const
Get the datatype of a attribute.
Bool addNewColumn(const String &attrName, const ValueHolder &)
Add a new column for the given attribute for the data type in the value.
Bool isNull() const
Test if it is a null object.
void flush()
Flush the attibrutes if needed.
ImageAttrGroupCasa()
The default constructor creates a null object.
virtual Vector< String > attrNames() const
Get all attribute names.
ImageAttrGroupCasa(const Table &image, const String &attrGroupName)
Construct the object for an attribute group in the image table.
virtual Bool hasAttr(const String &attrName) const
Test if an attribute exists.
virtual uInt nrows() const
Get the number of rows in the group.
void checkRows(const String &attrName, uInt size)
Check if the size matches the number of rows.
virtual Record getDataRow(uInt rownr)
Get the data of all attributes in a rows.
virtual ValueHolder getData(const String &attrName, uInt rownr)
Get the data of the given attribute.
virtual Vector< String > getMeasInfo(const String &attrName)
Get the possible measure info as type and Ref.
String: the storage and methods of handling collections of characters.
Definition String.h:223
Table & table()
Return the table object.
Definition TableProxy.h:590
Bool isNull() const
Test if the object is null, i.e.
Definition Table.h:480
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40