Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

c4_Strategy Class Reference

A strategy encapsulates code dealing with the I/O system interface. More...

#include <mk4.h>

Inheritance diagram for c4_Strategy:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual bool IsValid () const
 True if we can do I/O with this object.
virtual int DataRead (t4_i32, void *, int)
 Read a number of bytes.
virtual void DataWrite (t4_i32, const void *, int)
 Write a number of bytes, return true if successful.
virtual void DataCommit (t4_i32)
 Flush and truncate file.
virtual void ResetFileMapping ()
 Override to support memory-mapped files.
virtual t4_i32 FileSize ()
 Report total size of the datafile.
virtual t4_i32 FreshGeneration ()
 Return a value to use as fresh generation counter.
void SetBase (t4_i32)
 Define the base offset where data is stored.
t4_i32 EndOfData (t4_i32=-1)
 Scan datafile head/tail markers, return logical end of data.

Public Attributes

bool _bytesFlipped
 True if the storage format is not native (default is false).
int _failure
 Error code of last failed I/O operation, zero if I/O was ok.
const t4_byte * _mapStart
 First byte in file mapping, zero if not active.
t4_i32 _dataSize
 Number of bytes filled with active data.
t4_i32 _baseOffset
 All file positions are relative to this offset.
t4_i32 _rootPos
 The root position of the shallow tree walks.
t4_i32 _rootLen
 The size of the root column.

Detailed Description

A strategy encapsulates code dealing with the I/O system interface.


The documentation for this class was generated from the following files:

Metakit C++ API Reference - https://www.equi4.com/metakit.html - extracted with Doxygen