LibreOffice Module sc (master) 1
sharedstringpoolpurge.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 */
10
11#pragma once
12
13#include <memory>
14#include <vector>
15
17#include <vcl/timer.hxx>
18
19namespace svl
20{
21class SharedStringPool;
22}
23
24namespace sc
25{
26/*
27Calls svl::SharedStringPool::purge() after a delay when idle. Can be
28used to compress repeated calls, as purge() may be somewhat expensive
29with large documents. And since vcl links to svl, it's not possible
30to use VCL timers in svl, so a separate class is needed.
31*/
33{
34public:
37 void delayedPurge(const std::shared_ptr<svl::SharedStringPool>& pool);
38
39private:
40 void cleanup();
41 std::vector<std::shared_ptr<svl::SharedStringPool>> mPoolsToPurge;
43 DECL_LINK(timerHandler, Timer*, void);
44};
45}
46
47/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void delayedPurge(const std::shared_ptr< svl::SharedStringPool > &pool)
DECL_LINK(timerHandler, Timer *, void)
std::vector< std::shared_ptr< svl::SharedStringPool > > mPoolsToPurge
CAUTION! The following defines must be in the same namespace as the respective type.
These need to be in global namespace just like their respective types are.