#include <DurableStore.h>
Inheritance diagram for oasys::DurableStore:
Definition at line 1599 of file DurableStore.h.
Public Member Functions | |
DurableStore (const char *logpath) | |
~DurableStore () | |
int | create_store (const StorageConfig &config, bool *clean_shutdown=NULL) |
DurableStoreImpl * | impl () |
Return the implementation pointer. | |
template<typename _DataType> | |
int | get_table (SingleTypeDurableTable< _DataType > **table, std::string table_name, int flags, DurableObjectCache< _DataType > *cache=NULL) |
Get a new handle on a single-type table. | |
template<typename _BaseType, typename _Collection> | |
int | get_table (MultiTypeDurableTable< _BaseType, _Collection > **table, std::string table_name, int flags, DurableObjectCache< _BaseType > *cache=NULL) |
Get a new handle on a table. | |
int | get_table (StaticTypedDurableTable **table, std::string table_name, int flags, DurableObjectCache< SerializableObject > *cache=NULL) |
Get a new handle on a table. | |
int | del_table (std::string table_name) |
Delete the table (by id) from the datastore. | |
int | get_table_names (StringVector *table_names) |
Private Types | |
typedef DurableStoreImpl::PrototypeVector | PrototypeVector |
Typedef for the list of objects passed to the implementation to initialize the table. | |
Private Member Functions | |
DurableStore (const DurableStore &other) | |
The copy constructor should never be called. | |
Private Attributes | |
DurableStoreImpl * | impl_ |
the storage implementation | |
std::string | clean_shutdown_file_ |
path to the special shutdown file |
typedef DurableStoreImpl::PrototypeVector oasys::DurableStore::PrototypeVector [private] |
Typedef for the list of objects passed to the implementation to initialize the table.
Definition at line 1692 of file DurableStore.h.
oasys::DurableStore::DurableStore | ( | const char * | logpath | ) | [inline] |
Initialize the DurableStore object. Note that create_store() must be called before it can be used.
Definition at line 1605 of file DurableStore.h.
oasys::DurableStore::~DurableStore | ( | ) |
Shut down the durable store.
Definition at line 15 of file DurableStore.cc.
References clean_shutdown_file_, errno, fd, impl_, log_debug, and log_err.
oasys::DurableStore::DurableStore | ( | const DurableStore & | other | ) | [private] |
The copy constructor should never be called.
int oasys::DurableStore::create_store | ( | const StorageConfig & | config, | |
bool * | clean_shutdown = NULL | |||
) |
Creation function for creating the right kind of database backend implementation for a given StorageConfig.
Also initializes the store and returns whether or not the store was cleanly shut down in the previous run.
Definition at line 37 of file DurableStore.cc.
References ASSERT, clean_shutdown_file_, oasys::StorageConfig::dbdir_, oasys::DS_ERR, errno, impl_, oasys::DurableStoreImpl::init(), oasys::StorageConfig::init_, oasys::StorageConfig::leave_clean_file_, log_crit, log_err, log_info, oasys::Logger::logpath_, and oasys::StorageConfig::type_.
Referenced by dtn::DTNServer::init_datastore().
DurableStoreImpl* oasys::DurableStore::impl | ( | ) | [inline] |
int oasys::DurableStore::get_table | ( | SingleTypeDurableTable< _DataType > ** | table, | |
std::string | table_name, | |||
int | flags, | |||
DurableObjectCache< _DataType > * | cache = NULL | |||
) | [inline] |
Get a new handle on a single-type table.
table | Pointer to the table to be created | |
table_name | Name of the table | |
flags | Options for creating the table | |
cache | Optional cache for the table |
Definition at line 1722 of file DurableStore.h.
Referenced by dtn::GlobalStore::do_init().
int oasys::DurableStore::get_table | ( | MultiTypeDurableTable< _BaseType, _Collection > ** | table, | |
std::string | table_name, | |||
int | flags, | |||
DurableObjectCache< _BaseType > * | cache = NULL | |||
) | [inline] |
Get a new handle on a table.
table | Pointer to the table to be created | |
table_name | Name of the table | |
flags | Options for creating the table | |
cache | Optional cache for the table |
Definition at line 1756 of file DurableStore.h.
int oasys::DurableStore::get_table | ( | StaticTypedDurableTable ** | table, | |
std::string | table_name, | |||
int | flags, | |||
DurableObjectCache< SerializableObject > * | cache = NULL | |||
) |
Get a new handle on a table.
table | Pointer to the table to be created | |
flags | Options for creating the table | |
table_name | Name of the table | |
cache | Optional cache for the table |
Definition at line 115 of file DurableStore.cc.
References ASSERT, oasys::DurableStoreImpl::get_table(), and impl_.
int oasys::DurableStore::del_table | ( | std::string | table_name | ) | [inline] |
Delete the table (by id) from the datastore.
Delete the table (by name) from the datastore.
Definition at line 1828 of file DurableStore.h.
int oasys::DurableStore::get_table_names | ( | StringVector * | table_names | ) |
Retrieve a list of all of the tables in the database.
table_list | Vector will be filled with list of all of the table names. |
Definition at line 138 of file DurableStore.cc.
References oasys::DurableStoreImpl::get_table_names(), and impl_.
DurableStoreImpl* oasys::DurableStore::impl_ [private] |
the storage implementation
Definition at line 1697 of file DurableStore.h.
Referenced by create_store(), get_table(), get_table_names(), and ~DurableStore().
std::string oasys::DurableStore::clean_shutdown_file_ [private] |
path to the special shutdown file
Definition at line 1699 of file DurableStore.h.
Referenced by create_store(), and ~DurableStore().