Ocean
Loading...
Searching...
No Matches
AndroidGPSTracker.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_DEVICES_ANDROID_ANDROID_GPS_TRACKER_H
9#define META_OCEAN_DEVICES_ANDROID_ANDROID_GPS_TRACKER_H
10
13
15
16namespace Ocean
17{
18
19namespace Devices
20{
21
22namespace Android
23{
24
25/**
26 * This class implements a GPS tracker.
27 * The NDK does not have access to location services, so that the information needs to be provided from the Java side.
28 * @ingroup devicesandroid
29 */
30class OCEAN_DEVICES_EXPORT AndroidGPSTracker :
31 virtual public GPSTracker,
32 virtual public AndroidDevice
33{
34 friend class AndroidFactory;
35
36 public:
37
38 /**
39 * Returns the name of this tracker.
40 * @return The sensor's name
41 */
42 static inline std::string deviceNameAndroidGPSTracker();
43
44 /**
45 * Returns the device type of this tracker.
46 * @return The sensor's device type
47 */
49
50 protected:
51
52 /**
53 * Creates a new GPS tracker.
54 */
56
57 /**
58 * Destructs a GPS tracker.
59 */
61
62 /**
63 * Sets a new GPS location for this tracker.
64 * @param location The GPS location to be set
65 * @param timestamp The timestamp of the GPS location, must be valid
66 **/
67 void newGPSLocation(const Location& location, const Timestamp& timestamp);
68
69 protected:
70
71 /// The timestamp of the last sample.
73
74 /// The unique id for the world object.
76};
77
79{
80 return std::string("Android GPS Tracker");
81}
82
87
88}
89
90}
91
92}
93
94#endif // META_OCEAN_DEVICES_ANDROID_ANDROID_GPS_TRACKER_H
AndroidDevice(const std::string &name, const DeviceType type)
Creates a new device by is name.
friend class AndroidFactory
Definition AndroidGPSTracker.h:34
Timestamp lastTimestamp_
The timestamp of the last sample.
Definition AndroidGPSTracker.h:72
~AndroidGPSTracker() override
Destructs a GPS tracker.
AndroidGPSTracker()
Creates a new GPS tracker.
void newGPSLocation(const Location &location, const Timestamp &timestamp)
Sets a new GPS location for this tracker.
static DeviceType deviceTypeAndroidGPSTracker()
Returns the device type of this tracker.
Definition AndroidGPSTracker.h:83
static std::string deviceNameAndroidGPSTracker()
Returns the name of this tracker.
Definition AndroidGPSTracker.h:78
ObjectId gpsObjectId_
The unique id for the world object.
Definition AndroidGPSTracker.h:75
Definition of a class holding the major and minor device type.
Definition devices/Device.h:62
This class implements a container for a GPS location.
Definition GPSTracker.h:46
GPSTracker(const std::string &name)
Creates a new GPS tracker object.
static DeviceType deviceTypeGPSTracker()
Returns the device type of this tracker.
Definition GPSTracker.h:362
static constexpr ObjectId invalidObjectId()
Returns an invalid object id.
Definition Measurement.h:631
uint32_t ObjectId
Definition of an object id.
Definition Measurement.h:47
This class implements a timestamp.
Definition Timestamp.h:64
Namespace of the Devices Android library.
Definition devices/android/Android.h:20
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15