Ocean
Loading...
Searching...
No Matches
SerializationSensor.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_SERIALIZATION_SERIALIZATION_SENSOR_H
9#define META_OCEAN_DEVICES_SERIALIZATION_SERIALIZATION_SENSOR_H
10
12
14
15namespace Ocean
16{
17
18namespace Devices
19{
20
21namespace Serialization
22{
23
24// Forward declaration.
25class SerializationSensor;
26
27/**
28 * Definition of a smart object reference for a Serialization sensor.
29 * @see SerializationSensor.
30 * @ingroup devicesserialization
31 */
33
34/**
35 * This class implements a Serialization sensor.
36 * @ingroup devicesserialization
37 */
38class OCEAN_DEVICES_SERIALIZATION_EXPORT SerializationSensor : virtual public Sensor
39{
41
42 public:
43
44 /**
45 * Returns whether this device is active.
46 * @see Devices::isStarted().
47 */
48 bool isStarted() const override;
49
50 /**
51 * Starts the device.
52 * @see Device::start().
53 */
54 bool start() override;
55
56 /**
57 * Stops the device.
58 * @see Device::stop().
59 */
60 bool stop() override;
61
62 /**
63 * Returns the name of the owner library.
64 * @see Device::library().
65 */
66 const std::string& library() const override;
67
68 protected:
69
70 /**
71 * Creates a new sensor object.
72 * @param name The name of the sensor
73 * @param type Major and minor device type of the device
74 */
75 SerializationSensor(const std::string& name, const DeviceType& type);
76
77 /**
78 * Destructs a new Serialization sensor object.
79 */
81
82 protected:
83
84 /// True, if the sensor is started.
85 bool isStarted_ = false;
86
87 /// The name of the library of this device.
88 std::string library_;
89};
90
91}
92
93}
94
95}
96
97#endif // META_OCEAN_DEVICES_SERIALIZATION_SERIALIZATION_SENSOR_H
Definition of a class holding the major and minor device type.
Definition devices/Device.h:62
This class implements the base class for all sensors.
Definition Sensor.h:36
This class implements a device factory for the Serialization library.
Definition SerializationFactory.h:29
This class implements a Serialization sensor.
Definition SerializationSensor.h:39
SerializationSensor(const std::string &name, const DeviceType &type)
Creates a new sensor object.
const std::string & library() const override
Returns the name of the owner library.
bool start() override
Starts the device.
~SerializationSensor() override
Destructs a new Serialization sensor object.
bool isStarted() const override
Returns whether this device is active.
std::string library_
The name of the library of this device.
Definition SerializationSensor.h:88
This class implements a smart device reference.
Definition DeviceRef.h:36
The namespace covering the entire Ocean framework.
Definition Accessor.h:15