~thomas-voss/biometryd/remove-obsolete-configuration-header

« back to all changes in this revision

Viewing changes to src/biometry/dbus/skeleton/service.h

  • Committer: Thomas Voß
  • Date: 2016-05-02 06:16:01 UTC
  • Revision ID: thomas.voss@canonical.com-20160502061601-vqzwfw4c0rxfna04
Initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical, Ltd.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 *
 
16
 * Authored by: Thomas Voß <thomas.voss@canonical.com>
 
17
 *
 
18
 */
 
19
 
 
20
#ifndef BIOMETRYD_DBUS_SKELETON_SERVICE_H_
 
21
#define BIOMETRYD_DBUS_SKELETON_SERVICE_H_
 
22
 
 
23
#include <biometry/service.h>
 
24
#include <biometry/visibility.h>
 
25
 
 
26
#include <biometry/dbus/skeleton/device.h>
 
27
 
 
28
#include <util/once.h>
 
29
 
 
30
#include <core/dbus/object.h>
 
31
#include <core/dbus/service.h>
 
32
 
 
33
namespace biometry
 
34
{
 
35
namespace dbus
 
36
{
 
37
namespace skeleton
 
38
{
 
39
/// @cond
 
40
class Device;
 
41
/// @endcond
 
42
 
 
43
// Service is the dbus SKELETON implementation of biometry::Service.
 
44
class BIOMETRY_DLL_PUBLIC Service : public biometry::Service
 
45
{
 
46
public:
 
47
    // Safe us some typing.
 
48
    typedef std::shared_ptr<Service> Ptr;
 
49
 
 
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_);
 
52
 
 
53
    /// @brief Frees up resources and removes routes to message handlers.
 
54
    ~Service();
 
55
 
 
56
    // From biometry::Service.
 
57
    std::shared_ptr<biometry::Device> default_device() const override;
 
58
 
 
59
private:
 
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);
 
62
 
 
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_;
 
67
 
 
68
    util::Once<std::shared_ptr<Device>> default_device_;
 
69
};
 
70
}
 
71
}
 
72
}
 
73
 
 
74
#endif // BIOMETRYD_DBUS_SKELETON_SERVICE_H_