2 * Copyright (c) 2012 Novell, Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License as published
8 * by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, contact Novell, Inc.
18 * To contact Novell about this file by physical or electronic mail, you may
19 * find current contact information at www.novell.com.
23 #ifndef SNAPPER_BACKGROUND_H
24 #define SNAPPER_BACKGROUND_H
27 #include <boost/thread.hpp>
29 #include "MetaSnapper.h"
33 using namespace snapper;
36 class Backgrounds : private boost::noncopyable
46 Task(MetaSnappers::iterator meta_snapper, Snapshots::const_iterator snapshot1,
47 Snapshots::const_iterator snapshot2)
48 : meta_snapper(meta_snapper), snapshot1(snapshot1), snapshot2(snapshot2) {}
50 MetaSnappers::iterator meta_snapper;
51 Snapshots::const_iterator snapshot1;
52 Snapshots::const_iterator snapshot2;
55 typedef list<Task>::const_iterator const_iterator;
57 const_iterator begin() const { return tasks.begin(); }
59 const_iterator end() const { return tasks.end(); }
61 bool empty() const { return tasks.empty(); }
63 void add_task(MetaSnappers::iterator meta_snapper, Snapshots::const_iterator snapshot1,
64 Snapshots::const_iterator snapshot2);
70 boost::condition_variable condition;
78 extern Backgrounds backgrounds;