2
* Copyright © 2014 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Thomas Voß <thomas.voss@canonical.com>
19
#ifndef CLICK_DATABASE_H_
20
#define CLICK_DATABASE_H_
22
#include <core/trust/click/package.h>
29
struct FrameworkRegistry;
31
/** @brief Abstracts an enumerateable and queryable collection of click::Package's */
34
/** @brief To save some typing. */
35
typedef std::shared_ptr<Database> Ptr;
37
/** @brief Functor called for every package in a database. */
38
typedef std::function<void(const Package::Ptr&)> PackageEnumerator;
42
virtual ~Database() = default;
45
/** @brief Enumerates all packages known to a database instance. */
46
virtual void enumerate_packages(const PackageEnumerator& enumerator) const = 0;
48
/** @brief Tries to lookup a package in the database. */
49
virtual Package::Ptr find_package_for_name(const std::string& package_name) const = 0;
53
#endif // CLICK_DATABASE_H_