oasys::MemoryTable Class Reference

#include <MemoryStore.h>

Inheritance diagram for oasys::MemoryTable:

oasys::DurableTableImpl oasys::Logger List of all members.

Detailed Description

Object that encapsulates a single table.

Multiple instances of this object represent multiple uses of the same table.

Definition at line 64 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
DurableIteratoritr ()
 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_
ItemMapitems_
oasys::ScratchBuffer< u_char * > scratch_

Friends

class MemoryStore
class MemoryIterator

Classes

struct  Item


Member Typedef Documentation

typedef StringMap<Item*> oasys::MemoryTable::ItemMap [private]

Definition at line 100 of file MemoryStore.h.


Constructor & Destructor Documentation

oasys::MemoryTable::~MemoryTable (  ) 

Definition at line 149 of file MemoryStore.cc.

oasys::MemoryTable::MemoryTable ( const char *  logpath,
ItemMap items,
const std::string &  name,
bool  multitype 
) [private]

Only MemoryStore can create MemoryTables.

Definition at line 141 of file MemoryStore.cc.


Member Function Documentation

int oasys::MemoryTable::get ( const SerializableObject key,
SerializableObject data 
) [virtual]

virtual from DurableTableInpl

Implements oasys::DurableTableImpl.

Definition at line 154 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::Serialize::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 185 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::Serialize::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 223 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::Serialize::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 283 of file MemoryStore.cc.

References oasys::StringSerialize::action(), oasys::StringSerialize::buf(), oasys::Serialize::CONTEXT_LOCAL, oasys::StringBuffer::data(), oasys::Serialize::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 306 of file MemoryStore.cc.

References items_.

DurableIterator * oasys::MemoryTable::itr (  )  [virtual]

virtual from DurableTableInpl

Implements oasys::DurableTableImpl.

Definition at line 312 of file MemoryStore.cc.

References oasys::Logger::logpath_, and MemoryIterator.


Friends And Related Function Documentation

friend class MemoryStore [friend]

Definition at line 65 of file MemoryStore.h.

friend class MemoryIterator [friend]

Definition at line 66 of file MemoryStore.h.

Referenced by itr().


Member Data Documentation

SpinLock oasys::MemoryTable::lock_ [private]

Definition at line 92 of file MemoryStore.h.

ItemMap* oasys::MemoryTable::items_ [private]

Definition at line 101 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 103 of file MemoryStore.h.


The documentation for this class was generated from the following files:
Generated on Fri Dec 22 14:48:07 2006 for DTN Reference Implementation by  doxygen 1.5.1