casacore
Loading...
Searching...
No Matches
StandardStManAccessor.h
Go to the documentation of this file.
1//# StandardStManAccessor.h: Gives access to some StandardStMan functions
2//# Copyright (C) 2000,2001
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_STANDARDSTMANACCESSOR_H
27#define TABLES_STANDARDSTMANACCESSOR_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/DataMan/DataManAccessor.h>
32#include <casacore/casa/iosfwd.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36//# Forward Declarations
37class SSMBase;
38class DataManager;
39class Table;
40class String;
41
42// <summary>
43// Give access to some StandardStMan functions
44// </summary>
45
46// <use visibility=export>
47
48// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tStandardStMan">
49// </reviewed>
50
51// <prerequisite>
52//# Classes you should understand before using this one.
53// <li> <linkto class=StandardStMan>StandardStMan</linkto>
54// </prerequisite>
55
56// <synopsis>
57// The Table system has one or more storage managers underneath.
58// One of these possible storage managers is the
59// <linkto class=StandardStMan>StandardStMan</linkto>.
60// This storage manager uses a cache of buckets. The default
61// cache size is defined when the StandardStMan object was
62// constructed at the time the table was created.
63// <p>
64// Sometimes it can be useful to change the cache size. E.g. when
65// the table is accessed in a random way, the hit rate may drop
66// when the cache is too small. The class ROStandardStManAccessor makes
67// it possible to change the cache size in a temporary way.
68// <br>
69// It is also possible to get the cache size.
70// <p>
71// Furthermore it is possible to show some statistics (about the cache
72// and the internals of SSM classes).
73// </synopsis>
74
75// <motivation>
76// In principle a pointer to StandardStMan could be used.
77// However, that would give access to all public functions.
78// Furthermore it could not distinguish between read/write and readonly
79// tables.
80// </motivation>
81
82// <example>
83// This example shows how to set the cache size for
84// the standard storage manager with the name "SSMExample". The cache
85// size is not persistent, i.e. when the same table is reopened
86// at a later time, this cache size is not remembered.
87// <srcblock>
88// // Open a table.
89// Table table("someName.data");
90// // Set the cache size of its standard storage manager SSMExample
91// // to 5 buckets.
92// ROStandardStManAccessor accessor(table, "SSMExample");
93// accessor.setCacheSize (5);
94// </srcblock>
95// </example>
96
97//# <todo asof="$DATE:$">
98//# </todo>
99
100
102{
103public:
104
105 // Construct the object for a data manager in the table given the name
106 // of the data manager or the column.
107 // An exception is thrown if the data manager type is not the incremental
108 // storage manager.
109 ROStandardStManAccessor (const Table& table, const String& name,
110 Bool byColumn=False);
111
113
114 // Copy constructor (reference semantics).
116
117 // Assignment (reference semantics).
119 (const ROStandardStManAccessor& that);
120
121 // Set the cache size (in buckets) to be used by the
122 // storage manager.
123 // The cache size given in this way is not persistent.
124 // Only the cache size given to the constructors of the Standard
125 // storage managers, is persistent.
126 // If <src>canExceedNrBuckets=True</src>, the given cache size can be
127 // larger than the nr of buckets in the file. In this way the cache can
128 // be made large enough for a future file extension.
129 // Otherwise, it is limited to the actual number of buckets. This is useful
130 // if one wants the entire file to be cached.
131 void setCacheSize (uInt aSize, Bool canExceedNrBuckets=True);
132
133 // Get the cache size (in buckets).
135
136 // Clear the cache used by this storage manager.
137 // It will flush the cache as needed and remove all buckets from it
138 // resulting in a drop in memory used.
140
141 // Show the statistics for the base class.
142 void showBaseStatistics (ostream& anOs) const;
143
144 // Show the statistics for each index used by this storage manager.
145 void showIndexStatistics (ostream& anOs) const;
146
147
148private:
149 //# Declare the data members.
151};
152
153
154
155} //# NAMESPACE CASACORE - END
156
157#endif
ROStandardStManAccessor(const ROStandardStManAccessor &that)
Copy constructor (reference semantics).
void clearCache()
Clear the cache used by this storage manager.
void setCacheSize(uInt aSize, Bool canExceedNrBuckets=True)
Set the cache size (in buckets) to be used by the storage manager.
void showIndexStatistics(ostream &anOs) const
Show the statistics for each index used by this storage manager.
uInt getCacheSize() const
Get the cache size (in buckets).
ROStandardStManAccessor(const Table &table, const String &name, Bool byColumn=False)
Construct the object for a data manager in the table given the name of the data manager or the column...
void showBaseStatistics(ostream &anOs) const
Show the statistics for the base class.
String: the storage and methods of handling collections of characters.
Definition String.h:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41