Ocean
Loading...
Searching...
No Matches
IOSDevice.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_IOS_IOS_DEVICE_H
9#define META_OCEAN_DEVICES_IOS_IOS_DEVICE_H
10
12
14
15namespace Ocean
16{
17
18namespace Devices
19{
20
21namespace IOS
22{
23
24/**
25 * This class implements a device for the IOS library.
26 * @ingroup devicesios
27 */
28class OCEAN_DEVICES_IOS_EXPORT IOSDevice : virtual public Device
29{
30 public:
31
32 /**
33 * Returns the name of the owner library.
34 * @see Device::library().
35 */
36 const std::string& library() const override;
37
38 /**
39 * Returns whether this device is active.
40 * @see Device::isStarted().
41 */
42 bool isStarted() const override;
43
44 protected:
45
46 /**
47 * Creates a new device by is name.
48 * @param name The name of the device
49 * @param type Major and minor device type of the device
50 */
51 IOSDevice(const std::string& name, const DeviceType type);
52
53 /**
54 * Returns the relative and unix timestamp of an Android sensor event.
55 * @param cmLogItemTimestamp The timestamp of the base class for all motion-related data objects, in seconds since the device booted
56 * @param relativeTimestamp The resulting relative timestamp
57 * @return The resulting unix timestamp
58 */
59 Timestamp convertTimestamp(const double cmLogItemTimestamp, Timestamp& relativeTimestamp);
60
61 /**
62 * Returns the timestamp converter for all android sensors.
63 * @return The timestamp converter
64 */
66
67 protected:
68
69 /// True, if this sensor is started.
70 bool isStarted_ = false;
71
72 /// The timestamp converter of this sensor.
74};
75
76}
77
78}
79
80}
81
82#endif // META_OCEAN_DEVICES_IOS_IOS_DEVICE_H
Definition of a class holding the major and minor device type.
Definition devices/Device.h:62
This class is the base class for all devices of any type.
Definition devices/Device.h:28
This class implements a device for the IOS library.
Definition IOSDevice.h:29
TimestampConverter & timestampConverter_
The timestamp converter of this sensor.
Definition IOSDevice.h:73
Timestamp convertTimestamp(const double cmLogItemTimestamp, Timestamp &relativeTimestamp)
Returns the relative and unix timestamp of an Android sensor event.
IOSDevice(const std::string &name, const DeviceType type)
Creates a new device by is name.
bool isStarted() const override
Returns whether this device is active.
static TimestampConverter & timestampConverter()
Returns the timestamp converter for all android sensors.
const std::string & library() const override
Returns the name of the owner library.
This class is a helper class allowing to converter timestamps defined in a specific time domain to un...
Definition Timestamp.h:313
This class implements a timestamp.
Definition Timestamp.h:64
The namespace covering the entire Ocean framework.
Definition Accessor.h:15