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

A log viewport encapsulates a ZTableModel containing a contiguous subset of log records from a Zuble log file. More...

#include <ZLogViewport.h>

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

Public Slots

QObject * getModel ()
 Obtains the log viewport's data model which contains a contiguous subset of rows from the log file. More...
 
QObject * getSelection ()
 Obtains the selection log mark map for this viewport. Each viewport has its own selection. More...
 
QObject * getCurrentSearch ()
 Obtains a javascript wrapper for the current search object for this viewport. More...
 
bool setCurrentSearch (QObject *search)
 Sets this viewport's current search object. More...
 
QObject * getReader ()
 Obtains the ZLogReader object that is the parent of this ZLogViewport object. More...
 
qint64 getRecordSeekPos (qint64 recordID)
 Obtain the file seek position for the specified log record ID from model data in the viewport. More...
 
qint64 getRecordModelRow (qint64 recordID)
 Obtain the index position for the specified log record in the model. More...
 
QObject * getCurrentSearchlinks ()
 Obtain a data model containing the log record links for the current search. More...
 
QObject * getCurrentBookmarklinks ()
 Obtain a data model containing the log record links for the current bookmark. [TBD: does this even make sense?]. More...
 
bool markupText ()
 Marks up text in the viewport's data model asynchronously using the current search parameters. More...
 
bool markupText (QList< int > roles, QString searchPhrase, int type)
 Marks up text in the viewport's data model asynchronously using the specified search parameters. More...
 
void setLock (bool locked)
 Sets or clears the viewport motion lock. More...
 
void onRowMatched (qint64 modelRow, QList< int > modelRoles, QList< QString > markupText)
 Connected to the rowMatched signal to update encapsulated ZLogSearch and ZLogMapModel objects when search rows are found. More...
 
void onMarkupCompleted (ZLogViewport *viewport, ZblLogSearchList rowsFound)
 Connected to the ZblLogBkSearch::markupUpdatred signal. More...
 

Signals

void loadComplete (bool endOfData, QString errorMsg, QVariantMap context)
 Signals that loading of the viewport requested by a call to loadRecordByIndex() has completed. More...
 
void moveComplete (qint64 rowsFound, qint64 rowsStored, bool endOfData, QString errorMsg)
 Signals that moving of the viewport requested by a call to move() has completed. More...
 
void findComplete (qint64 recordID, qint64 seekPos, QList< int >columns)
 Sent when a search operation started with findNext() function has located a target log record. More...
 
void searchComplete ()
 Sent when entire background search operation has completed. More...
 
void markupUpdated ()
 Sent when search has completed marking up viewport model data. More...
 
void rowMatched (qint64 modelRow, QList< int > modelRoles, QList< QString > markupText)
 Received when the ZblLogBkSearch has found a row matching the search criteria within the viewport's data model. More...
 

Public Member Functions

 ZLogViewport (ZblLogReader *reader, qint64 recordCount, QObject *parent=0, bool background=false)
 Viewport constructor. More...
 
Q_INVOKABLE void loadRecords (qint64 seekPosition, qint64 recordCount)
 Loads a consecutive set of log records from the log file into the viewport. More...
 
Q_INVOKABLE void move (qint64 recordCount, bool forward)
 Moves the viewport forward or backwards. This method is asynchronous. More...
 
ZTableModelgetZModel ()
 Returns the data model containing the viewport's log records. More...
 
ZLogReadergetZReader ()
 Obtains the ZLogReader object that is the parent of this ZLogViewport object. More...
 
zblLogSearchPtr getZSearch ()
 Obtains the current search log map for this viewport. More...
 
qint64 getMaxRecordCount ()
 Returns the number of log records the viewport data model will attempt to hold. More...
 
int getRecordSize ()
 Obtain the average log record size ZLogViewport will use when calculating memory buffer sizes. More...
 
void putRecordSize (int size)
 Set the average log record size ZLogViewport will use when calculating memory buffer sizes. More...
 
bool getLock ()
 
int getSearchDirForward ()
 
int getSearchDirBackward ()
 
int getSearchDirBoth ()
 
qint64 getCurrentLocation ()
 
int getCurrentID ()
 
qint64 getActiveLocation ()
 
int getActiveID ()
 
qint64 getNextPageLocation ()
 
ZLogViewportgetListener () const
 
void setListener (ZLogViewport *listener)
 

Static Public Member Functions

static void registerType ()
 Registers ZLogViewport as a QML type. More...
 
static int getSeekIndexRole ()
 Obtain the role number for the file seek position of a log record in the viewport's log record data model. More...
 
static int getByteCountRole ()
 Obtain the role number for the byte count of a log record in the viewport's log record data model. More...
 
static int getBookmarksRole ()
 Obtain the role number for the bookmark data of a log record in the viewport's log record data model. More...
 

Protected Member Functions

ZBL_DECLARE_LOGGED_OBJECT ZblLogSearchParams getSearchParameters ()
 A Qt log category for this class. More...
 
void onUpdateBookmarks ()
 Signal handler for ZLogReader::updateLogMarks signal. More...
 
virtual void timerEvent (QTimerEvent *event)
 Timer is used to flush excess log records from the log record buffer. More...
 
void onSearchDeleteRequested (QObject *searchObject)
 Handler for ZLogReader::searchDeleteRequested signal. More...
 

Protected Attributes

ZTableModelm_model
 The data model that receives the viewport's log records. More...
 
zblLogReaderPtr m_reader
 The background worker object that reads and parses the viewport's log file. This value must not be null. More...
 
qint64 m_optimalCount
 Identifies the first record in the viewport. More...
 
qint64 m_assumeRecordSize
 The viewport will assume log records average this number of bytes (including JSON formating characters). More...
 
int m_timerID
 ID for the viewport's event timer. More...
 
ZLogMapm_selectionMap
 A log mark map that holds the current selection for this viewport. More...
 
zblLogSearchPtr m_currentSearch
 A log mark map that holds the current search results for this viewport. More...
 
bool m_motionLock
 Flag prevents viewport from being moved or updated during background operations. More...
 
ZLogViewportm_listener
 Companion ZLogViewport object to receive forwarded signals. Value may be null. More...
 
ZblLogMark m_logMark
 The viewport's active location indicates the log record from which search operations will start. More...
 
ZblLogSearchList m_searchLinks
 A list of log record links for records in the viewport that satisfy the current search criteria. More...
 

Static Protected Attributes

static const qint64 m_minimumRecordSize = 1024
 The minimum record size ZLogViewport will use. Currently 1024 bytes. More...
 
static const qint64 m_maximumRecordSize = 65536
 The maximum record size ZLogViewport will use. Currently 65536 bytes. More...
 
static int m_roleSeekIndex = -1
 Role number of the seek index value in the log record data model. More...
 
static int m_roleByteCount = -1
 Role number of the byte count value in the log record data model. More...
 
static int m_roleBookmarks = -1
 Role number of the bookmarks value in the log record data model. More...
 

Properties

qint64 currentLocation
 Obtain the file seek position for the first log record in the viewport. More...
 
int currentID
 Obtain the log record ID for the first log record in the viewport. More...
 
int activeLocation
 Obtain the file seek position for the currently active log record in the viewport. More...
 
int activeID
 Obtain the log record ID for the currently active log record in the viewport. More...
 
int seekIndexRole
 Role number of the log record seek index in the viewport data model. More...
 
int byteCountRole
 Role number of the log record byte count in the viewport data model. More...
 
int bookmarksRole
 Role number of the log record bookmarks in the viewport data model. More...
 
int assumeRecordSize
 The log reader assumes this is the average number of bytes per log record for calculating buffer size requirements. More...
 
bool locked
 True if the viewport is locked for scanning, false otherwise. More...
 
bool searchDirectionForward
 Returns the flag for searching forward. More...
 
bool searchDirectionBackward
 Returns the flag for searching backward. More...
 
bool searchDirectionBoth
 Returns (SearchDirectionBackward || SearchDirectionForward) More...
 

Private Types

typedef QPointer< ZblLogReaderzblLogReaderPtr
 

Friends

class ZLogReader
 
class ZblLogReader
 

Detailed Description

A log viewport encapsulates a ZTableModel containing a contiguous subset of log records from a Zuble log file.

A viewport contains a page of data. Page size is determined in log records and is user settable. Viewports can move forward and backward in the file a step at a time and can also jump to a specific location in a file. Step size for moving is determined by the user.

Viewports are created by a ZLogReader object in the foreground and populated with data by a ZblLogReader object in a background thread. As such operations on viewports are generally asynchronous.

A viewport has a current location, a search origin and a size. Current location is the position of the first log record in the viewport.

TBD: search origin may be unary to current search object, not part of viewport itself.

Search origin is the log file record used as a starting point for searching the log file. Searches can be forward, backward, or both directions from the search origin.

Size is the number of log records the viewport will attempt to hold. The viewport may temporarily grow larger or smaller than this size when moving through the file as records are concurrently being added and removed by the background thread during the move operation.

The native coordinate space of the viewport is the log record ID, an ordinal primary key into the log file, whereas the native coordinate space of the viewport's model is the model index. The location of the log record in the log file is the log record seek position. Log record ID and seek position are roles in the viewport data model. ZLogViewport provides methods for converting between them. The model index is not a safe marker for use as a persistent positioning mechanism since moving or reloading the viewport invalidates it.

Seek index is the position in the file to seek when reading a specific record. Each log record ID has an associated seek index that indicates the starting position of that log record in the file. The log file reader uses the seek index to locate records in the log file.

Viewports receive signals from the log reader and log searcher objects in response to service requests from the viewport. During search operations background (non-visible) viewports are used as data buffers. The background viewports forward signals to the foreground listener viewport that initiated the search request. Background viewports are temporary objects that are deleted when the current search operation is complete.

Definition at line 95 of file ZLogViewport.h.

Member Typedef Documentation

◆ zblLogReaderPtr

Definition at line 100 of file ZLogViewport.h.

Constructor & Destructor Documentation

◆ ZLogViewport()

Zbl::ZLogViewport::ZLogViewport ( ZblLogReader reader,
qint64  recordCount,
QObject *  parent = 0,
bool  background = false 
)
explicit

Viewport constructor.

Parameters
readerA pointer to a log reader object; must not be NULL
searcherA pointer to a log searcher object; may be NULL
recordCountNumber of log records the viewport will hold
parentParent QObject - either a ZLogReader or ZblLogBkSearch object
backgroundtrue if this is a background viewport, false (default) if a foreground viewport

Definition at line 43 of file ZLogViewport.cpp.

Member Function Documentation

◆ findComplete

void Zbl::ZLogViewport::findComplete ( qint64  recordID,
qint64  seekPos,
QList< int >  columns 
)
signal

Sent when a search operation started with findNext() function has located a target log record.

Parameters
viewportThe log viewport on which the search was performed
recordIDThe log record ID of the record that was found, or -1 if no record was found
seekPosThe file seek position for the log record that was found. Not valid if recordID == -1
columnsA list of columns containing the search phrase.

◆ getActiveID()

int Zbl::ZLogViewport::getActiveID ( )

Definition at line 735 of file ZLogViewport.cpp.

◆ getActiveLocation()

qint64 Zbl::ZLogViewport::getActiveLocation ( )

Definition at line 730 of file ZLogViewport.cpp.

◆ getBookmarksRole()

int Zbl::ZLogViewport::getBookmarksRole ( )
static

Obtain the role number for the bookmark data of a log record in the viewport's log record data model.

Returns
role number for log record's bookmark data

Definition at line 273 of file ZLogViewport.cpp.

◆ getByteCountRole()

int Zbl::ZLogViewport::getByteCountRole ( )
static

Obtain the role number for the byte count of a log record in the viewport's log record data model.

Returns
role number for log record's byte count

Definition at line 268 of file ZLogViewport.cpp.

◆ getCurrentBookmarklinks

QObject * Zbl::ZLogViewport::getCurrentBookmarklinks ( )
slot

Obtain a data model containing the log record links for the current bookmark. [TBD: does this even make sense?].

Returns
A ZTableModel object containing log record links.

Definition at line 207 of file ZLogViewport.cpp.

◆ getCurrentID()

int Zbl::ZLogViewport::getCurrentID ( )

Definition at line 725 of file ZLogViewport.cpp.

◆ getCurrentLocation()

qint64 Zbl::ZLogViewport::getCurrentLocation ( )

Definition at line 720 of file ZLogViewport.cpp.

Referenced by move().

◆ getCurrentSearch

QObject * Zbl::ZLogViewport::getCurrentSearch ( )
slot

Obtains a javascript wrapper for the current search object for this viewport.

Returns
A ZLogSearch object

Definition at line 157 of file ZLogViewport.cpp.

◆ getCurrentSearchlinks

QObject * Zbl::ZLogViewport::getCurrentSearchlinks ( )
slot

Obtain a data model containing the log record links for the current search.

Returns
A ZTableModel object containing log record links.

Definition at line 201 of file ZLogViewport.cpp.

◆ getListener()

ZLogViewport * Zbl::ZLogViewport::getListener ( ) const

Definition at line 446 of file ZLogViewport.cpp.

◆ getLock()

bool Zbl::ZLogViewport::getLock ( )

Definition at line 234 of file ZLogViewport.cpp.

◆ getMaxRecordCount()

qint64 Zbl::ZLogViewport::getMaxRecordCount ( )

Returns the number of log records the viewport data model will attempt to hold.

Note that the actual model row count may differ from this number due to batching of background thread updates to the model. During a move operation, for example, the viewport will first grow larger, then smaller again.

Returns
the optimum number of log records the viewport will attempt to maintain.

Definition at line 457 of file ZLogViewport.cpp.

Referenced by Zbl::ZblLogBkSearch::scanForward().

◆ getModel

QObject * Zbl::ZLogViewport::getModel ( )
slot

Obtains the log viewport's data model which contains a contiguous subset of rows from the log file.

Returns
A ZTableModel object

Definition at line 147 of file ZLogViewport.cpp.

◆ getNextPageLocation()

qint64 Zbl::ZLogViewport::getNextPageLocation ( )

Definition at line 740 of file ZLogViewport.cpp.

Referenced by move().

◆ getReader

QObject * Zbl::ZLogViewport::getReader ( )
slot

Obtains the ZLogReader object that is the parent of this ZLogViewport object.

Returns
A ZLogReader object

Definition at line 294 of file ZLogViewport.cpp.

◆ getRecordModelRow

qint64 Zbl::ZLogViewport::getRecordModelRow ( qint64  recordID)
slot

Obtain the index position for the specified log record in the model.

Parameters
recordIDThe log record ID for which a model index will be returned.
Returns
Row number of the model row for the specified log record ID, or -1 if the specified log record did not exist in the viewport.

Definition at line 331 of file ZLogViewport.cpp.

◆ getRecordSeekPos

qint64 Zbl::ZLogViewport::getRecordSeekPos ( qint64  recordID)
slot

Obtain the file seek position for the specified log record ID from model data in the viewport.

Parameters
recordIDThe log record ID for which a seek position will be returned.
Returns
Seek position of the specified log record ID, or -1 if the specified log record did not exist in the viewport.

Definition at line 313 of file ZLogViewport.cpp.

◆ getRecordSize()

int Zbl::ZLogViewport::getRecordSize ( )

Obtain the average log record size ZLogViewport will use when calculating memory buffer sizes.

Returns
average number of bytes per record

Definition at line 278 of file ZLogViewport.cpp.

◆ getSearchDirBackward()

int Zbl::ZLogViewport::getSearchDirBackward ( )

Definition at line 710 of file ZLogViewport.cpp.

◆ getSearchDirBoth()

int Zbl::ZLogViewport::getSearchDirBoth ( )

Definition at line 715 of file ZLogViewport.cpp.

◆ getSearchDirForward()

int Zbl::ZLogViewport::getSearchDirForward ( )

Definition at line 705 of file ZLogViewport.cpp.

◆ getSearchParameters()

ZblLogSearchParams Zbl::ZLogViewport::getSearchParameters ( )
protected

A Qt log category for this class.

Obtain parameters for the current search.

Returns
A ZblLogSearchParams object containing the current search parameters for this viewport

Definition at line 226 of file ZLogViewport.cpp.

Referenced by loadRecords(), markupText(), and move().

◆ getSeekIndexRole()

int Zbl::ZLogViewport::getSeekIndexRole ( )
static

Obtain the role number for the file seek position of a log record in the viewport's log record data model.

Returns
role number for log record's file seek position

Definition at line 263 of file ZLogViewport.cpp.

Referenced by Zbl::ZblLogScanner::getRowSeekPos(), Zbl::ZblLogBkSearch::onLoadComplete(), and Zbl::ZblLogScanner::scanModelColumnRows().

◆ getSelection

QObject * Zbl::ZLogViewport::getSelection ( )
slot

Obtains the selection log mark map for this viewport. Each viewport has its own selection.

Returns
A ZLogMap object containing this viewport's selection marks

Definition at line 152 of file ZLogViewport.cpp.

◆ getZModel()

ZTableModel * Zbl::ZLogViewport::getZModel ( )

◆ getZReader()

ZLogReader * Zbl::ZLogViewport::getZReader ( )

Obtains the ZLogReader object that is the parent of this ZLogViewport object.

Returns
A ZLogReader object

Definition at line 299 of file ZLogViewport.cpp.

Referenced by getCurrentSearch(), getReader(), onSearchDeleteRequested(), onUpdateBookmarks(), setCurrentSearch(), and ZLogViewport().

◆ getZSearch()

zblLogSearchPtr Zbl::ZLogViewport::getZSearch ( )

Obtains the current search log map for this viewport.

Returns
A strong reference to this viewport's ZblLogSearch object

Definition at line 195 of file ZLogViewport.cpp.

◆ loadComplete

void Zbl::ZLogViewport::loadComplete ( bool  endOfData,
QString  errorMsg,
QVariantMap  context 
)
signal

Signals that loading of the viewport requested by a call to loadRecordByIndex() has completed.

Parameters
endOfDatatrue if load operation encountered end-of-data, false otherwise
errorMsga message pertaining to the error condition or empty string if no errors
contextA user-defined QVariantMap that was passed to the loadRecordByIndex method

Referenced by Zbl::ZblLogReader::loadViewport(), and Zbl::ZblLogBkSearch::ZblLogBkSearch().

◆ loadRecords()

void Zbl::ZLogViewport::loadRecords ( qint64  seekPosition,
qint64  recordCount 
)

Loads a consecutive set of log records from the log file into the viewport.

Definition at line 463 of file ZLogViewport.cpp.

◆ markupText [1/2]

bool Zbl::ZLogViewport::markupText ( )
slot

Marks up text in the viewport's data model asynchronously using the current search parameters.

The background search object scans the model data in column 0 and produces a replica in column 1 with the specified text highlighted. The markupUpdated signal is sent when the markup operation has completed.

Returns
true if background operation started, false if operation failed to start

Definition at line 541 of file ZLogViewport.cpp.

Referenced by onRowMatched().

◆ markupText [2/2]

bool Zbl::ZLogViewport::markupText ( QList< int >  roles,
QString  searchPhrase,
int  type 
)
slot

Marks up text in the viewport's data model asynchronously using the specified search parameters.

The background search object scans the model data in column 0 and produces a replica in column 1 with the specified text highlighted. The markupUpdated signal is sent when the markup operation has completed.

Parameters
rolesA list of data model roles that will be highlighted. Roles not in this list will receive a copy of their source data from column 0.

searchPhrase The search phrase to highlight

type The search type, case sensitive or case insensitive

Returns
true if background operation started, false if operation failed to start

Definition at line 580 of file ZLogViewport.cpp.

◆ markupUpdated

void Zbl::ZLogViewport::markupUpdated ( )
signal

Sent when search has completed marking up viewport model data.

Parameters
viewport

Referenced by onMarkupCompleted().

◆ move()

void Zbl::ZLogViewport::move ( qint64  recordCount,
bool  forward 
)

Moves the viewport forward or backwards. This method is asynchronous.

The moveComplete signal will be sent to the viewport when the background thread has completed the move operation.

Parameters
recordCountThe number of log records to move.
forwardtrue to move the viewport forward, false to move backward

Definition at line 492 of file ZLogViewport.cpp.

◆ moveComplete

void Zbl::ZLogViewport::moveComplete ( qint64  rowsFound,
qint64  rowsStored,
bool  endOfData,
QString  errorMsg 
)
signal

Signals that moving of the viewport requested by a call to move() has completed.

Parameters
rowsFoundnumber of rows that were available to load
rowsStorednumber of rows that were stored in the data model
endOfDatatrue if no more data is available in the log file (end of file or beginning of file)
errorMsga message pertaining to the error condition

Referenced by Zbl::ZblLogReader::move(), and Zbl::ZblLogBkSearch::ZblLogBkSearch().

◆ onMarkupCompleted

void Zbl::ZLogViewport::onMarkupCompleted ( ZLogViewport viewport,
ZblLogSearchList  rowsFound 
)
slot

Connected to the ZblLogBkSearch::markupUpdatred signal.

Parameters
viewportThe viewport that was updated
rowsFoundA list of links to log records in the data model that matched the search criteria

Definition at line 630 of file ZLogViewport.cpp.

Referenced by markupText(), and setCurrentSearch().

◆ onRowMatched

void Zbl::ZLogViewport::onRowMatched ( qint64  modelRow,
QList< int >  modelRoles,
QList< QString >  markupText 
)
slot

Connected to the rowMatched signal to update encapsulated ZLogSearch and ZLogMapModel objects when search rows are found.

Parameters
modelRowThe row number in the model of the log record where search results were found.
modelRolesA list of role number where search results were found.
markupTextA list of text strings containing highlighted copies of the search result cells.

Definition at line 652 of file ZLogViewport.cpp.

◆ onSearchDeleteRequested()

void Zbl::ZLogViewport::onSearchDeleteRequested ( QObject *  searchObject)
protected

Handler for ZLogReader::searchDeleteRequested signal.

This viewport's current search is set to the null search object by this method if it references the specified viewport.

Parameters
searchObjectA pointer to the ZLogSearch object the user has requested to delete.

Definition at line 685 of file ZLogViewport.cpp.

◆ onUpdateBookmarks()

void Zbl::ZLogViewport::onUpdateBookmarks ( )
protected

Signal handler for ZLogReader::updateLogMarks signal.

Parameters
logMapsAn updated list of log maps for the log file

Definition at line 127 of file ZLogViewport.cpp.

Referenced by ZLogViewport().

◆ putRecordSize()

void Zbl::ZLogViewport::putRecordSize ( int  size)

Set the average log record size ZLogViewport will use when calculating memory buffer sizes.

Parameters
sizeaverage number of bytes per record

Definition at line 283 of file ZLogViewport.cpp.

◆ registerType()

void Zbl::ZLogViewport::registerType ( )
static

Registers ZLogViewport as a QML type.

Definition at line 112 of file ZLogViewport.cpp.

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

◆ rowMatched

void Zbl::ZLogViewport::rowMatched ( qint64  modelRow,
QList< int >  modelRoles,
QList< QString >  markupText 
)
signal

Received when the ZblLogBkSearch has found a row matching the search criteria within the viewport's data model.

Parameters
modelRowThe row number in the model of the log record where search results were found.
modelRolesA list of role number where search results were found.
markupTextA list of text strings containing highlighted copies of the search result cells.

◆ searchComplete

void Zbl::ZLogViewport::searchComplete ( )
signal

Sent when entire background search operation has completed.

◆ setCurrentSearch

bool Zbl::ZLogViewport::setCurrentSearch ( QObject *  search)
slot

Sets this viewport's current search object.

The viewport's data model will be updated to highlight the specified search criteria.

The search object status will indicate whether it has been executed by the search engine.

Parameters
searcha ZLogSearch object obtained from this viewport's ZLogReader object
Returns
true if successful, false if failure
See also
getReader()

Definition at line 162 of file ZLogViewport.cpp.

◆ setListener()

void Zbl::ZLogViewport::setListener ( ZLogViewport listener)

Definition at line 451 of file ZLogViewport.cpp.

◆ setLock

void Zbl::ZLogViewport::setLock ( bool  locked)
slot

Sets or clears the viewport motion lock.

This feature prevents the viewport from being moved or loaded while a background operation on the data model is in progress.

Cancel background operations before attempting to move or load.

Parameters
lockedtrue to lock viewport, false to unlock

Definition at line 239 of file ZLogViewport.cpp.

Referenced by markupText(), and onMarkupCompleted().

◆ timerEvent()

void Zbl::ZLogViewport::timerEvent ( QTimerEvent *  event)
protectedvirtual

Timer is used to flush excess log records from the log record buffer.

Parameters
eventContains parameters that describe a timer event

Definition at line 437 of file ZLogViewport.cpp.

Friends And Related Function Documentation

◆ ZblLogReader

friend class ZblLogReader
friend

Definition at line 98 of file ZLogViewport.h.

◆ ZLogReader

friend class ZLogReader
friend

Definition at line 97 of file ZLogViewport.h.

Member Data Documentation

◆ m_assumeRecordSize

qint64 Zbl::ZLogViewport::m_assumeRecordSize
protected

The viewport will assume log records average this number of bytes (including JSON formating characters).

This number must be between 1K and 64K.

Definition at line 731 of file ZLogViewport.h.

Referenced by getRecordSize(), and putRecordSize().

◆ m_currentSearch

zblLogSearchPtr Zbl::ZLogViewport::m_currentSearch
protected

A log mark map that holds the current search results for this viewport.

Definition at line 786 of file ZLogViewport.h.

Referenced by getCurrentBookmarklinks(), getCurrentSearch(), getSearchParameters(), getZSearch(), markupText(), onRowMatched(), onSearchDeleteRequested(), setCurrentSearch(), and ZLogViewport().

◆ m_listener

ZLogViewport* Zbl::ZLogViewport::m_listener
protected

Companion ZLogViewport object to receive forwarded signals. Value may be null.

This is used by the text search feature for background viewports that scan log files. Search result signals are sent to the foreground viewport that initiated the search operation.

Definition at line 802 of file ZLogViewport.h.

Referenced by getListener(), setListener(), and ZLogViewport().

◆ m_logMark

ZblLogMark Zbl::ZLogViewport::m_logMark
protected

The viewport's active location indicates the log record from which search operations will start.

Note that this location may be outside the boundaries of the viewport's window into the log file. The viewport may or may not contain this record. This is to accommodate the user possibly scrolling away from the active location after setting it.

Definition at line 814 of file ZLogViewport.h.

◆ m_maximumRecordSize

const qint64 Zbl::ZLogViewport::m_maximumRecordSize = 65536
staticprotected

The maximum record size ZLogViewport will use. Currently 65536 bytes.

Definition at line 743 of file ZLogViewport.h.

◆ m_minimumRecordSize

const qint64 Zbl::ZLogViewport::m_minimumRecordSize = 1024
staticprotected

The minimum record size ZLogViewport will use. Currently 1024 bytes.

Definition at line 737 of file ZLogViewport.h.

◆ m_model

ZTableModel* Zbl::ZLogViewport::m_model
protected

◆ m_motionLock

bool Zbl::ZLogViewport::m_motionLock
protected

Flag prevents viewport from being moved or updated during background operations.

Definition at line 791 of file ZLogViewport.h.

Referenced by getLock(), loadRecords(), markupText(), move(), and setLock().

◆ m_optimalCount

qint64 Zbl::ZLogViewport::m_optimalCount
protected

Identifies the first record in the viewport.

The optimum number of log records the viewport should contain

Definition at line 722 of file ZLogViewport.h.

Referenced by getMaxRecordCount(), Zbl::ZblLogReader::loadViewport(), and timerEvent().

◆ m_reader

zblLogReaderPtr Zbl::ZLogViewport::m_reader
protected

The background worker object that reads and parses the viewport's log file. This value must not be null.

Definition at line 709 of file ZLogViewport.h.

Referenced by loadRecords(), and move().

◆ m_roleBookmarks

int Zbl::ZLogViewport::m_roleBookmarks = -1
staticprotected

Role number of the bookmarks value in the log record data model.

Bookmarks support log file annotations.

Definition at line 772 of file ZLogViewport.h.

Referenced by getBookmarksRole(), onUpdateBookmarks(), registerType(), and ZLogViewport().

◆ m_roleByteCount

int Zbl::ZLogViewport::m_roleByteCount = -1
staticprotected

Role number of the byte count value in the log record data model.

Byte count is the number of bytes contained in the log record.

Definition at line 764 of file ZLogViewport.h.

Referenced by getByteCountRole(), getNextPageLocation(), registerType(), and ZLogViewport().

◆ m_roleSeekIndex

int Zbl::ZLogViewport::m_roleSeekIndex = -1
staticprotected

Role number of the seek index value in the log record data model.

Seek index is the seek position of the first byte of the log record in the log file.

Definition at line 756 of file ZLogViewport.h.

Referenced by getCurrentLocation(), getNextPageLocation(), getRecordSeekPos(), getSeekIndexRole(), onRowMatched(), registerType(), and ZLogViewport().

◆ m_searchLinks

ZblLogSearchList Zbl::ZLogViewport::m_searchLinks
protected

A list of log record links for records in the viewport that satisfy the current search criteria.

Definition at line 822 of file ZLogViewport.h.

Referenced by onMarkupCompleted().

◆ m_selectionMap

ZLogMap* Zbl::ZLogViewport::m_selectionMap
protected

A log mark map that holds the current selection for this viewport.

Definition at line 779 of file ZLogViewport.h.

Referenced by getRecordModelRow(), getSelection(), and ZLogViewport().

◆ m_timerID

int Zbl::ZLogViewport::m_timerID
protected

ID for the viewport's event timer.

Definition at line 748 of file ZLogViewport.h.

Referenced by timerEvent().

Property Documentation

◆ activeID

int Zbl::ZLogViewport::activeID
read

Obtain the log record ID for the currently active log record in the viewport.

Definition at line 157 of file ZLogViewport.h.

◆ activeLocation

int Zbl::ZLogViewport::activeLocation
read

Obtain the file seek position for the currently active log record in the viewport.

Definition at line 150 of file ZLogViewport.h.

◆ assumeRecordSize

int Zbl::ZLogViewport::assumeRecordSize
readwrite

The log reader assumes this is the average number of bytes per log record for calculating buffer size requirements.

This value may be adjusted automatically.

Definition at line 187 of file ZLogViewport.h.

◆ bookmarksRole

int Zbl::ZLogViewport::bookmarksRole
read

Role number of the log record bookmarks in the viewport data model.

Definition at line 177 of file ZLogViewport.h.

◆ byteCountRole

int Zbl::ZLogViewport::byteCountRole
read

Role number of the log record byte count in the viewport data model.

Definition at line 172 of file ZLogViewport.h.

◆ currentID

int Zbl::ZLogViewport::currentID
read

Obtain the log record ID for the first log record in the viewport.

Definition at line 143 of file ZLogViewport.h.

◆ currentLocation

qint64 Zbl::ZLogViewport::currentLocation
read

Obtain the file seek position for the first log record in the viewport.

Definition at line 136 of file ZLogViewport.h.

◆ locked

bool Zbl::ZLogViewport::locked
read

True if the viewport is locked for scanning, false otherwise.

Definition at line 193 of file ZLogViewport.h.

Referenced by setLock().

◆ searchDirectionBackward

bool Zbl::ZLogViewport::searchDirectionBackward
read

Returns the flag for searching backward.

See also
ZLogViewport::search()

Definition at line 210 of file ZLogViewport.h.

◆ searchDirectionBoth

bool Zbl::ZLogViewport::searchDirectionBoth
read

Returns (SearchDirectionBackward || SearchDirectionForward)

See also
ZLogViewport::search()

Definition at line 218 of file ZLogViewport.h.

◆ searchDirectionForward

bool Zbl::ZLogViewport::searchDirectionForward
read

Returns the flag for searching forward.

See also
ZLogViewport::search()

Definition at line 202 of file ZLogViewport.h.

◆ seekIndexRole

int Zbl::ZLogViewport::seekIndexRole
read

Role number of the log record seek index in the viewport data model.

Definition at line 167 of file ZLogViewport.h.


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