#include <MemoryStore.h>
Multiple instances of this object represent multiple uses of the same table.
Definition at line 43 of file MemoryStore.h.
Public Member Functions | |
~MemoryTable () | |
int | get (const SerializableObject &key, SerializableObject *data) |
virtual from DurableTableInpl | |
int | get (const SerializableObject &key, SerializableObject **data, TypeCollection::Allocator_t allocator) |
virtual from DurableTableInpl | |
int | put (const SerializableObject &key, TypeCollection::TypeCode_t typecode, const SerializableObject *data, int flags) |
virtual from DurableTableInpl | |
int | del (const SerializableObject &key) |
virtual from DurableTableInpl | |
size_t | size () const |
virtual from DurableTableInpl | |
DurableIterator * | itr () |
virtual from DurableTableInpl | |
Private Types | |
typedef StringMap < Item * > | ItemMap |
Private Member Functions | |
MemoryTable (const char *logpath, ItemMap *items, const std::string &name, bool multitype) | |
Only MemoryStore can create MemoryTables. | |
Private Attributes | |
SpinLock | lock_ |
ItemMap * | items_ |
oasys::ScratchBuffer < u_char * > | scratch_ |
Friends | |
class | MemoryStore |
class | MemoryIterator |
Classes | |
struct | Item |
typedef StringMap<Item*> oasys::MemoryTable::ItemMap [private] |
Definition at line 79 of file MemoryStore.h.
oasys::MemoryTable::~MemoryTable | ( | ) |
Definition at line 137 of file MemoryStore.cc.
int oasys::MemoryTable::get | ( | const SerializableObject & | key, | |
SerializableObject * | data | |||
) | [virtual] |
virtual from DurableTableInpl
Implements oasys::DurableTableImpl.
Definition at line 142 of file MemoryStore.cc.
References oasys::StringSerialize::action(), oasys::ScratchBuffer< _memory_t, _static_size >::buf(), oasys::StringSerialize::buf(), oasys::Serialize::CONTEXT_LOCAL, oasys::StringBuffer::data(), oasys::MemoryTable::Item::data_, oasys::StringSerialize::DOT_SEPARATED, oasys::DS_ERR, oasys::DS_NOTFOUND, items_, oasys::ExpandableBuffer::len(), oasys::StringBuffer::length(), log_err, and oasys::DurableTableImpl::multitype_.
int oasys::MemoryTable::get | ( | const SerializableObject & | key, | |
SerializableObject ** | data, | |||
TypeCollection::Allocator_t | allocator | |||
) | [virtual] |
virtual from DurableTableInpl
Reimplemented from oasys::DurableTableImpl.
Definition at line 173 of file MemoryStore.cc.
References oasys::StringSerialize::action(), oasys::ScratchBuffer< _memory_t, _static_size >::buf(), oasys::StringSerialize::buf(), oasys::Serialize::CONTEXT_LOCAL, oasys::StringBuffer::data(), oasys::MemoryTable::Item::data_, oasys::StringSerialize::DOT_SEPARATED, oasys::DS_ERR, oasys::DS_NOTFOUND, oasys::DS_OK, items_, oasys::ExpandableBuffer::len(), oasys::StringBuffer::length(), log_err, oasys::DurableTableImpl::multitype_, and oasys::MemoryTable::Item::typecode_.
int oasys::MemoryTable::put | ( | const SerializableObject & | key, | |
TypeCollection::TypeCode_t | typecode, | |||
const SerializableObject * | data, | |||
int | flags | |||
) | [virtual] |
virtual from DurableTableInpl
Implements oasys::DurableTableImpl.
Definition at line 211 of file MemoryStore.cc.
References oasys::Marshal::action(), oasys::StringSerialize::action(), oasys::StringSerialize::buf(), oasys::Serialize::CONTEXT_LOCAL, oasys::StringBuffer::data(), oasys::MemoryTable::Item::data_, oasys::StringSerialize::DOT_SEPARATED, oasys::DS_CREATE, oasys::DS_ERR, oasys::DS_EXCL, oasys::DS_EXISTS, oasys::DS_NOTFOUND, oasys::DS_OK, items_, oasys::MemoryTable::Item::key_, oasys::StringBuffer::length(), log_debug, log_err, and oasys::MemoryTable::Item::typecode_.
int oasys::MemoryTable::del | ( | const SerializableObject & | key | ) | [virtual] |
virtual from DurableTableInpl
Implements oasys::DurableTableImpl.
Definition at line 271 of file MemoryStore.cc.
References oasys::StringSerialize::action(), oasys::StringSerialize::buf(), oasys::Serialize::CONTEXT_LOCAL, oasys::StringBuffer::data(), oasys::StringSerialize::DOT_SEPARATED, oasys::DS_NOTFOUND, oasys::DS_OK, items_, and oasys::StringBuffer::length().
size_t oasys::MemoryTable::size | ( | ) | const [virtual] |
virtual from DurableTableInpl
Implements oasys::DurableTableImpl.
Definition at line 294 of file MemoryStore.cc.
References items_.
DurableIterator * oasys::MemoryTable::itr | ( | ) | [virtual] |
virtual from DurableTableInpl
Implements oasys::DurableTableImpl.
Definition at line 300 of file MemoryStore.cc.
References oasys::Logger::logpath_, and MemoryIterator.
friend class MemoryStore [friend] |
Definition at line 44 of file MemoryStore.h.
friend class MemoryIterator [friend] |
SpinLock oasys::MemoryTable::lock_ [private] |
Definition at line 71 of file MemoryStore.h.
ItemMap* oasys::MemoryTable::items_ [private] |
Definition at line 80 of file MemoryStore.h.
Referenced by del(), get(), oasys::MemoryIterator::next(), put(), and size().
oasys::ScratchBuffer<u_char*> oasys::MemoryTable::scratch_ [private] |
Definition at line 82 of file MemoryStore.h.