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 | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Zbl::ZblLogSearch Class Reference

This object encapsulates search operation parameters, results, and steady state. More...

#include <ZblLogSearch.h>

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

Public Types

enum  searchState { BEGIN = 0, SCANNING, PAUSED, COMPLETE }
 States of a search. More...
 
enum  TextSearchDirection { SearchDirectionNull = 0, SearchDirectionForward = 1, SearchDirectionBackward = 2, SearchDirectionBoth = 3 }
 Specify search direction from initial log file position at start of search. More...
 
- Public Types inherited from Zbl::ZLogBookmark
enum  bookmarkType { RecordNumber = 0, RecordIndex }
 
typedef QList< ZLogBookmark * > zLogBookmarkList
 
- Public Types inherited from Zbl::ZLogMap
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 onSearchRowMatched (qint64 recordID, qint64 seekPosition, QList< int > modelRoles)
 Called when the search engine has found a target record in the log file. More...
 
void onSearchRowsMatched (ZblLogSearchList rowsFound)
 Called when the search engine has found target records in the log file. More...
 
void onLinkTextComplete (QVariant linkList)
 Called by ZblLogReader when loadRecordLinkMessageText has completed. More...
 
QList< int > getRolesFound () const
 Returns the set of roles for which search results were found. More...
 
bool isSearch (const QString &searchPhrase, int searchType, QList< int > searchRoles) const
 Determines if this object contains results from searching for the specified search phrase and type. More...
 
bool isNull ()
 Determine if this search is null. More...
 
void addSearchRole (int roleNumber)
 Adds the specified role to the set of roles that will be scanned during a text search. More...
 
void addSearchRoles (QList< int > rolesToSearch)
 Adds the specified roles to the set of roles that will be scanned during a text search. More...
 
void setSearchRoles (QList< int > rolesToSearch)
 Replaces the current set of roles to scan during a text search with the specified roles. More...
 
void clearSearchRoles ()
 Removes all roles from the set of search result roles. More...
 
bool containsSearchRoles (QList< int > searchRoles) const
 Determine if the set of roles to scan when processing this searchmark contains the specified roles. More...
 
bool equalsSearchRoles (QList< int > searchRoles) const
 Determine if the set of roles to scan when processing this searchmark contains exactly the specified roles. More...
 
QObject * linkModel ()
 Obtain a list model containing an item for each log record represented in the ZLogSearchMark's result set. This is used to display log record links. More...
 
bool search (int direction, qint64 startPos)
 Scans the log file for text matching the current search criteria. More...
 
void pause ()
 Pause the background search operation. More...
 
void resume ()
 Resume the background search operation. More...
 
void abort ()
 Resume the background search operation. More...
 
- Public Slots inherited from Zbl::ZLogBookmark
QString getMarkName () const
 
void setMarkName (const QString &name)
 
QString getNote () const
 
void setNote (const QString &note)
 
- Public Slots inherited from Zbl::ZLogMap
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 invalidate ()
 Sent when a request to delete this object requires all references to be released. More...
 
void notifySearchState (int newValue)
 
void notifySearchForward (bool newValue)
 
void notifySearchBackward (bool newValue)
 
void notifyActive (bool newValue)
 
void notifySaved (bool newValue)
 
void notifyCompletionFileSize (qint64 newValue)
 
- Signals inherited from Zbl::ZLogMap
void selectionUpdated ()
 Sent whenever the ZLogMap state has been changed. More...
 

Public Member Functions

 ZblLogSearch (const QString &searchPhrase, int searchType, QList< int > searchRoles, ZblLogSearch::TextSearchDirections directions, qint64 startPosition, ZLogReader *reader)
 
QString getPhrase () const
 
int getSearchType () const
 
QList< int > getSearchRoles () const
 Returns the set of roles in the log file data model that will be scanned by the text search engine when processing this searchmark. More...
 
searchState getSearchState () const
 
bool getActive () const
 
bool getSaved () const
 
qint64 getCompletionFileSize () const
 
bool getSearchForward () const
 
void setSearchForward (bool forward)
 
bool getSearchBackward () const
 
void setSearchBackward (bool backward)
 
TextSearchDirections getSearchDirections () const
 
void setSearchDirections (ZblLogSearch::TextSearchDirections directions)
 
void addRoleFound (int roleNumber)
 Adds the specified role to the set of roles where search results were found. More...
 
void addRolesFound (QList< int > rolesFound)
 Adds the specified roles to the set of roles where search results were found. More...
 
void clearRolesFound ()
 Removes all roles from the set of search result roles. More...
 
ZblLogBkSearchgetSearcher ()
 Obtain the background searcher object associated with this search. More...
 
bool validateReader (ZLogReader *reader)
 Determine if the specified background file reader is connected to this search object. More...
 
ZblLogSearchParams getSearchParameters ()
 Obtain parameters for this search. More...
 
- Public Member Functions inherited from Zbl::ZLogBookmark
 ZLogBookmark (ZLogReader *reader)
 
 ZLogBookmark (ZLogReader *reader, const QString &name)
 
- Public Member Functions inherited from Zbl::ZLogMap
 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 zInit ()
 Initializes search engine. Must be called only once before constructing the first ZblLogSearch object. More...
 
static QString getSearchmarkName (QString searchPhrase, int searchType, QList< int > searchRoles)
 Creates a unique name string for a given set of search parameters. More...
 
static void dismiss (QObject *search)
 QSharedPointer deleter method called when last strong reference has gone out of scope; sends detach() signal, then calls deleteLater(). More...
 
- Static Public Member Functions inherited from Zbl::ZLogMap
static void registerType ()
 Registers ZLogMap as a QML type. More...
 

Protected Member Functions

virtual int logMapType ()
 Returns log map type. Override of ZLogBookmark::logMapType(). More...
 
void populateLinkModel (ZblLogReclinkData &linkModel)
 Creates an expanded data model of this ZLogSearch object's log record links in the specified object. More...
 
- Protected Member Functions inherited from Zbl::ZLogMap
ZLogReadergetZReader () const
 Returns the foreground log file reader object for this search. More...
 

Static Protected Member Functions

static void deleteReclinkData (ZblLogReclinkData *data)
 calls deleteLater() method of the specified ZblLogReclinkData object. More...
 
static QString getSearchRolesName (QList< int > searchRoles)
 Returns a name concatenated from the specified search role list. More...
 

Protected Attributes

QString m_searchPhrase
 The search phrase used to generate these search results. More...
 
textSearchType m_searchType
 The type of search: case sensitive/insensitive or regular expression. More...
 
QSet< int > m_rolesSearched
 The log record rolls that are searched. More...
 
QSet< int > m_rolesFound
 The roles in which a search result was found. More...
 
QWeakPointer< ZblLogReclinkDatam_linkModel
 A log record link data model that is shared by all ZLogReclinkModel objects created by this ZlogSearchmark object. More...
 
searchState m_searchState
 Tracks the state of a search operation. More...
 
bool m_active
 True if search is active, false if inactive. More...
 
bool m_saved
 True is search is saved, false if unsaved. More...
 
TextSearchDirections m_searchDirection
 Specifies direction of search from active viewport location. More...
 
qint64 m_startPosition
 File seek position of the log record from which to start the search operation. More...
 
qint64 m_endSize
 The file size at the successful conclusion of the search operation. More...
 
ZLogMap m_searchArea
 Links in this map represent areas of the log file that have already been searched. More...
 
ZblLogBkSearchm_searcher
 A background searcher object to service foreground log file search requests. More...
 
- Protected Attributes inherited from Zbl::ZLogBookmark
QString m_bookmarkName
 Display name for this bookmark. More...
 
QString m_note
 Annotation for this bookmark. More...
 
- Protected Attributes inherited from Zbl::ZLogMap
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...
 

Static Protected Attributes

static QThread * m_searcherThread = 0
 A single background thread services all ZblLogBkSearch objects. More...
 

Additional Inherited Members

- Properties inherited from Zbl::ZLogBookmark
QString name
 
QString note
 
- Properties inherited from Zbl::ZLogMap
int mapType
 

Detailed Description

This object encapsulates search operation parameters, results, and steady state.

Parameters include start location, direction, data model roles, search phrase, and search type.

Results include a log map of records that satisfy the search criteria. Since ZLogSearch is a ZLogBookmark it can be named and annotated.

Results are stored in a compressed form but can be automatically expanded for display purposes.

This object is explicitly shared through the ZLogSearch wrapper object.

See also
Zbl::ZblLogSearch

Definition at line 35 of file ZblLogSearch.h.

Member Enumeration Documentation

◆ searchState

States of a search.

Enumerator
BEGIN 
SCANNING 
PAUSED 
COMPLETE 

Definition at line 46 of file ZblLogSearch.h.

◆ TextSearchDirection

Specify search direction from initial log file position at start of search.

Enumerator
SearchDirectionNull 
SearchDirectionForward 
SearchDirectionBackward 
SearchDirectionBoth 

Definition at line 60 of file ZblLogSearch.h.

Constructor & Destructor Documentation

◆ ZblLogSearch()

Zbl::ZblLogSearch::ZblLogSearch ( const QString &  searchPhrase,
int  searchType,
QList< int >  searchRoles,
ZblLogSearch::TextSearchDirections  directions,
qint64  startPosition,
ZLogReader reader 
)
explicit

Definition at line 16 of file ZblLogSearch.cpp.

Member Function Documentation

◆ abort

void Zbl::ZblLogSearch::abort ( )
slot

Resume the background search operation.

Definition at line 101 of file ZblLogSearch.cpp.

◆ addRoleFound()

void Zbl::ZblLogSearch::addRoleFound ( int  roleNumber)

Adds the specified role to the set of roles where search results were found.

This data is used to optimize scanning for text matches. Note that adding search roles to a non-empty ZLogSearch object invalidates existing search results.

Parameters
roleNumberThe role number to add

Definition at line 235 of file ZblLogSearch.cpp.

◆ addRolesFound()

void Zbl::ZblLogSearch::addRolesFound ( QList< int >  rolesFound)

Adds the specified roles to the set of roles where search results were found.

This data is used to optimize viewport markup operations.

Parameters
rolesFoundA list of integers representing the role numbers in which search text was found.

Definition at line 240 of file ZblLogSearch.cpp.

Referenced by onSearchRowMatched().

◆ addSearchRole

void Zbl::ZblLogSearch::addSearchRole ( int  roleNumber)
slot

Adds the specified role to the set of roles that will be scanned during a text search.

This data is used to optimize scanning for text matches.

Parameters
roleNumberThe role number to add

Definition at line 257 of file ZblLogSearch.cpp.

◆ addSearchRoles

void Zbl::ZblLogSearch::addSearchRoles ( QList< int >  rolesToSearch)
slot

Adds the specified roles to the set of roles that will be scanned during a text search.

This data is used to optimize scanning for text matches. Note that adding search roles to a non-empty ZLogSearch object invalidates existing search results.

Parameters
rolesToSearchA list of integers representing the role numbers that will be searched.

Definition at line 267 of file ZblLogSearch.cpp.

◆ clearRolesFound()

void Zbl::ZblLogSearch::clearRolesFound ( )

Removes all roles from the set of search result roles.

Definition at line 247 of file ZblLogSearch.cpp.

◆ clearSearchRoles

void Zbl::ZblLogSearch::clearSearchRoles ( )
slot

Removes all roles from the set of search result roles.

Definition at line 279 of file ZblLogSearch.cpp.

◆ containsSearchRoles

bool Zbl::ZblLogSearch::containsSearchRoles ( QList< int >  searchRoles) const
slot

Determine if the set of roles to scan when processing this searchmark contains the specified roles.

Note this does not determine if the two sets are equal.

See also
equalsSearchRoles()
Returns
true if all integers in searchRoles are contained within the set of roles to scan. False if any integer in searchRoles is not in the set of roles to scan.

Definition at line 291 of file ZblLogSearch.cpp.

◆ deleteReclinkData()

void Zbl::ZblLogSearch::deleteReclinkData ( ZblLogReclinkData data)
staticprotected

calls deleteLater() method of the specified ZblLogReclinkData object.

Parameters
dataA ZblLogReclinkData object that has no references and will be deleted

Definition at line 391 of file ZblLogSearch.cpp.

Referenced by linkModel().

◆ dismiss()

void Zbl::ZblLogSearch::dismiss ( QObject *  search)
static

QSharedPointer deleter method called when last strong reference has gone out of scope; sends detach() signal, then calls deleteLater().

Parameters
searchPointer to a ZblLogSearch object

Definition at line 69 of file ZblLogSearch.cpp.

Referenced by Zbl::ZLogReader::getZSearch().

◆ equalsSearchRoles

bool Zbl::ZblLogSearch::equalsSearchRoles ( QList< int >  searchRoles) const
slot

Determine if the set of roles to scan when processing this searchmark contains exactly the specified roles.

Returns
true if the set of integers in searchRoles is exactly the same as the set of roles to scan, false otherwise.

Definition at line 299 of file ZblLogSearch.cpp.

◆ getActive()

bool Zbl::ZblLogSearch::getActive ( ) const

Definition at line 215 of file ZblLogSearch.cpp.

◆ getCompletionFileSize()

qint64 Zbl::ZblLogSearch::getCompletionFileSize ( ) const

Definition at line 225 of file ZblLogSearch.cpp.

◆ getPhrase()

QString Zbl::ZblLogSearch::getPhrase ( ) const

Definition at line 155 of file ZblLogSearch.cpp.

Referenced by Zbl::ZblLogSearchParams::ZblLogSearchParams().

◆ getRolesFound

QList< int > Zbl::ZblLogSearch::getRolesFound ( ) const
slot

Returns the set of roles for which search results were found.

Returns
An array containing the role numbers

Definition at line 252 of file ZblLogSearch.cpp.

◆ getSaved()

bool Zbl::ZblLogSearch::getSaved ( ) const

Definition at line 220 of file ZblLogSearch.cpp.

◆ getSearchBackward()

bool Zbl::ZblLogSearch::getSearchBackward ( ) const

Definition at line 186 of file ZblLogSearch.cpp.

◆ getSearchDirections()

ZblLogSearch::TextSearchDirections Zbl::ZblLogSearch::getSearchDirections ( ) const

Definition at line 202 of file ZblLogSearch.cpp.

Referenced by Zbl::ZblLogSearchParams::ZblLogSearchParams().

◆ getSearcher()

ZblLogBkSearch * Zbl::ZblLogSearch::getSearcher ( )

Obtain the background searcher object associated with this search.

Returns
A pointer to a ZblLogBkSearch object.

Definition at line 84 of file ZblLogSearch.cpp.

◆ getSearchForward()

bool Zbl::ZblLogSearch::getSearchForward ( ) const

Definition at line 171 of file ZblLogSearch.cpp.

◆ getSearchmarkName()

QString Zbl::ZblLogSearch::getSearchmarkName ( QString  searchPhrase,
int  searchType,
QList< int >  searchRoles 
)
static

Creates a unique name string for a given set of search parameters.

Parameters
searchPhrase
searchType
searchRoles
Returns

Definition at line 107 of file ZblLogSearch.cpp.

Referenced by Zbl::ZLogReader::getZSearch(), Zbl::ZLogReader::hasSearch(), and ZblLogSearch().

◆ getSearchParameters()

ZblLogSearchParams Zbl::ZblLogSearch::getSearchParameters ( )

Obtain parameters for this search.

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

Definition at line 504 of file ZblLogSearch.cpp.

Referenced by search(), and ZblLogSearch().

◆ getSearchRoles()

QList< int > Zbl::ZblLogSearch::getSearchRoles ( ) const

Returns the set of roles in the log file data model that will be scanned by the text search engine when processing this searchmark.

Only roles in this set will be scanned. Roles not in the set will be ignored.

Returns
An array containing the role numbers

Definition at line 286 of file ZblLogSearch.cpp.

Referenced by Zbl::ZblLogSearchParams::ZblLogSearchParams().

◆ getSearchRolesName()

QString Zbl::ZblLogSearch::getSearchRolesName ( QList< int >  searchRoles)
staticprotected

Returns a name concatenated from the specified search role list.

Parameters
searchRolesa list of search roles for the name
Returns
A string containing the concatenated name.

Definition at line 114 of file ZblLogSearch.cpp.

Referenced by getSearchmarkName().

◆ getSearchState()

ZblLogSearch::searchState Zbl::ZblLogSearch::getSearchState ( ) const

Definition at line 165 of file ZblLogSearch.cpp.

◆ getSearchType()

int Zbl::ZblLogSearch::getSearchType ( ) const

Definition at line 160 of file ZblLogSearch.cpp.

Referenced by Zbl::ZblLogSearchParams::ZblLogSearchParams().

◆ invalidate

void Zbl::ZblLogSearch::invalidate ( )
signal

Sent when a request to delete this object requires all references to be released.

All strong references to this object (wrapper objects, etc) should be released in response to this signal.

WARNING: Failure to respond to this signal may result in duplicate search objects which will waste resources and potentially cause erratic UI behavior.

Referenced by Zbl::ZLogReader::getSearch().

◆ isNull

bool Zbl::ZblLogSearch::isNull ( )
slot

Determine if this search is null.

A null search by definition matches zero log records.

Returns
true if this search object is a null search, false otherwise.

Definition at line 313 of file ZblLogSearch.cpp.

◆ isSearch

bool Zbl::ZblLogSearch::isSearch ( const QString &  searchPhrase,
int  searchType,
QList< int >  searchRoles 
) const
slot

Determines if this object contains results from searching for the specified search phrase and type.

Parameters
searchPhrase
searchType
searchRoles
Returns

Definition at line 306 of file ZblLogSearch.cpp.

◆ linkModel

QObject * Zbl::ZblLogSearch::linkModel ( )
slot

Obtain a list model containing an item for each log record represented in the ZLogSearchMark's result set. This is used to display log record links.

The returned ZLogReclinkModel object remains synchronized to the ZLogSearch object that created it. Links may continue to be added to the model as the search operation progresses.

Returns
A ZLogReclinkModel object containing the search result set.
See also
ZLogReclinkModel, ZLogBookmark, ZLogMap, ZblLogMap

Definition at line 360 of file ZblLogSearch.cpp.

Referenced by onLinkTextComplete().

◆ logMapType()

int Zbl::ZblLogSearch::logMapType ( )
protectedvirtual

Returns log map type. Override of ZLogBookmark::logMapType().

Returns
the map type ZLogMap::Search

Reimplemented from Zbl::ZLogBookmark.

Definition at line 230 of file ZblLogSearch.cpp.

◆ notifyActive

void Zbl::ZblLogSearch::notifyActive ( bool  newValue)
signal

◆ notifyCompletionFileSize

void Zbl::ZblLogSearch::notifyCompletionFileSize ( qint64  newValue)
signal

◆ notifySaved

void Zbl::ZblLogSearch::notifySaved ( bool  newValue)
signal

◆ notifySearchBackward

void Zbl::ZblLogSearch::notifySearchBackward ( bool  newValue)
signal

◆ notifySearchForward

void Zbl::ZblLogSearch::notifySearchForward ( bool  newValue)
signal

◆ notifySearchState

void Zbl::ZblLogSearch::notifySearchState ( int  newValue)
signal

◆ onLinkTextComplete

void Zbl::ZblLogSearch::onLinkTextComplete ( QVariant  linkList)
slot

Called by ZblLogReader when loadRecordLinkMessageText has completed.

Parameters
linkListAn encapsulated ZblLogLinkList object containing message text.

Definition at line 436 of file ZblLogSearch.cpp.

◆ onSearchRowMatched

void Zbl::ZblLogSearch::onSearchRowMatched ( qint64  recordID,
qint64  seekPosition,
QList< int >  modelRoles 
)
slot

Called when the search engine has found a target record in the log file.

Parameters
recordIDThe record ID number of the log record where search results were found.
seekPositionThe file seek position of the log record where search results were found.
modelRolesA list of role numbers of this log record where search results were found.

Definition at line 322 of file ZblLogSearch.cpp.

◆ onSearchRowsMatched

void Zbl::ZblLogSearch::onSearchRowsMatched ( ZblLogSearchList  rowsFound)
slot

Called when the search engine has found target records in the log file.

Parameters
rowsFoundA list of rows that matched the search parameters.

Definition at line 341 of file ZblLogSearch.cpp.

Referenced by ZblLogSearch().

◆ pause

void Zbl::ZblLogSearch::pause ( )
slot

Pause the background search operation.

Definition at line 91 of file ZblLogSearch.cpp.

◆ populateLinkModel()

void Zbl::ZblLogSearch::populateLinkModel ( ZblLogReclinkData linkModel)
protected

Creates an expanded data model of this ZLogSearch object's log record links in the specified object.

Previous contents of linkModel will be lost.

Parameters
linkModelA ZblLogReclinkData object to receive log record links.

Definition at line 398 of file ZblLogSearch.cpp.

Referenced by linkModel().

◆ resume

void Zbl::ZblLogSearch::resume ( )
slot

Resume the background search operation.

Definition at line 96 of file ZblLogSearch.cpp.

◆ search

bool Zbl::ZblLogSearch::search ( int  direction,
qint64  startPos 
)
slot

Scans the log file for text matching the current search criteria.

Search operation is performed in a background thread. The findComplete signal is emitted when the operation has finished.

Parameters
forwardDirection of search: true = forward, false = backward
startRowmodel row number of the first log record to search
Returns
true if background search operation started, false if search operation failed to start
See also
setSearch()

Definition at line 464 of file ZblLogSearch.cpp.

Referenced by dismiss().

◆ setSearchBackward()

void Zbl::ZblLogSearch::setSearchBackward ( bool  backward)

Definition at line 191 of file ZblLogSearch.cpp.

◆ setSearchDirections()

void Zbl::ZblLogSearch::setSearchDirections ( ZblLogSearch::TextSearchDirections  directions)

Definition at line 207 of file ZblLogSearch.cpp.

◆ setSearchForward()

void Zbl::ZblLogSearch::setSearchForward ( bool  forward)

Definition at line 176 of file ZblLogSearch.cpp.

◆ setSearchRoles

void Zbl::ZblLogSearch::setSearchRoles ( QList< int >  rolesToSearch)
slot

Replaces the current set of roles to scan during a text search with the specified roles.

Only log data model roles specified in rolesToSearch will be scanned. All others will be ignored.

This data is used to optimize scanning for text matches. Note that setting search roles invalidates existing search results.

Parameters
rolesToSearchA list of integers representing the role numbers that will be searched.

◆ validateReader()

bool Zbl::ZblLogSearch::validateReader ( ZLogReader reader)

Determine if the specified background file reader is connected to this search object.

Parameters
readerThe background reader to check.
Returns
true if the specified reader is connected to this object, flase if not

Definition at line 63 of file ZblLogSearch.cpp.

◆ zInit()

void Zbl::ZblLogSearch::zInit ( )
static

Initializes search engine. Must be called only once before constructing the first ZblLogSearch object.

Definition at line 57 of file ZblLogSearch.cpp.

Referenced by Zbl::ZLogReader::registerType().

Member Data Documentation

◆ m_active

bool Zbl::ZblLogSearch::m_active
protected

True if search is active, false if inactive.

A search is active when search opeartions are enabled and results for the search are currently in memory.

Search operations are disabled for inactive searches and search results are not available in memory.

Definition at line 622 of file ZblLogSearch.h.

Referenced by getActive(), and ZblLogSearch().

◆ m_endSize

qint64 Zbl::ZblLogSearch::m_endSize
protected

The file size at the successful conclusion of the search operation.

Minus one indicates no successful conclusion state has yet been achieved.

Definition at line 652 of file ZblLogSearch.h.

Referenced by getCompletionFileSize().

◆ m_linkModel

QWeakPointer<ZblLogReclinkData> Zbl::ZblLogSearch::m_linkModel
protected

A log record link data model that is shared by all ZLogReclinkModel objects created by this ZlogSearchmark object.

The ZblLogReclinkData object is synchronized with the ZLogSearch object that created it such that changes to the search result set made to the ZLogSearch object will be propagated to the ZblLogReclinkData object.

The shared ZblLogReclinkData object will be destroyed when all referencing ZLogReclinkModel objects are deleted since ZLogReclinkModel holds a QSharedPointer (strong reference) to ZblLogReclinkData.

QWeakPointer won't prevent the ZblLogReclinkData object from being destroyed. Thus must promomte it to a strong pointer and check for object existence before using it.

Definition at line 605 of file ZblLogSearch.h.

Referenced by linkModel(), and onLinkTextComplete().

◆ m_rolesFound

QSet<int> Zbl::ZblLogSearch::m_rolesFound
protected

The roles in which a search result was found.

This data is used to optimize performance of highlighting search text in the log record data model by using trivial rejection of data roles that don't contain search results.

Definition at line 584 of file ZblLogSearch.h.

Referenced by addRoleFound(), addRolesFound(), clearRolesFound(), and getRolesFound().

◆ m_rolesSearched

QSet<int> Zbl::ZblLogSearch::m_rolesSearched
protected

The log record rolls that are searched.

Only roles in this set will be examined when scanning log file to create this searchmark.

Definition at line 573 of file ZblLogSearch.h.

Referenced by addSearchRole(), addSearchRoles(), clearSearchRoles(), containsSearchRoles(), equalsSearchRoles(), getSearchParameters(), getSearchRoles(), isNull(), isSearch(), and ZblLogSearch().

◆ m_saved

bool Zbl::ZblLogSearch::m_saved
protected

True is search is saved, false if unsaved.

A search is saved when it has previously been written to persistent storage.

Definition at line 631 of file ZblLogSearch.h.

Referenced by getSaved(), and ZblLogSearch().

◆ m_searchArea

ZLogMap Zbl::ZblLogSearch::m_searchArea
protected

Links in this map represent areas of the log file that have already been searched.

Definition at line 658 of file ZblLogSearch.h.

◆ m_searchDirection

TextSearchDirections Zbl::ZblLogSearch::m_searchDirection
protected

Specifies direction of search from active viewport location.

Definition at line 637 of file ZblLogSearch.h.

Referenced by getSearchBackward(), getSearchDirections(), getSearchForward(), getSearchParameters(), setSearchBackward(), setSearchDirections(), setSearchForward(), and ZblLogSearch().

◆ m_searcher

ZblLogBkSearch* Zbl::ZblLogSearch::m_searcher
protected

A background searcher object to service foreground log file search requests.

Definition at line 665 of file ZblLogSearch.h.

Referenced by getSearcher(), search(), and ZblLogSearch().

◆ m_searcherThread

QThread * Zbl::ZblLogSearch::m_searcherThread = 0
staticprotected

A single background thread services all ZblLogBkSearch objects.

Definition at line 670 of file ZblLogSearch.h.

Referenced by ZblLogSearch(), and zInit().

◆ m_searchPhrase

QString Zbl::ZblLogSearch::m_searchPhrase
protected

The search phrase used to generate these search results.

Definition at line 558 of file ZblLogSearch.h.

Referenced by getPhrase(), getSearchParameters(), getSearchRolesName(), isNull(), and isSearch().

◆ m_searchState

searchState Zbl::ZblLogSearch::m_searchState
protected

Tracks the state of a search operation.

Definition at line 612 of file ZblLogSearch.h.

Referenced by getSearchState(), and ZblLogSearch().

◆ m_searchType

textSearchType Zbl::ZblLogSearch::m_searchType
protected

The type of search: case sensitive/insensitive or regular expression.

Definition at line 564 of file ZblLogSearch.h.

Referenced by getSearchParameters(), getSearchType(), isSearch(), and ZblLogSearch().

◆ m_startPosition

qint64 Zbl::ZblLogSearch::m_startPosition
protected

File seek position of the log record from which to start the search operation.

Definition at line 644 of file ZblLogSearch.h.


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