Ocean
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 
16 namespace Ocean
17 {
18 
19 namespace Devices
20 {
21 
22 namespace 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  */
30 class 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  */
48  static inline DeviceType deviceTypeAndroidGPSTracker();
49 
50  protected:
51 
52  /**
53  * Creates a new GPS tracker.
54  */
56 
57  /**
58  * Destructs a GPS tracker.
59  */
60  ~AndroidGPSTracker() override;
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.
75  ObjectId gpsObjectId_ = invalidObjectId();
76 };
77 
79 {
80  return std::string("Android GPS Tracker");
81 }
82 
84 {
85  return deviceTypeGPSTracker();
86 }
87 
88 }
89 
90 }
91 
92 }
93 
94 #endif // META_OCEAN_DEVICES_ANDROID_ANDROID_GPS_TRACKER_H
This class implements a device for the Android library.
Definition: AndroidDevice.h:29
This class implements a device factory for the Android feature based tracking system.
Definition: AndroidFactory.h:31
This class implements a GPS tracker.
Definition: AndroidGPSTracker.h:33
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
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:44
This class is the base class for all gps tracker objects.
Definition: GPSTracker.h:37
static DeviceType deviceTypeGPSTracker()
Returns the device type of this tracker.
Definition: GPSTracker.h:360
unsigned int ObjectId
Definition of an object id.
Definition: Measurement.h:46
This class implements a timestamp.
Definition: Timestamp.h:36
const ObjectId invalidObjectId
Definition of an invalid object id.
Definition: rendering/Rendering.h:65
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15