WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zbl::ZblLogMapData Class Reference

The implicitly shared data object encapsulated by ZblLogMap objects. More...

#include <ZblLogMapData.h>

Inheritance diagram for Zbl::ZblLogMapData:
Inheritance graph
[legend]
Collaboration diagram for Zbl::ZblLogMapData:
Collaboration graph
[legend]

Classes

class  MarkNode
 A mark node is a compressed set of contiguous log record links. More...
 

Public Types

enum  MarkType { Invalid, Selection, Searchmap, Bookmark }
 Types of log maps: Invalid, Selection, Search, Bookmark. More...
 
enum  MarkRole { FirstID = 0, SeekPosition, MessageText }
 Roles for the log map's data model. More...
 
typedef QList< ZLogMap * > zLogMapList
 

Public Member Functions

 ZblLogMapData ()
 
 ZblLogMapData (MarkType markType)
 
 ZblLogMapData (int markType)
 
 ZblLogMapData (const ZblLogMapData &other)
 
 ~ZblLogMapData ()
 
MarkType getMapType () const
 returns this log map's mark type More...
 
bool insertMark (qint64 recordID, qint64 lastRecordID, qint64 seekPosition)
 Creates a new log mark in the database. More...
 
bool hasMark (qint64 recordID) const
 Determine if the log map contains a mark for the specified log record. More...
 
qint64 findNextMark (qint64 startID, bool forward) const
 Search forward or backward for the next mark from a specified starting position. More...
 
bool removeMark (qint64 recordID, qint64 lastRecordID)
 Removes the specified mark from the log map. More...
 
bool clear ()
 Removes all marks from the log map. More...
 
ZblLogLinkList getLogLinkList () const
 Obtain a ZblLogLinkList object containing expanded log links. More...
 

Static Public Member Functions

static bool isValidMapType (int mapType)
 Determine if a value is a valid logmap type. More...
 

Protected Member Functions

void mergeMarkNodes (QMap< qint64, MarkNode >::iterator it)
 
bool removeRange (QMap< qint64, MarkNode >::iterator it, qint64 recordID, qint64 lastRecordID)
 
bool decapitateRange (QMap< qint64, MarkNode >::iterator it, qint64 newStartID)
 
bool truncateRange (QMap< qint64, MarkNode >::iterator it, qint64 newEndID)
 
bool splitRange (QMap< qint64, MarkNode >::iterator it, qint64 endHeadID, qint64 startTailID)
 

Protected Attributes

ZBL_DECLARE_LOGGED_OBJECT QMap< qint64, MarkNodem_map
 A lookup table for mark nodes. It maps firstRecordID to MarkNode object. More...
 
MarkType m_markType
 The type of mark map: invalid, selection, bookmark, searchmark. More...
 

Detailed Description

The implicitly shared data object encapsulated by ZblLogMap objects.

This object contains the map of compressed log record links and the map type parameter.

ZblLogMap objects contain shared pointers to this object. ZLogMap objects contain ZblLogMap objects.

Definition at line 25 of file ZblLogMapData.h.

Member Typedef Documentation

◆ zLogMapList

Definition at line 58 of file ZblLogMapData.h.

Member Enumeration Documentation

◆ MarkRole

Roles for the log map's data model.

Enumerator
FirstID 
SeekPosition 
MessageText 

Definition at line 49 of file ZblLogMapData.h.

◆ MarkType

Types of log maps: Invalid, Selection, Search, Bookmark.

Enumerator
Invalid 
Selection 
Searchmap 
Bookmark 

Definition at line 35 of file ZblLogMapData.h.

Constructor & Destructor Documentation

◆ ZblLogMapData() [1/4]

Zbl::ZblLogMapData::ZblLogMapData ( )
inline

Definition at line 60 of file ZblLogMapData.h.

◆ ZblLogMapData() [2/4]

Zbl::ZblLogMapData::ZblLogMapData ( MarkType  markType)
inline

Definition at line 62 of file ZblLogMapData.h.

◆ ZblLogMapData() [3/4]

Zbl::ZblLogMapData::ZblLogMapData ( int  markType)
inline

Definition at line 64 of file ZblLogMapData.h.

◆ ZblLogMapData() [4/4]

Zbl::ZblLogMapData::ZblLogMapData ( const ZblLogMapData other)
inline

Definition at line 73 of file ZblLogMapData.h.

◆ ~ZblLogMapData()

Zbl::ZblLogMapData::~ZblLogMapData ( )
inline

Definition at line 76 of file ZblLogMapData.h.

Member Function Documentation

◆ clear()

bool Zbl::ZblLogMapData::clear ( )

Removes all marks from the log map.

Returns
true if marks were removed from logmap, false if logmap was already empty

Definition at line 155 of file ZblLogMapData.cpp.

Referenced by ~ZblLogMapData().

◆ decapitateRange()

bool Zbl::ZblLogMapData::decapitateRange ( QMap< qint64, MarkNode >::iterator  it,
qint64  newStartID 
)
protected

Definition at line 389 of file ZblLogMapData.cpp.

Referenced by removeMark(), and removeRange().

◆ findNextMark()

qint64 Zbl::ZblLogMapData::findNextMark ( qint64  startID,
bool  forward 
) const

Search forward or backward for the next mark from a specified starting position.

The search begins with the record after the specified starting ID.

Parameters
startIDThe log record ID from which to start the search. Zero starts from the beginning of map, -1 starts from the end of map.
forwardtrue = search forward, false = search backward
Returns
The next ID following the specified ID in the specified direction, or -1 if no ID was found

Definition at line 212 of file ZblLogMapData.cpp.

Referenced by ~ZblLogMapData().

◆ getLogLinkList()

ZblLogLinkList Zbl::ZblLogMapData::getLogLinkList ( ) const

Obtain a ZblLogLinkList object containing expanded log links.

Returns

Definition at line 447 of file ZblLogMapData.cpp.

Referenced by ~ZblLogMapData().

◆ getMapType()

ZblLogMapData::MarkType Zbl::ZblLogMapData::getMapType ( ) const

returns this log map's mark type

Returns

Definition at line 468 of file ZblLogMapData.cpp.

Referenced by ~ZblLogMapData().

◆ hasMark()

bool Zbl::ZblLogMapData::hasMark ( qint64  recordID) const

Determine if the log map contains a mark for the specified log record.

Parameters
recordIDThe log record ID to test
Returns
true if a mark exists for the specified log record ID, false otherwise

Definition at line 193 of file ZblLogMapData.cpp.

Referenced by ~ZblLogMapData().

◆ insertMark()

bool Zbl::ZblLogMapData::insertMark ( qint64  recordID,
qint64  lastRecordID,
qint64  seekPosition 
)

Creates a new log mark in the database.

Parameters
recordIDthe starting log record number for the mark
lastRecordIDthe ending (inclusive) log record number for the mark
seekPositionthe seek position of the starting record, -1 if unknown
Returns
true if logmap was modified, false otherwise

Definition at line 25 of file ZblLogMapData.cpp.

Referenced by decapitateRange(), splitRange(), and ~ZblLogMapData().

◆ isValidMapType()

bool Zbl::ZblLogMapData::isValidMapType ( int  mapType)
static

Determine if a value is a valid logmap type.

Parameters
mapTypeAn integer value representing a logmap type.
Returns
true if mapType is a valid logmap type, false if invalid

Definition at line 8 of file ZblLogMapData.cpp.

Referenced by Zbl::ZblLogMap::isValidMapType(), ZblLogMapData(), and ~ZblLogMapData().

◆ mergeMarkNodes()

void Zbl::ZblLogMapData::mergeMarkNodes ( QMap< qint64, MarkNode >::iterator  it)
protected

Definition at line 167 of file ZblLogMapData.cpp.

Referenced by insertMark().

◆ removeMark()

bool Zbl::ZblLogMapData::removeMark ( qint64  recordID,
qint64  lastRecordID 
)

Removes the specified mark from the log map.

Parameters
recordIDthe starting log record number for the mark
lastRecordIDthe ending (inclusive) log record number for the mark
Returns
true if the mark was present and removed, false if the mark did not exist

Definition at line 253 of file ZblLogMapData.cpp.

Referenced by ~ZblLogMapData().

◆ removeRange()

bool Zbl::ZblLogMapData::removeRange ( QMap< qint64, MarkNode >::iterator  it,
qint64  recordID,
qint64  lastRecordID 
)
protected

Definition at line 363 of file ZblLogMapData.cpp.

Referenced by removeMark().

◆ splitRange()

bool Zbl::ZblLogMapData::splitRange ( QMap< qint64, MarkNode >::iterator  it,
qint64  endHeadID,
qint64  startTailID 
)
protected

Definition at line 422 of file ZblLogMapData.cpp.

Referenced by removeMark().

◆ truncateRange()

bool Zbl::ZblLogMapData::truncateRange ( QMap< qint64, MarkNode >::iterator  it,
qint64  newEndID 
)
protected

Definition at line 409 of file ZblLogMapData.cpp.

Referenced by removeMark(), and splitRange().

Member Data Documentation

◆ m_map

ZBL_DECLARE_LOGGED_OBJECT QMap<qint64, MarkNode> Zbl::ZblLogMapData::m_map
protected

A lookup table for mark nodes. It maps firstRecordID to MarkNode object.

Definition at line 267 of file ZblLogMapData.h.

Referenced by clear(), decapitateRange(), findNextMark(), getLogLinkList(), hasMark(), insertMark(), mergeMarkNodes(), removeMark(), and removeRange().

◆ m_markType

MarkType Zbl::ZblLogMapData::m_markType
protected

The type of mark map: invalid, selection, bookmark, searchmark.

Definition at line 273 of file ZblLogMapData.h.

Referenced by getMapType(), and ZblLogMapData().


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