oasys::DurableStoreImpl Class Reference

#include <DurableStore.h>

Inheritance diagram for oasys::DurableStoreImpl:

oasys::Logger oasys::BerkeleyDBStore oasys::FileSystemStore oasys::MemoryStore

List of all members.


Detailed Description

Storage implementation specific pieces of the data store.

Definition at line 111 of file DurableStore.h.


Public Types

typedef std::map
< std::string, int > 
RefCountMap
 Map used for ref counting tables.
typedef std::vector
< SerializableObject * > 
PrototypeVector
 Typedef for the list of objects passed to get_table.

Public Member Functions

 DurableStoreImpl (const char *classname, const char *logpath)
 Constructor (initializes the log path).
virtual ~DurableStoreImpl ()
 Destructor.
virtual int init (const StorageConfig &config)=0
virtual int get_table (DurableTableImpl **table, const std::string &db_name, int flags, PrototypeVector &prototypes)=0
 Hook to get or create the implementation-specific components of a durable table.
virtual int del_table (const std::string &db_name)=0
 Hook to remove a table (by name) from the data store.
virtual int get_table_names (StringVector *names)=0
 Hook to get all of the names of the tables in the store.
virtual std::string get_info () const =0
 
Returns:
Text description of database configuration.


Protected Member Functions

int check_db_dir (const char *db_dir, bool *dir_exists)
 Check for the db directory.
int create_db_dir (const char *db_dir)
 Create database directory.
void prune_db_dir (const char *db_dir, int tidy_wait)
 Remove the given directory, after waiting the specified amount of time.

Member Typedef Documentation

typedef std::map<std::string, int> oasys::DurableStoreImpl::RefCountMap

Map used for ref counting tables.

Definition at line 114 of file DurableStore.h.

typedef std::vector<SerializableObject*> oasys::DurableStoreImpl::PrototypeVector

Typedef for the list of objects passed to get_table.

Definition at line 119 of file DurableStore.h.


Constructor & Destructor Documentation

oasys::DurableStoreImpl::DurableStoreImpl ( const char *  classname,
const char *  logpath 
) [inline]

Constructor (initializes the log path).

Definition at line 124 of file DurableStore.h.

virtual oasys::DurableStoreImpl::~DurableStoreImpl (  )  [inline, virtual]

Destructor.

Definition at line 130 of file DurableStore.h.


Member Function Documentation

virtual int oasys::DurableStoreImpl::init ( const StorageConfig config  )  [pure virtual]

Real initialization function.

Implemented in oasys::BerkeleyDBStore, oasys::FileSystemStore, and oasys::MemoryStore.

Referenced by oasys::DurableStore::create_store().

virtual int oasys::DurableStoreImpl::get_table ( DurableTableImpl **  table,
const std::string &  db_name,
int  flags,
PrototypeVector prototypes 
) [pure virtual]

Hook to get or create the implementation-specific components of a durable table.

Referenced by oasys::DurableStore::get_table().

virtual int oasys::DurableStoreImpl::del_table ( const std::string &  db_name  )  [pure virtual]

Hook to remove a table (by name) from the data store.

Implemented in oasys::BerkeleyDBStore, oasys::FileSystemStore, and oasys::MemoryStore.

virtual int oasys::DurableStoreImpl::get_table_names ( StringVector names  )  [pure virtual]

Hook to get all of the names of the tables in the store.

Implemented in oasys::BerkeleyDBStore, oasys::FileSystemStore, and oasys::MemoryStore.

Referenced by oasys::DurableStore::get_table_names().

virtual std::string oasys::DurableStoreImpl::get_info (  )  const [pure virtual]

Returns:
Text description of database configuration.

Implemented in oasys::BerkeleyDBStore, oasys::FileSystemStore, and oasys::MemoryStore.

Referenced by oasys::DurableStore::get_info().

int DurableStoreImpl::check_db_dir ( const char *  db_dir,
bool dir_exists 
) [protected]

Check for the db directory.

Parameters:
db_dir Directory to check
dir_exists To be set if directory exists.

Definition at line 45 of file DurableStoreImpl.cc.

References oasys::DS_ERR, errno, and log_err.

Referenced by oasys::BerkeleyDBStore::init().

int DurableStoreImpl::create_db_dir ( const char *  db_dir  )  [protected]

Create database directory.

Definition at line 72 of file DurableStoreImpl.cc.

References oasys::DS_ERR, errno, log_crit, and log_notice.

Referenced by oasys::BerkeleyDBStore::init().

void DurableStoreImpl::prune_db_dir ( const char *  db_dir,
int  tidy_wait 
) [protected]

Remove the given directory, after waiting the specified amount of time.

Definition at line 31 of file DurableStoreImpl.cc.

References log_notice, and log_warn.

Referenced by oasys::BerkeleyDBStore::init().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:43:53 2007 for DTN Reference Implementation by  doxygen 1.5.3