#include <DurableStoreImpl.h>
Definition at line 121 of file DurableStoreImpl.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. |
DurableTableImpl::DurableTableImpl | ( | std::string | table_name, | |
bool | multitype | |||
) | [inline] |
Definition at line 123 of file DurableStoreImpl.h.
virtual DurableTableImpl::~DurableTableImpl | ( | ) | [inline, virtual] |
Definition at line 126 of file DurableStoreImpl.h.
virtual int 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 |
virtual 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 |
virtual int 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. |
virtual int DurableTableImpl::del | ( | const SerializableObject & | key | ) | [pure virtual] |
Delete a (key,data) pair from the database.
virtual size_t DurableTableImpl::size | ( | ) | const [pure virtual] |
Return the number of elements in the table.
virtual DurableIterator* DurableTableImpl::itr | ( | ) | [pure virtual] |
Get an iterator to this table.
Referenced by DurableTable< _BaseType >::itr().
const char* DurableTableImpl::name | ( | ) | [inline] |
Return the name of this table.
Definition at line 190 of file DurableStoreImpl.h.
References table_name_.
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.
size_t DurableTableImpl::flatten | ( | const SerializableObject & | key, | |
ScratchBuffer< u_char *, _size > * | scratch | |||
) | [protected] |
Definition at line 211 of file DurableStoreImpl.h.
std::string DurableTableImpl::table_name_ [protected] |
bool DurableTableImpl::multitype_ [protected] |