OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Table.cpp
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2// $RCSfile: Table.cpp,v $
3// ------------------------------------------------------------------------
4// $Revision: 1.2.4.1 $
5// ------------------------------------------------------------------------
6// Copyright: see Copyright.readme
7// ------------------------------------------------------------------------
8//
9// Class: Table
10// This abstract base class defines the interface for the OPAL "TABLE"
11// command family.
12//
13// ------------------------------------------------------------------------
14//
15// $Date: 2002/12/09 15:06:07 $
16// $Author: jsberg $
17//
18// ------------------------------------------------------------------------
19
21#include <iostream>
24#include "Utilities/Timer.h"
25
26// Class Table
27// ------------------------------------------------------------------------
28
30 // Remove pointer to "this" from table directory.
32}
33
34bool Table::canReplaceBy(Object* /*newObject*/) { return false; }
35
36Table* Table::find(const std::string& name) {
37 Table* table = dynamic_cast<Table*>(OpalData::getInstance()->find(name));
38 if (table == 0) {
39 throw OpalException("Table::find()", "Table \"" + name + "\" not found.");
40 }
41 return table;
42}
43
44const std::string Table::getCategory() const { return "TABLE"; }
45
46bool Table::shouldTrace() const { return true; }
47
48bool Table::shouldUpdate() const { return true; }
49
51 if (dynamic) refill = true;
52}
53
54Table::Table(int size, const char* name, const char* help)
55 : Object(size, name, help), dynamic(false), refill(false) {
56 // Do not link table exemplar.
57}
58
59Table::Table(const std::string& name, Table* parent)
60 : Object(name, parent), dynamic(true), refill(true) {
61 // Link table to table directory.
63}
The base class for all OPAL objects.
Definition Object.h:45
bool builtin
Built-in flag.
Definition Object.h:226
Object * find(const std::string &name)
Find entry.
Definition OpalData.cpp:477
void unregisterTable(Table *t)
Unregister table.
Definition OpalData.cpp:546
static OpalData * getInstance()
Definition OpalData.cpp:193
void registerTable(Table *t)
Register table.
Definition OpalData.cpp:544
The base class for all OPAL tables.
Definition Table.h:41
virtual void invalidate()
Mark this table as invalid, if it is dynamic.
Definition Table.cpp:50
virtual bool shouldUpdate() const
Update flag.
Definition Table.cpp:48
virtual const std::string getCategory() const
Return the object category as a string.
Definition Table.cpp:44
virtual bool canReplaceBy(Object *newObject)
Test if object can be replaced.
Definition Table.cpp:34
virtual ~Table()
Definition Table.cpp:29
bool refill
Refill flag.
Definition Table.h:148
static Table * find(const std::string &name)
Find named Table.
Definition Table.cpp:36
virtual bool shouldTrace() const
Trace flag.
Definition Table.cpp:46
bool dynamic
Flag dynamic table.
Definition Table.h:143