ubuntu-location-service: /build/location-service-git/src/location-service/include/location_service/com/ubuntu/location/service/session/interface.h Source File

ubuntu-location-service .. An aggregating location service providing positioning and geocoding capabilities to applications.

interface.h
Go to the documentation of this file.
1 /*
2 * Copyright © 2012-2013 Canonical Ltd.
3 *
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.
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 #ifndef LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_INTERFACE_H_
19 #define LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_INTERFACE_H_
20
21 #include <com/ubuntu/location/heading.h>
22 #include <com/ubuntu/location/position.h>
23 #include <com/ubuntu/location/provider.h>
24 #include <com/ubuntu/location/update.h>
25 #include <com/ubuntu/location/velocity.h>
26
27 #include <core/property.h>
28
29 namespace com
30 {
31 namespace ubuntu
32 {
33 namespace location
34 {
35 namespace service
36 {
37 namespace session
38 {
42 class Interface
43 {
44 public:
45 struct UpdatePosition;
46 struct UpdateVelocity;
47 struct UpdateHeading;
48
49 struct StartPositionUpdates;
50 struct StopPositionUpdates;
51
52 struct StartVelocityUpdates;
53 struct StopVelocityUpdates;
54
55 struct StartHeadingUpdates;
56 struct StopHeadingUpdates;
57
58 struct Errors
59 {
60 struct ErrorParsingUpdate;
61 struct ErrorStartingUpdate;
62 };
66 struct Updates
67 {
71 enum class Status
72 {
73 enabled,
74 disabled
75 };
76
80 core::Property<Update<Position>> position{};
84 core::Property<Status> position_status{Status::disabled};
85
89 core::Property<Update<Heading>> heading{};
93 core::Property<Status> heading_status{Status::disabled};
94
98 core::Property<Update<Velocity>> velocity{};
102 core::Property<Status> velocity_status{Status::disabled};
103 };
104
105 typedef std::shared_ptr<Interface> Ptr;
106
107 Interface(const Interface&) = delete;
108 virtual ~Interface() noexcept;
109 Interface& operator=(const Interface&) = delete;
110
115 virtual Updates& updates();
116
117 protected:
118 Interface();
119
120 private:
121 struct Private;
122 std::shared_ptr<Private> d;
123 };
124 }
125 }
126 }
127 }
128 }
129
130 #endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_INTERFACE_H_
com::ubuntu::location::service::session::Interface
Models a session with the location service.
Definition: interface.h:43
com::ubuntu::location::service::session::Interface::updates
virtual Updates & updates()
Provides access to the updates delivered for this session.
com::ubuntu::location::service::session::Interface::Ptr
std::shared_ptr< Interface > Ptr
Definition: interface.h:105
com::ubuntu::location::service::session::Interface::~Interface
virtual ~Interface() noexcept
com::ubuntu::location::service::session::Interface::Interface
Interface(const Interface &)=delete
heading.h
com
Definition: accuracy.h:24
position.h
provider.h
com::ubuntu::location::service::session::Interface::Errors
Definition: interface.h:59
com::ubuntu::location::service::session::Interface::Updates
Encapsulates updates provided for this session, and the ability to enable/disable updates.
Definition: interface.h:67
com::ubuntu::location::service::session::Interface::Updates::position_status
core::Property< Status > position_status
Status of position updates, mutable.
Definition: interface.h:84
com::ubuntu::location::service::session::Interface::Updates::heading
core::Property< Update< Heading > > heading
Updates for the heading measurements.
Definition: interface.h:89
com::ubuntu::location::service::session::Interface::Updates::velocity
core::Property< Update< Velocity > > velocity
Updates for velocity measurements.
Definition: interface.h:98
com::ubuntu::location::service::session::Interface::Updates::velocity_status
core::Property< Status > velocity_status
Status of velocity updates, mutable.
Definition: interface.h:102
com::ubuntu::location::service::session::Interface::Updates::Status
Status
The Status enum models the possible states of updates.
Definition: interface.h:72
com::ubuntu::location::service::session::Interface::Updates::Status::disabled
@ disabled
Updates are disabled and not delivered to this session.
com::ubuntu::location::service::session::Interface::Updates::Status::enabled
@ enabled
Updates are enabled and delivered to this session.
com::ubuntu::location::service::session::Interface::Updates::heading_status
core::Property< Status > heading_status
Status of position updates, mutable.
Definition: interface.h:93
com::ubuntu::location::service::session::Interface::Updates::position
core::Property< Update< Position > > position
Updates for position measurements.
Definition: interface.h:80
update.h
velocity.h