#include <DurableStore.h>
Inheritance diagram for oasys::DurableTableImpl:

Definition at line 226 of file DurableStore.h.
Public Member Functions | |
| DurableTableImpl (std::string table_name, bool multitype) | |
| virtual | ~DurableTableImpl () |
| virtual int | get (const SerializableObject &key, SerializableObject *data)=0 |
| Get the data for the given key from the datastore and unserialize into the given data object. | |
| virtual int | get (const SerializableObject &key, SerializableObject **data, TypeCollection::Allocator_t allocator) |
| For a multi-type table, get the data for the given key, calling the provided allocator function to create the object. | |
| virtual int | put (const SerializableObject &key, TypeCollection::TypeCode_t typecode, const SerializableObject *data, int flags)=0 |
| Put data for key in the database. | |
| virtual int | del (const SerializableObject &key)=0 |
| Delete a (key,data) pair from the database. | |
| virtual size_t | size () const=0 |
| Return the number of elements in the table. | |
| virtual DurableIterator * | itr ()=0 |
| Get an iterator to this table. | |
| const char * | name () |
| Return the name of this table. | |
Protected Member Functions | |
| size_t | flatten (const SerializableObject &key, u_char *key_buf, size_t size) |
| Helper method to flatten a serializable object into a buffer. | |
| template<size_t _size> | |
| size_t | flatten (const SerializableObject &key, ScratchBuffer< u_char *, _size > *scratch) |
Protected Attributes | |
| std::string | table_name_ |
| Name of the table. | |
| bool | multitype_ |
| Whether single or multi-type table. | |
| oasys::DurableTableImpl::DurableTableImpl | ( | std::string | table_name, | |
| bool | multitype | |||
| ) | [inline] |
Definition at line 228 of file DurableStore.h.
| virtual oasys::DurableTableImpl::~DurableTableImpl | ( | ) | [inline, virtual] |
Definition at line 231 of file DurableStore.h.
| virtual int oasys::DurableTableImpl::get | ( | const SerializableObject & | key, | |
| SerializableObject * | data | |||
| ) | [pure virtual] |
Get the data for the given key from the datastore and unserialize into the given data object.
| key | Key object | |
| data | Data object |
Implemented in oasys::BerkeleyDBTable, oasys::FileSystemTable, and oasys::MemoryTable.
| int DurableTableImpl::get | ( | const SerializableObject & | key, | |
| SerializableObject ** | data, | |||
| TypeCollection::Allocator_t | allocator | |||
| ) | [virtual] |
For a multi-type table, get the data for the given key, calling the provided allocator function to create the object.
Note that a default implementation (that panics) is provided such that subclasses need not support multi-type tables.
| key | Key object | |
| data | Data object | |
| allocator | Type allocator class |
Reimplemented in oasys::BerkeleyDBTable, oasys::FileSystemTable, and oasys::MemoryTable.
Definition at line 113 of file DurableStoreImpl.cc.
| virtual int oasys::DurableTableImpl::put | ( | const SerializableObject & | key, | |
| TypeCollection::TypeCode_t | typecode, | |||
| const SerializableObject * | data, | |||
| int | flags | |||
| ) | [pure virtual] |
Put data for key in the database.
| key | Key object | |
| typecode | Typecode (if multitype) | |
| data | Data object | |
| flags | Bit vector of DurableStoreFlags_t values. |
Implemented in oasys::BerkeleyDBTable, oasys::FileSystemTable, and oasys::MemoryTable.
| virtual int oasys::DurableTableImpl::del | ( | const SerializableObject & | key | ) | [pure virtual] |
Delete a (key,data) pair from the database.
Implemented in oasys::BerkeleyDBTable, oasys::FileSystemTable, and oasys::MemoryTable.
| virtual size_t oasys::DurableTableImpl::size | ( | ) | const [pure virtual] |
Return the number of elements in the table.
Implemented in oasys::BerkeleyDBTable, oasys::FileSystemTable, and oasys::MemoryTable.
| virtual DurableIterator* oasys::DurableTableImpl::itr | ( | ) | [pure virtual] |
Get an iterator to this table.
Implemented in oasys::BerkeleyDBTable, oasys::FileSystemTable, and oasys::MemoryTable.
| const char* oasys::DurableTableImpl::name | ( | ) | [inline] |
Return the name of this table.
Definition at line 295 of file DurableStore.h.
Referenced by oasys::BerkeleyDBTable::~BerkeleyDBTable().
| size_t DurableTableImpl::flatten | ( | const SerializableObject & | key, | |
| u_char * | key_buf, | |||
| size_t | size | |||
| ) | [protected] |
Helper method to flatten a serializable object into a buffer.
Definition at line 125 of file DurableStoreImpl.cc.
References oasys::Marshal::action(), oasys::MarshalSize::action(), and oasys::MarshalSize::size().
Referenced by oasys::BerkeleyDBTable::del(), oasys::BerkeleyDBTable::get(), and oasys::BerkeleyDBTable::put().
| size_t DurableTableImpl::flatten | ( | const SerializableObject & | key, | |
| ScratchBuffer< u_char *, _size > * | scratch | |||
| ) | [protected] |
Definition at line 316 of file DurableStore.h.
std::string oasys::DurableTableImpl::table_name_ [protected] |
bool oasys::DurableTableImpl::multitype_ [protected] |
Whether single or multi-type table.
Definition at line 309 of file DurableStore.h.
Referenced by oasys::MemoryTable::get(), oasys::FileSystemTable::get(), oasys::BerkeleyDBTable::get(), oasys::FileSystemTable::put(), and oasys::BerkeleyDBTable::put().
1.5.1