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
ZblLogMap.h
Go to the documentation of this file.
1 #ifndef ZBLLOGMAP_H
2 #define ZBLLOGMAP_H
3 
4 #include "ZblLogMapData.h"
5 #include <QSharedDataPointer>
6 
7 namespace Zbl {
8 
19 class ZblLogMap
20 {
21 public:
22 
24 
25  ZblLogMap(int id, const QString &name)
26  {
27  m_d = new ZblLogMapData;
28  }
29 
30  ZblLogMap(const ZblLogMap &other)
31  : m_d(other.m_d)
32  {
33  }
34 
35 
42 
49  bool isValidMapType(int mapType){ZblLogMapData::isValidMapType(mapType);}
50 
59  bool insertMark(
60  qint64 recordID,
61  qint64 lastRecordID,
62  qint64 seekPosition)
63  {
64  return m_d->insertMark(recordID, lastRecordID, seekPosition);
65  }
66 
75  bool hasMark(qint64 recordID)
76  {
77  return m_d->hasMark(recordID);
78  }
79 
95  qint64 findNextMark(qint64 startID, bool forward = true) const
96  {return m_d->findNextMark(startID, forward);}
97 
98 
107  bool removeMark(qint64 recordID, qint64 lastRecordID)
108  {
109  return m_d->removeMark(recordID, lastRecordID);
110  }
111 
119  bool clear(){return m_d->clear();}
120 
121 
128  {
129  return m_d->getLogLinkList();
130  }
131 
132 protected:
133 
138  QSharedDataPointer<ZblLogMapData> m_d;
139 
140 };
141 
142 } // Zbl
143 
144 Q_DECLARE_METATYPE(Zbl::ZblLogMap)
145 
146 
147 #endif // ZBLLOGMAP_H
MarkType
Types of log maps: Invalid, Selection, Search, Bookmark.
Definition: ZblLogMapData.h:35
bool hasMark(qint64 recordID)
Determine if the log map contains a mark for the specified log record.
Definition: ZblLogMap.h:75
bool isValidMapType(int mapType)
Determine if a value is a valid logmap type.
Definition: ZblLogMap.h:49
bool clear()
Removes all marks from the log map.
Definition: ZblLogMap.h:119
bool removeMark(qint64 recordID, qint64 lastRecordID)
Removes the specified mark from the log map.
Definition: ZblLogMap.h:107
ZblLogMap(int id, const QString &name)
Definition: ZblLogMap.h:25
ZblLogMapData::MarkType getMapType()
returns this log map&#39;s mark type
Definition: ZAndGate.cpp:6
ZblLogMap(const ZblLogMap &other)
Definition: ZblLogMap.h:30
static bool isValidMapType(int mapType)
Determine if a value is a valid logmap type.
bool insertMark(qint64 recordID, qint64 lastRecordID, qint64 seekPosition)
Creates a new log mark in the database.
Definition: ZblLogMap.h:59
ZblLogLinkList getLogLinkList() const
Obtain a ZblLogLinkList object containing expanded log links.
Definition: ZblLogMap.h:127
Logmap objects contain a collection of compressed links to log records.
Definition: ZblLogMap.h:19
qint64 findNextMark(qint64 startID, bool forward=true) const
Search forward or backward for the next mark from a specified starting position.
Definition: ZblLogMap.h:95
The implicitly shared data object encapsulated by ZblLogMap objects.
Definition: ZblLogMapData.h:25
QSharedDataPointer< ZblLogMapData > m_d
The log map data object.
Definition: ZblLogMap.h:138