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
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Friends | List of all members
Zbl::ZLogMap Class Reference

Maintains a list of log record links pertaining to a specific log file. More...

#include <ZLogMap.h>

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

Public Types

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

Public Slots

void insertMark (qint64 recordID, qint64 lastRecordID, qint64 seekPosition)
 Creates a new log mark in the database. More...
 
bool hasMark (qint64 recordID)
 Determine if the log map contains a mark for the specified log record. More...
 
qint64 findNextMark (qint64 startID, bool forward=true) 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...
 
void clear ()
 Removes all marks from the log map. More...
 

Signals

void selectionUpdated ()
 Sent whenever the ZLogMap state has been changed. More...
 

Public Member Functions

 ZLogMap (ZLogReader *reader)
 Constructor. More...
 
MarkType getMapType ()
 returns this log map's mark type More...
 
Q_INVOKABLE QObject * getReader () const
 Returns the foreground log file reader object for this log map. More...
 

Static Public Member Functions

static void registerType ()
 Registers ZLogMap as a QML type. More...
 

Protected Member Functions

ZLogReadergetZReader () const
 Returns the foreground log file reader object for this search. More...
 
virtual int logMapType ()
 Returns log map type. Subclasses override this to return their map type. More...
 

Protected Attributes

ZBL_DECLARE_LOGGED_OBJECT ZblLogMap m_map
 Create the m_tag object that presents a Javascript interface to constant integer values. More...
 
ZLogReaderm_reader
 The log file reader that created this search object. More...
 

Properties

int mapType
 

Friends

class ZLogReclinkModel
 

Detailed Description

Maintains a list of log record links pertaining to a specific log file.

The list is used to provide row selection, search results and user-defined persistent bookmarks. Each entry in the list identifies a contiguous range of log file records.

Log maps originate from a variety of sources including: ZLogViewport user interaction (selection or creating a bookmark), loaded from saved bookmark files, and generated by ZblLogBkSearch to represent search results.

Definition at line 28 of file ZLogMap.h.

Member Typedef Documentation

◆ zLogMapList

Definition at line 64 of file ZLogMap.h.

Member Enumeration Documentation

◆ MarkRole

Roles for the log map's data model.

Enumerator
FirstID 
SeekPosition 
MessageText 

Definition at line 56 of file ZLogMap.h.

◆ MarkType

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

Enumerator
Invalid 
Selection 
Searchmap 
Bookmark 

Definition at line 42 of file ZLogMap.h.

Constructor & Destructor Documentation

◆ ZLogMap()

Zbl::ZLogMap::ZLogMap ( ZLogReader reader)
explicit

Constructor.

Parameters
readerThe ZLogReader object that created this object.

Definition at line 14 of file ZLogMap.cpp.

Member Function Documentation

◆ clear

void Zbl::ZLogMap::clear ( )
slot

Removes all marks from the log map.

Definition at line 160 of file ZLogMap.cpp.

Referenced by Zbl::ZblLogSearch::addSearchRole(), Zbl::ZblLogSearch::addSearchRoles(), and Zbl::ZblLogSearch::clearSearchRoles().

◆ findNextMark

qint64 Zbl::ZLogMap::findNextMark ( qint64  startID,
bool  forward = true 
) const
slot

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 189 of file ZLogMap.cpp.

◆ getMapType()

ZLogMap::MarkType Zbl::ZLogMap::getMapType ( )

returns this log map's mark type

Returns

Definition at line 184 of file ZLogMap.cpp.

◆ getReader()

QObject * Zbl::ZLogMap::getReader ( ) const

Returns the foreground log file reader object for this log map.

Returns
A ZLogReader object

Definition at line 53 of file ZLogMap.cpp.

◆ getZReader()

ZLogReader * Zbl::ZLogMap::getZReader ( ) const
protected

Returns the foreground log file reader object for this search.

Returns
A ZLogReader object.

Definition at line 48 of file ZLogMap.cpp.

◆ hasMark

bool Zbl::ZLogMap::hasMark ( qint64  recordID)
slot

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 166 of file ZLogMap.cpp.

Referenced by Zbl::ZLogReader::getBookmarkNames(), Zbl::ZLogViewport::getRecordModelRow(), and Zbl::ZLogReader::getSearchmarkSet().

◆ insertMark

void Zbl::ZLogMap::insertMark ( qint64  recordID,
qint64  lastRecordID,
qint64  seekPosition 
)
slot

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

Definition at line 147 of file ZLogMap.cpp.

Referenced by Zbl::ZLogViewport::getRecordModelRow(), Zbl::ZblLogSearch::onSearchRowMatched(), and Zbl::ZblLogSearch::onSearchRowsMatched().

◆ logMapType()

int Zbl::ZLogMap::logMapType ( )
protectedvirtual

Returns log map type. Subclasses override this to return their map type.

Returns
the map type ZLogMap::Selection

Reimplemented in Zbl::ZblLogSearch, and Zbl::ZLogBookmark.

Definition at line 41 of file ZLogMap.cpp.

Referenced by getMapType().

◆ registerType()

void Zbl::ZLogMap::registerType ( )
static

Registers ZLogMap as a QML type.

Definition at line 32 of file ZLogMap.cpp.

Referenced by Zbl::Zblcore::registerTypes().

◆ removeMark

bool Zbl::ZLogMap::removeMark ( qint64  recordID,
qint64  lastRecordID 
)
slot

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 171 of file ZLogMap.cpp.

◆ selectionUpdated

void Zbl::ZLogMap::selectionUpdated ( )
signal

Sent whenever the ZLogMap state has been changed.

Referenced by clear(), insertMark(), Zbl::ZLogReader::newBookmark(), and removeMark().

Friends And Related Function Documentation

◆ ZLogReclinkModel

friend class ZLogReclinkModel
friend

Definition at line 30 of file ZLogMap.h.

Referenced by Zbl::ZblLogSearch::linkModel().

Member Data Documentation

◆ m_map

ZBL_DECLARE_LOGGED_OBJECT ZblLogMap Zbl::ZLogMap::m_map
protected

Create the m_tag object that presents a Javascript interface to constant integer values.

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

Definition at line 275 of file ZLogMap.h.

Referenced by clear(), findNextMark(), getReader(), hasMark(), insertMark(), Zbl::ZblLogSearch::populateLinkModel(), and removeMark().

◆ m_reader

ZLogReader* Zbl::ZLogMap::m_reader
protected

The log file reader that created this search object.

Definition at line 281 of file ZLogMap.h.

Referenced by getReader(), getZReader(), Zbl::ZblLogSearch::populateLinkModel(), and Zbl::ZblLogSearch::validateReader().

Property Documentation

◆ mapType

int Zbl::ZLogMap::mapType
read

Returns the log map type.

Definition at line 77 of file ZLogMap.h.


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