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 
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_
core::Property< Update< Position > > position
Updates for position measurements.
Definition: interface.h:80
core::Property< Update< Velocity > > velocity
Updates for velocity measurements.
Definition: interface.h:98
virtual Updates & updates()
Provides access to the updates delivered for this session.
core::Property< Status > heading_status
Status of position updates, mutable.
Definition: interface.h:93
Updates are disabled and not delivered to this session.
STL namespace.
Definition: accuracy.h:23
core::Property< Status > velocity_status
Status of velocity updates, mutable.
Definition: interface.h:102
Models a session with the location service.
Definition: interface.h:42
Updates are enabled and delivered to this session.
core::Property< Update< Heading > > heading
Updates for the heading measurements.
Definition: interface.h:89
Encapsulates updates provided for this session, and the ability to enable/disable updates...
Definition: interface.h:66
core::Property< Status > position_status
Status of position updates, mutable.
Definition: interface.h:84
Status
The Status enum models the possible states of updates.
Definition: interface.h:71