casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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: 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 
28 #ifndef TABLES_DATAMANACCESSOR_H
29 #define TABLES_DATAMANACCESSOR_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
34 #include <iosfwd>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 // <summary>
39 // Base class for the Data Manager Accessor classes.
40 // </summary>
41 
42 // <use visibility=local>
43 
44 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
45 // </reviewed>
46 
47 // <prerequisite>
48 //# Classes you should understand before using this one.
49 // <li> <linkto class=DataManager>DataManager</linkto>
50 // </prerequisite>
51 
52 // <synopsis>
53 // The Table system has one or more data managers underneath.
54 // Once a table is constructed, these data managers are invisible
55 // and there is no way to get access to them.
56 // However, sometimes limited access to them is needed (e.g. to
57 // set the size of an internal cache).
58 // <p>
59 // This class should be used as the base class for specialized
60 // Data Manager Accessor classes (e.g. class
61 // <linkto class=ROIncrementalStManAccessor:description>
62 // ROIncrementalStManAccessor</linkto>.
63 // This base class provides the functionality to get the
64 // <src>DataManager</src> object for a given column.
65 // </synopsis>
66 
67 // <motivation>
68 // This base class makes it possible that every derived class can get the
69 // data manager, because RODataManAccessor is a friend of class Table.
70 // Otherwise all accessor classes needed to be friend of Table.
71 // </motivation>
72 
73 //# <todo asof="$DATE:$">
74 //# </todo>
75 
76 
78 {
79 public:
80  // Construct an empty object.
82  : itsDataManager(0)
83  {}
84 
85  // Construct the accessor object for a data manager in the table.
86  // An exception is thrown if the name of the data manager or column is
87  // unknown.
88  RODataManAccessor (const Table& table, const String& name,
89  Bool byColumn);
90 
91  virtual ~RODataManAccessor();
92 
93  // Set data manager properties using the fields in the record.
94  // Each data manager has its specific set of properties.
95  void setProperties (const Record&) const;
96 
97  // Get data manager properties as a record.
98  Record getProperties() const;
99 
100  // Get the data manager type.
102  { return itsDataManager->dataManagerType(); }
103 
104  // Get the data manager name.
106  { return itsDataManager->dataManagerName(); }
107 
108  // Get the data manager sequence nr.
110  { return itsDataManager->sequenceNr(); }
111 
112  // Show IO statistics.
113  void showCacheStatistics (ostream& os) const
115 
116 protected:
117  // Get the data manager for the given data manager or column name.
119  { return itsDataManager; }
120 
121 private:
123 };
124 
125 
126 } //# NAMESPACE CASACORE - END
127 
128 #endif
Record getProperties() const
Get data manager properties as a record.
Main interface class to a read/write table.
Definition: Table.h:153
DataManager * baseDataManager() const
Get the data manager for the given data manager or column name.
void setProperties(const Record &) const
Set data manager properties using the fields in the record.
String dataManagerType() const
Get the data manager type.
virtual String dataManagerName() const
Return the name of the data manager.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
virtual void showCacheStatistics(std::ostream &) const
Show the data manager&#39;s IO statistics.
String dataManagerName() const
Get the data manager name.
RODataManAccessor()
Construct an empty object.
void showCacheStatistics(ostream &os) const
Show IO statistics.
uInt dataManagerSeqNr() const
Get the data manager sequence nr.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
uInt sequenceNr() const
Get the (unique) sequence nr of this data manager.
Definition: DataManager.h:285
virtual String dataManagerType() const =0
Return the type name of the data manager (in fact its class name).
Base class for the Data Manager Accessor classes.
Abstract base class for a data manager.
Definition: DataManager.h:224
String: the storage and methods of handling collections of characters.
Definition: String.h:223
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42