casacore
Loading...
Searching...
No Matches
DataManAccessor.h
Go to the documentation of this file.
1// # DataManAccessor.h: Base class for the Data Manager Accessor classes
2// # Copyright (C) 1996,1999
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 TABLES_DATAMANACCESSOR_H
27#define TABLES_DATAMANACCESSOR_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/DataMan/DataManager.h>
32#include <iosfwd>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Base class for the Data Manager Accessor classes.
38// </summary>
39
40// <use visibility=local>
41
42// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
43// </reviewed>
44
45// <prerequisite>
46// # Classes you should understand before using this one.
47// <li> <linkto class=DataManager>DataManager</linkto>
48// </prerequisite>
49
50// <synopsis>
51// The Table system has one or more data managers underneath.
52// Once a table is constructed, these data managers are invisible
53// and there is no way to get access to them.
54// However, sometimes limited access to them is needed (e.g. to
55// set the size of an internal cache).
56// <p>
57// This class should be used as the base class for specialized
58// Data Manager Accessor classes (e.g. class
59// <linkto class=ROIncrementalStManAccessor:description>
60// ROIncrementalStManAccessor</linkto>.
61// This base class provides the functionality to get the
62// <src>DataManager</src> object for a given column.
63// </synopsis>
64
65// <motivation>
66// This base class makes it possible that every derived class can get the
67// data manager, because RODataManAccessor is a friend of class Table.
68// Otherwise all accessor classes needed to be friend of Table.
69// </motivation>
70
71// # <todo asof="$DATE:$">
72// # </todo>
73
75 public:
76 // Construct an empty object.
78
79 // Construct the accessor object for a data manager in the table.
80 // An exception is thrown if the name of the data manager or column is
81 // unknown.
82 RODataManAccessor(const Table& table, const String& name, Bool byColumn);
83
85
86 // Set data manager properties using the fields in the record.
87 // Each data manager has its specific set of properties.
88 void setProperties(const Record&) const;
89
90 // Get data manager properties as a record.
92
93 // Get the data manager type.
94 String dataManagerType() const { return itsDataManager->dataManagerType(); }
95
96 // Get the data manager name.
97 String dataManagerName() const { return itsDataManager->dataManagerName(); }
98
99 // Get the data manager sequence nr.
100 uInt dataManagerSeqNr() const { return itsDataManager->sequenceNr(); }
101
102 // Show IO statistics.
103 void showCacheStatistics(std::ostream& os) const { itsDataManager->showCacheStatistics(os); }
104
105 protected:
106 // Get the data manager for the given data manager or column name.
108
109 private:
111};
112
113} // namespace casacore
114
115#endif
Abstract base class for a data manager.
void showCacheStatistics(std::ostream &os) const
Show IO statistics.
void setProperties(const Record &) const
Set data manager properties using the fields in the record.
RODataManAccessor(const Table &table, const String &name, Bool byColumn)
Construct the accessor object for a data manager in the table.
uInt dataManagerSeqNr() const
Get the data manager sequence nr.
String dataManagerType() const
Get the data manager type.
RODataManAccessor()
Construct an empty object.
Record getProperties() const
Get data manager properties as a record.
DataManager * baseDataManager() const
Get the data manager for the given data manager or column name.
String dataManagerName() const
Get the data manager name.
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
String name() const
Return the name of the field.
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40