/usr/include/casacore/tables/Tables/ScaColDesc.tcc is in casacore-dev 2.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | //# ScaColDesc.cc: Templated class for description of table scalar columns
//# Copyright (C) 1994,1995,1996,1997,1998,2001
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id$
#ifndef TABLES_SCACOLDESC_TCC
#define TABLES_SCACOLDESC_TCC
#include <casacore/tables/Tables/ScaColDesc.h>
#include <casacore/tables/Tables/ScaColData.h>
#include <casacore/tables/Tables/ConcatScalarColumn.h>
#include <casacore/casa/Utilities/ValTypeId.h>
#include <casacore/tables/Tables/TableError.h>
#include <casacore/casa/IO/AipsIO.h>
#include <casacore/casa/iostream.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
template<class T>
ScalarColumnDesc<T>::ScalarColumnDesc (const String& name,
int opt)
: BaseColumnDesc (name, "", "", "",
ValType::getType(&defaultVal_p),
valDataTypeId(&defaultVal_p),
opt, 0, IPosition(), True, False, False)
{
defaultVal_p = T();
}
template<class T>
ScalarColumnDesc<T>::ScalarColumnDesc (const String& name,
const String& comment,
int opt)
: BaseColumnDesc (name, comment, "", "",
ValType::getType(&defaultVal_p),
valDataTypeId(&defaultVal_p),
opt, 0, IPosition(), True, False, False)
{
defaultVal_p = T();
}
template<class T>
ScalarColumnDesc<T>::ScalarColumnDesc (const String& name,
const String& comment,
const String& dataManName,
const String& dataManGroup,
int opt)
: BaseColumnDesc (name, comment, dataManName, dataManGroup,
ValType::getType(&defaultVal_p),
valDataTypeId(&defaultVal_p),
opt, 0, IPosition(), True, False, False)
{
defaultVal_p = T();
}
template<class T>
ScalarColumnDesc<T>::ScalarColumnDesc (const String& name,
const String& comment,
const String& dataManName,
const String& dataManGroup,
const T& defaultVal,
int opt)
: BaseColumnDesc (name, comment, dataManName, dataManGroup,
ValType::getType(&defaultVal_p),
valDataTypeId(&defaultVal_p),
opt, 0, IPosition(), True, False, False),
defaultVal_p (defaultVal)
{}
template<class T>
ScalarColumnDesc<T>::ScalarColumnDesc (const ScalarColumnDesc<T>& that)
: BaseColumnDesc (that),
defaultVal_p (that.defaultVal_p)
{}
// Make a new object.
template<class T>
BaseColumnDesc* ScalarColumnDesc<T>::makeDesc (const String&)
{
return new ScalarColumnDesc<T>(String());
}
template<class T>
ScalarColumnDesc<T>::~ScalarColumnDesc()
{}
template<class T>
ScalarColumnDesc<T>& ScalarColumnDesc<T>::operator= (
const ScalarColumnDesc<T>& that)
{
BaseColumnDesc::operator= (that);
defaultVal_p = that.defaultVal_p;
return *this;
}
// Clone this column description to another.
template<class T>
BaseColumnDesc* ScalarColumnDesc<T>::clone() const
{
BaseColumnDesc* ptr = new ScalarColumnDesc<T>(*this);
return ptr;
}
// Return the class name.
template<class T>
String ScalarColumnDesc<T>::className() const
{ return "ScalarColumnDesc<" + dataTypeId(); }
//# Register the makeDesc function.
template<class T>
void ScalarColumnDesc<T>::registerClass() const
{
ColumnDesc::registerCtor (className(), makeDesc);
}
// Put the object.
// The data is read by the ctor taking AipsIO.
// It was felt that putstart takes too much space, so therefore
// the version is put "manually".
template<class T>
void ScalarColumnDesc<T>::putDesc (AipsIO& ios) const
{
ios << (uInt)1; // class version 1
ValType::put (ios, &defaultVal_p);
}
template<class T>
void ScalarColumnDesc<T>::getDesc (AipsIO& ios)
{
uInt version;
ios >> version;
ValType::get (ios, &defaultVal_p);
}
// Show the column.
template<class T>
void ScalarColumnDesc<T>::show (ostream& os) const
{
os << " Name=" << name();
os << " DataType=" << dataType();
if (dataType() == TpOther) {
os << ", " << dataTypeId();
}
if (maxLength() > 0) {
os << " MaxLength=" << maxLength();
}
os << endl;
os << " DataManager=" << dataManagerType();
os << "/" << dataManagerGroup();
os << " Default=";
ValType::put (os, &defaultVal_p);
os << endl;
os << " Comment = " << comment() << endl;
}
// Create a column object from the description.
template<class T>
PlainColumn* ScalarColumnDesc<T>::makeColumn (ColumnSet* csp) const
{
PlainColumn* bcp = new ScalarColumnData<T> (this, csp);
return bcp;
}
template<class T>
ConcatColumn* ScalarColumnDesc<T>::makeConcatColumn (ConcatTable* ct) const
{
return new ConcatScalarColumn<T> (this, ct);
}
} //# NAMESPACE CASACORE - END
#endif
|