ZTS Class Reference
[Tuplestore]

List of all members.

Public Member Functions

virtual void AllocateIDs (size_t iCount, uint64 &oBaseID, size_t &oCountIssued)=0
virtual void SetTuples (size_t iCount, const uint64 *iIDs, const ZTuple *iTuples)=0
virtual void GetTuples (size_t iCount, const uint64 *iIDs, ZTuple *oTuples)=0
virtual void Search (const ZTBSpec &iSpec, const std::set< uint64 > &iSkipIDs, std::set< uint64 > &oIDs)=0
virtual void Flush ()
virtual ZMutexBase & GetReadLock ()=0
virtual ZMutexBase & GetWriteLock ()=0
ZTuple GetTuple (uint64 iID)

Detailed Description

ZTS defines an API for managing the huge, fixed-size, sparse array of tuples discussed in Tuplestore. ZTS::SetTuples and ZTS::GetTuples provide access to the tuples themselves. ZTS::AllocateIDs manages the issuance of entries that have never been used before. ZTS::Search allows the identification of entries whose tuples match a ZTBSpec. ZTS::GetReadLock and ZTS::GetWriteLock provide access to the reader/writer lock which arbitrates access to the tuples.


Member Function Documentation

void ZTS::AllocateIDs ( size_t  iCount,
uint64 oBaseID,
size_t &  oCountIssued 
) [pure virtual]

Allocate some number of IDs that have never been allocated before, nor ever will again.

Parameters:
iCount The count of IDs we'd like to be issued
oBaseID The first ID issued
oCountIssued The count of IDs consecutive to oBaseID that were issused. This will be <= iCount, and may even be zero. If insufficient IDs have been issued, call AllocateIDs again.

void ZTS::SetTuples ( size_t  iCount,
const uint64 iIDs,
const ZTuple iTuples 
) [pure virtual]

Store the tuples in iTuples at the corresponding IDs in iIDs. The arrays referenced by iIDs and iTuples must each contain at least iCount values.

The ZMutexBase returned by ZTS::GetWriteLock must have been acquired by the current thread.

void ZTS::GetTuples ( size_t  iCount,
const uint64 iIDs,
ZTuple oTuples 
) [pure virtual]

Take the tuples at the IDs in iIDs and copy them to the corresponding indices in oTuples. The arrays referenced by iIDs and iTuples must each contain at least iCount values.

The ZMutexBase returned by ZTS::GetReadLock must have been acquired by the current thread.

void ZTS::Search ( const ZTBSpec iSpec,
const std::set< uint64 > &  iSkipIDs,
std::set< uint64 > &  oIDs 
) [pure virtual]

For each entry in the tuplestore whose tuple satisfies iSpec, insert the ID into oIDs (which must be empty), but do not insert any ID which occurs in iSkipIDs.

The ZMutexBase returned by ZTS::GetReadLock must have been acquired by the current thread.

void ZTS::Flush (  )  [virtual]

Ensure that any data is pushed out to stable storage.

ZMutexBase & ZTS::GetReadLock (  )  [pure virtual]

Return a ZMutexBase reference to the reader portion of a reader/writer lock.

ZMutexBase & ZTS::GetWriteLock (  )  [pure virtual]

Return a ZMutexBase reference to the writer portion of a reader/writer lock.

ZTuple ZTS::GetTuple ( uint64  iID  ) 

This is simply a helper function that returns the tuple stored at ID iID by calling ZTS::GetTuples. As such the ZMutexBase returned by ZTS::GetReadLock must have been acquired by the current thread.


The documentation for this class was generated from the following files:
Generated on Thu Jul 26 11:22:09 2007 for ZooLib by  doxygen 1.4.7