Ocean
Loading...
Searching...
No Matches
SerializationTracker.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_TRACKER_H
9#define META_OCEAN_DEVICES_SERIALIZATION_SERIALIZATION_TRACKER_H
10
12
14
15namespace Ocean
16{
17
18namespace Devices
19{
20
21namespace Serialization
22{
23
24// Forward declaration.
25class SerializationTracker;
26
27/**
28 * Definition of a smart object reference for a Serialization tracker.
29 * @see SerializationTracker.
30 * @ingroup devicesserialization
31 */
33
34/**
35 * This class implements a Serialization tracker.
36 * @ingroup devicesserialization
37 */
38class OCEAN_DEVICES_SERIALIZATION_EXPORT SerializationTracker : virtual public Tracker
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 /**
69 * Returns whether a specific object is currently actively tracked by this tracker.
70 * @see Tracker::isObjectTracked().
71 */
72 bool isObjectTracked(const ObjectId& objectId) const override;
73
74 protected:
75
76 /**
77 * Creates a new tracker object.
78 * @param name The name of the tracker
79 * @param type Major and minor device type of the device
80 */
81 SerializationTracker(const std::string& name, const DeviceType& type);
82
83 /**
84 * Destructs a new Serialization tracker object.
85 */
87
88 protected:
89
90 /// True, if the tracker is started.
91 bool isStarted_ = false;
92
93 /// The name of the library of this device.
94 std::string library_;
95
96 /// The set of all currently found objects, specified by external object ids.
98};
99
100}
101
102}
103
104}
105
106#endif // META_OCEAN_DEVICES_SERIALIZATION_SERIALIZATION_TRACKER_H
Definition of a class holding the major and minor device type.
Definition devices/Device.h:62
std::unordered_set< ObjectId > ObjectIdSet
Definition of an unordered set holding object ids.
Definition Measurement.h:57
uint32_t ObjectId
Definition of an object id.
Definition Measurement.h:47
This class implements a device factory for the Serialization library.
Definition SerializationFactory.h:29
This class implements a Serialization tracker.
Definition SerializationTracker.h:39
ObjectIdSet currentlyFoundExternalObjectIds_
The set of all currently found objects, specified by external object ids.
Definition SerializationTracker.h:97
bool isStarted() const override
Returns whether this device is active.
std::string library_
The name of the library of this device.
Definition SerializationTracker.h:94
~SerializationTracker() override
Destructs a new Serialization tracker object.
SerializationTracker(const std::string &name, const DeviceType &type)
Creates a new tracker object.
const std::string & library() const override
Returns the name of the owner library.
bool start() override
Starts the device.
bool isObjectTracked(const ObjectId &objectId) const override
Returns whether a specific object is currently actively tracked by this tracker.
This class implements a smart device reference.
Definition DeviceRef.h:36
This class implements the base class for all tracker devices.
Definition devices/Tracker.h:39
The namespace covering the entire Ocean framework.
Definition Accessor.h:15