Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/classcasa_1_1TableCache.html
Дата изменения: Unknown Дата индексирования: Mon Feb 14 21:38:24 2011 Кодировка: Поисковые слова: п п п п п п п п п п п п п п п п п п п |
Cache of open tables. More...
#include <TableCache.h>
Public Member Functions | |
TableCache () | |
Construct an empty cache of open tables. | |
~TableCache () | |
PlainTable * | operator() (const String &tableName) const |
Try to find a table with the given name in the cache. | |
PlainTable * | operator() (uInt index) const |
Try to find a table at the given index in the cache. | |
uInt | ntable () const |
Return the number of open tables in the cache. | |
void | define (const String &tableName, PlainTable *) |
Add an open table to the cache. | |
void | remove (const String &tableName) |
Remove an open table. | |
void | rename (const String &newName, const String &oldName) |
Rename an open table. | |
Private Attributes | |
SimpleOrderedMap< String, void * > | tableMap_p |
Cache of open tables.
Internal
TableCache represents a cache of open tables.
A TableCache object keeps track of the tables which have already been opened in a program. It maps the name of a table to its PlainTable object. In principle only one TableCache object (statically defined in class PlainTable) exists in a process. The cache is used to prevent a table from being opened more than once, which is not only a waste of space, but more importantly, may give rise to synchronization problems. Synchronization between the same table in multiple processes must be done by a locking mechanism.
TableCache is used by class Table and PlainTable. Before opening a table, Table will first look in the cache. Newly opened or created tables will be added to the cache. When a table is actually closed, it will be removed from the cache.
When a RefTable is read back, it will also read back the table it references. However, that table may have been opened before and it is bad to have a table open more than once in the same program. The TableCache class catches this and will not reopen the table.
Definition at line 90 of file TableCache.h.
casa::TableCache::TableCache | ( | ) |
Construct an empty cache of open tables.
casa::TableCache::~TableCache | ( | ) |
void casa::TableCache::define | ( | const String & | tableName, | |
PlainTable * | ||||
) |
Add an open table to the cache.
uInt casa::TableCache::ntable | ( | ) | const |
Return the number of open tables in the cache.
PlainTable* casa::TableCache::operator() | ( | uInt | index | ) | const |
Try to find a table at the given index in the cache.
Return a pointer to a table if found (thus if already open). Return a zero pointer if not found.
PlainTable* casa::TableCache::operator() | ( | const String & | tableName | ) | const |
Try to find a table with the given name in the cache.
Return a pointer to a table if found (thus if already open). Return a zero pointer if not found.
void casa::TableCache::remove | ( | const String & | tableName | ) |
Remove an open table.
Rename an open table.
If oldName is not in the cache, nothing will be done.
SimpleOrderedMap<String,void*> casa::TableCache::tableMap_p [private] |
Definition at line 126 of file TableCache.h.