mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Annotation painting
This commit is contained in:
@ -28,6 +28,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
#include <functional>
|
||||
|
||||
namespace pdf
|
||||
{
|
||||
@ -76,6 +77,19 @@ public:
|
||||
return m_object;
|
||||
}
|
||||
|
||||
/// Returns the cached object. If object is dirty, then cached object is refreshed.
|
||||
/// \param function Refresh function
|
||||
inline const T& get(const std::function<T(void)>& function)
|
||||
{
|
||||
if (m_dirty)
|
||||
{
|
||||
m_object = function();
|
||||
m_dirty = false;
|
||||
}
|
||||
|
||||
return m_object;
|
||||
}
|
||||
|
||||
/// Invalidates the cached item, so it must be refreshed from the cache next time,
|
||||
/// if it is accessed.
|
||||
inline void dirty()
|
||||
|
Reference in New Issue
Block a user