2 * Copyright 2013 Sveriges Television AB http://casparcg.com/
\r
4 * This file is part of CasparCG (www.casparcg.com).
\r
6 * CasparCG is free software: you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation, either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * CasparCG is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
\r
19 * Author: Helge Norberg, helge.norberg@svt.se
\r
24 #include "filesystem_monitor.h"
\r
26 namespace boost { namespace asio {
\r
33 * A portable filesystem monitor implementation which periodically polls the
\r
34 * filesystem for changes. Will not react instantly but never misses any
\r
37 * Will create a dedicated thread for each monitor created.
\r
39 class polling_filesystem_monitor_factory : public filesystem_monitor_factory
\r
45 * @param scheduler The io_service that will be used for
\r
46 * scheduling periodic scans.
\r
47 * @param scan_interval_millis The number of milliseconds between each
\r
48 * scheduled scan. Lower values lowers the
\r
49 * reaction time but causes more I/O.
\r
51 polling_filesystem_monitor_factory(
\r
52 std::shared_ptr<boost::asio::io_service> scheduler,
\r
53 int scan_interval_millis = 5000);
\r
54 virtual ~polling_filesystem_monitor_factory();
\r
55 virtual filesystem_monitor::ptr create(
\r
56 const boost::filesystem::wpath& folder_to_watch,
\r
57 filesystem_event events_of_interest_mask,
\r
58 bool report_already_existing,
\r
59 const filesystem_monitor_handler& handler,
\r
60 const initial_files_handler& initial_files_handler);
\r
62 struct implementation;
\r
63 safe_ptr<implementation> impl_;
\r