2
* Copyright © 2016 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>
18
#ifndef LOCATION_SERVICE_WITH_ENGINE_H_
19
#define LOCATION_SERVICE_WITH_ENGINE_H_
21
#include <location/engine.h>
22
#include <location/service.h>
26
class ServiceWithEngine : public Service
29
ServiceWithEngine(const Engine::Ptr& engine);
32
const core::Property<State>& state() const override;
33
core::Property<bool>& does_satellite_based_positioning() override;
34
core::Property<bool>& is_online() override;
35
core::Property<bool>& does_report_cell_and_wifi_ids() override;
36
core::Property<std::map<SpaceVehicle::Key, SpaceVehicle>>& visible_space_vehicles() override;
37
Session::Ptr create_session_for_criteria(const Criteria& criteria) override;
40
Engine::Ptr engine; // The engine instance we use for positioning.
42
// Properties of the service implementation.
43
core::Property<State> state_;
44
core::Property<bool> does_satellite_based_positioning_;
45
core::Property<bool> is_online_;
46
core::Property<bool> does_report_cell_and_wifi_ids_;
47
core::Property<std::map<SpaceVehicle::Key, SpaceVehicle>> visible_space_vehicles_;
51
core::ScopedConnection is_online;
52
core::ScopedConnection does_report_cell_and_wifi_ids;
53
core::ScopedConnection does_satellite_based_positioning;
54
core::ScopedConnection engine_state;
55
core::ScopedConnection satellite_based_positioning_state;
56
core::ScopedConnection visible_space_vehicles;
57
} connections; // All event connections are automatically cut on destruction.
61
#endif // LOCATION_SERVICE_WITH_ENGINE_H_