2
* Copyright (C) 2016 Canonical, Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
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>
20
#ifndef BIOMETRYD_DBUS_SKELETON_SERVICE_H_
21
#define BIOMETRYD_DBUS_SKELETON_SERVICE_H_
23
#include <biometry/service.h>
24
#include <biometry/visibility.h>
26
#include <biometry/dbus/skeleton/device.h>
28
#include <util/once.h>
30
#include <core/dbus/object.h>
31
#include <core/dbus/service.h>
43
// Service is the dbus SKELETON implementation of biometry::Service.
44
class BIOMETRY_DLL_PUBLIC Service : public biometry::Service
47
// Safe us some typing.
48
typedef std::shared_ptr<Service> Ptr;
50
/// @brief create_for_bus creates a new instance connecting to bus, forwarding incoming calls to impl.
51
static Ptr create_for_bus(const core::dbus::Bus::Ptr& bus_, const std::shared_ptr<biometry::Service>& impl_);
53
/// @brief Frees up resources and removes routes to message handlers.
56
// From biometry::Service.
57
std::shared_ptr<biometry::Device> default_device() const override;
60
/// @brief Service creates a new instance for the given remote service and object.
61
Service(const core::dbus::Bus::Ptr& bus, const core::dbus::Service::Ptr& service, const core::dbus::Object::Ptr& object, const std::shared_ptr<biometry::Service>& impl);
63
std::shared_ptr<biometry::Service> impl_;
64
core::dbus::Bus::Ptr bus_;
65
core::dbus::Service::Ptr service_;
66
core::dbus::Object::Ptr object_;
68
util::Once<std::shared_ptr<Device>> default_device_;
74
#endif // BIOMETRYD_DBUS_SKELETON_SERVICE_H_