Ocean
Loading...
Searching...
No Matches
Measurement.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_MEASUREMENT_H
9#define META_OCEAN_DEVICES_MEASUREMENT_H
10
13
14#include "ocean/base/Callback.h"
16#include "ocean/base/Value.h"
17
18namespace Ocean
19{
20
21namespace Devices
22{
23
24// Forward declaration.
25class Measurement;
26
27/**
28 * Definition of a smart object reference for a measurement.
29 * @see Measurement.
30 * @ingroup devices
31 */
33
34/**
35 * This class implements the base class for all devices providing measurement samples.
36 * Each measurement holds a container holding several most recent samples provided by the device.<br>
37 * Thus, depending on the number of stored samples a specific sample can be requested.<br>
38 * @ingroup devices
39 */
40class OCEAN_DEVICES_EXPORT Measurement : virtual public Device
41{
42 public:
43
44 /**
45 * Definition of an object id.
46 */
47 using ObjectId = uint32_t;
48
49 /**
50 * Definition of a vector holding object ids.
51 */
53
54 /**
55 * Definition of an unordered set holding object ids.
56 */
57 using ObjectIdSet = std::unordered_set<ObjectId>;
58
59 /**
60 * Definition of an unordered map mapping keys to values.
61 */
62 using Metadata = std::unordered_map<std::string, Value>;
63
64 /**
65 * Definition of a sample holding a measurement.
66 */
67 class OCEAN_DEVICES_EXPORT Sample
68 {
69 friend class ObjectRef<Sample>;
70
71 public:
72
73 /**
74 * Returns the sample timestamp.
75 * @return The sample's timestamp
76 */
77 inline const Timestamp& timestamp() const;
78
79 /**
80 * Returns the relative timestamp of this sample.
81 * @return The sample's relative timestamp
82 */
83 inline const Timestamp& relativeTimestamp() const;
84
85 /**
86 * Returns the sample object ids specifying possible different measurement units.
87 * @return Object ids
88 */
89 inline const ObjectIds& objectIds() const;
90
91 /**
92 * Returns the metadata of this sample.
93 * @return The sample's meta data
94 */
95 inline const Metadata& metadata() const;
96
97 /**
98 * Sets the relative timestamp of this sample.
99 * @param relativeTimestamp The sample's relative timestamp to set, must be valid
100 */
101 inline void setRelativeTimestamp(const Timestamp& relativeTimestamp);
102
103 protected:
104
105 /**
106 * Creates a new measurement sample.
107 * @param timestamp Sample timestamp
108 * @param objectIds Object ids corresponding to different measurement units of one tracker
109 * @param metadata Optional metadata of the new sample
110 */
111 Sample(const Timestamp& timestamp, const ObjectIds& objectIds, const Metadata& metadata = Metadata());
112
113 /**
114 * Creates a new measurement sample.
115 * @param timestamp Sample timestamp
116 * @param objectIds Object ids corresponding to different measurement units of one tracker
117 * @param metadata Optional metadata of the new sample
118 */
119 Sample(const Timestamp& timestamp, ObjectIds&& objectIds, Metadata&& metadata = Metadata());
120
121 /**
122 * Destructs a sample.
123 */
124 virtual ~Sample();
125
126 protected:
127
128 /// The sample timestamp.
130
131 /// The relative sample timestamp.
133
134 /// Measurement unit object ids.
136
137 /// The metadata of this sample.
139 };
140
141 /**
142 * Definition of an object reference for samples.
143 */
145
146 /**
147 * Definition of a callback function to subscribe for new measurement sample events.
148 * The first parameter is the Measurement object sending the sample
149 * The second parameter is the sample
150 */
152
153 /**
154 * Definition of individual interpolation strategies for samples.
155 */
157 {
158 /// An invalid strategy.
160 /// The sample with nearest/closest timestamp is used.
162 /// The sample is interpolated based on two samples.
163 IS_TIMESTAMP_INTERPOLATE
164 };
165
166 /**
167 * This class manages the lifetime of an event subscription for sample events.
168 */
169 class OCEAN_DEVICES_EXPORT SampleEventSubscription
170 {
171 friend class Measurement;
172
173 public:
174
175 /**
176 * Default constructor for a not active subscription.
177 */
179
180 /**
181 * Move constructor.
182 * @param sampleEventSubscription The object to be moved
183 */
184 inline SampleEventSubscription(SampleEventSubscription&& sampleEventSubscription);
185
186 /**
187 * Destructs the subscription object and unsubscribes the object event.
188 */
190
191 /**
192 * Makes this subscription object weak so that is does not hold a reference to the actual measurement object.
193 */
194 inline void makeWeak();
195
196 /**
197 * Explicitly releases the subscription.
198 */
199 void release();
200
201 /**
202 * Returns whether this subscription object holds an active subscription.
203 * @return True, if so
204 */
205 explicit inline operator bool() const;
206
207 /**
208 * Replaces the current event subscription with a new event subscription.
209 * @param sampleEventSubscription The subscription object to assign
210 * @return Reference to this object
211 */
213
214 protected:
215
216 /**
217 * Creates an active subscription object.
218 * @param measurement The measurement object to which the event subscription belongs
219 * @param subscriptionId The subscription id of the event, must be valid
220 */
221 SampleEventSubscription(const Measurement& measurement, const SubscriptionId subscriptionId);
222
223 /**
224 * Disabled assign operator.
225 * @param sampleEventSubscription The subscription object to assign
226 * @return Reference to this object
227 */
228 SampleEventSubscription& operator=(const SampleEventSubscription& sampleEventSubscription) = delete;
229
230 protected:
231
232 /// The measurement object to which the event subscription belongs.
234
235 /// The pointer to the measurement object to which the event subscription belongs.
236 Measurement* weakMeasurement_ = nullptr;
237
238 /// The subscription id.
239 SubscriptionId subscriptionId_ = invalidSubscriptionId();
240 };
241
242 protected:
243
244 /**
245 * Definition of a map holding the most recent samples
246 */
247 using SampleMap = std::map<Timestamp, SampleRef>;
248
249 /**
250 * This class implements a helper class to simplify the mapping between internal object ids (of the actual tracking implementation) and extern object ids (of the device system).
251 * @tparam TInternalId The data type of the internal object id.
252 */
253 template <typename TInternalId>
255 {
256 protected:
257
258 /**
259 * Definition of an unordered map mapping internal object ids to external object ids.
260 */
261 using InternalObjectIdMap = std::unordered_map<TInternalId, ObjectId>;
262
263 /**
264 * Definition of an unordered map mapping external object ids to internal object ids.
265 */
266 using ExternalObjectIdMap = std::unordered_map<ObjectId, TInternalId>;
267
268 public:
269
270 /**
271 * Default constructor.
272 */
273 explicit inline ObjectMapper(Measurement& owner);
274
275 /**
276 * Returns whether this mapping object holds a specific internal object.
277 * @param internalObjectId The id of the internal object to be checked
278 * @return True, if so
279 */
280 bool hasInternalObject(const TInternalId& internalObjectId) const;
281
282 /**
283 * Returns whether this mapping object holds a specific external object.
284 * @param externalObjectId The id of the external object to be checked, must be valid
285 * @return True, if so
286 */
287 bool hasExternalObject(const Measurement::ObjectId& externalObjectId) const;
288
289 /**
290 * Adds a new internal pattern id.
291 * @param internalObjectId The new internal object id to add
292 * @param description The description of the new pattern
293 * @return The corresponding external object id
294 */
295 ObjectId newInternalObjectId(const TInternalId& internalObjectId, const std::string& description);
296
297 /**
298 * Removes a mapping between internal and external object.
299 * @param internalObjectId The id of the internal object for which the mapping will be removed
300 */
301 void removeInternalObject(const TInternalId& internalObjectId);
302
303 /**
304 * Converts the tracker's internal object id to an external object id.
305 * @param internalObjectId The internal object id to translate
306 * @return The resulting external object id
307 */
308 ObjectId externalObjectIdFromInternalObjectId(const TInternalId& internalObjectId) const;
309
310 /**
311 * Converts an external object id to the tracker tracker's internal object id.
312 * @param externalObjectId The external object id to translate
313 * @param invalidInternalId An invalid internal id
314 * @return The resulting internal object id
315 */
316 TInternalId internalObjectIdFromExternalObjectId(const ObjectId externalObjectId, const TInternalId& invalidInternalId) const;
317
318 protected:
319
320 /**
321 * Disabled copy constructor.
322 * @param objectMapper Object which would be copied
323 */
324 ObjectMapper(const ObjectMapper& objectMapper) = delete;
325
326 /**
327 * Disabled copy operator.
328 * @param objectMapper Object which would be copied
329 * @return Reference to this object
330 */
331 ObjectMapper& operator=(const ObjectMapper& objectMapper) = delete;
332
333 protected:
334
335 /// The owner of this mapper.
337
338 /// The map mapping internal object ids to external object ids.
340
341 /// The map mapping external object ids to internal object ids.
343 };
344
345 /**
346 * Definition of an unordered map mapping descriptions to unique object ids.
347 */
348 using ObjectDescriptionToIdMap = std::unordered_map<std::string, ObjectId>;
349
350 /**
351 * Definition of an unordered map mapping unique object ids to descriptions.
352 */
353 using ObjectIdToDescriptionMap = std::unordered_map<ObjectId, std::string>;
354
355 /**
356 * Definition of a map mapping subscription ids to event sample callback functions.
357 */
358 using SampleSubscriptionMap = std::unordered_map<SubscriptionId, SampleCallback>;
359
360 public:
361
362 /**
363 * Returns the capacity of the internal sample container.
364 * @return The sample container's capacity, with range [2, infinity)
365 * @see setSampleCapacity().
366 */
367 inline size_t sampleCapacity() const;
368
369 /**
370 * Sets the capacity of the internal sample container.
371 * @param capacity The number maximal number of samples to be stored, with range [2, infinity)
372 * @return True, if succeeded
373 */
374 bool setSampleCapacity(const size_t capacity);
375
376 /**
377 * Returns the most recent sample.
378 * @return Most recent sample as object reference
379 */
380 virtual SampleRef sample() const;
381
382 /**
383 * Returns the sample with a specific timestamp.
384 * If no sample exists with the given timestamp the most recent sample is returned.
385 * @param timestamp The timestamp of the sample to be returned
386 * @return Requested sample
387 */
388 virtual SampleRef sample(const Timestamp timestamp) const;
389
390 /**
391 * Returns the sample best matching with a specified timestamp.
392 * In case, the given timestamp does not fit to an existing sample, the resulting sample will be based on the specified interpolation strategy.
393 * @param timestamp The timestamp for which a sample will be determined, must be valid
394 * @param interpolationStrategy The interpolation strategy to be applied in case the timestamp does not fit with an existing sample
395 * @return The resulting sample, invalid if no sample could be determined
396 */
397 virtual SampleRef sample(const Timestamp& timestamp, const InterpolationStrategy interpolationStrategy) const;
398
399 /**
400 * Subscribes a callback event function for new measurement sample events.
401 * Do not subscribe or unsubscribe from inside an event thread.
402 * @param callback The callback function receiving the event calls, must be valid
403 * @return The resulting subscription object, dispose the object to unsubscribe from the event call
404 */
406
407 /**
408 * Returns the object id for an object description.
409 * @param description The description for which the object id will be returned
410 * @return The object id, an invalid id if the description is not known
411 * @see objectDescriptions().
412 */
413 ObjectId objectId(const std::string& description) const;
414
415 /**
416 * Returns descriptions of all objects currently available.
417 * @return All object descriptions
418 * @see objectId().
419 */
421
422 /**
423 * Returns the description of one object of this measurement.
424 * @param objectId The id of the object for which the description will be returned, must be valid
425 * @return The description of the object, empty if the object is unknown
426 */
427 std::string objectDescription(const ObjectId objectId) const;
428
429 /**
430 * Returns an invalid object id.
431 * @return Id of an invalid object
432 */
433 static constexpr ObjectId invalidObjectId();
434
435 protected:
436
437 /**
438 * Creates a new measurement object.
439 * @param name The name of the measurement device
440 * @param type Major and minor device type of the device
441 */
442 Measurement(const std::string& name, const DeviceType type);
443
444 /**
445 * Destructs a measurement object.
446 */
447 ~Measurement() override;
448
449 /**
450 * Posts a new measurement sample.
451 * @param newSample New sample to post
452 */
453 void postNewSample(const SampleRef& newSample);
454
455 /**
456 * Creates a unique object id for a new object (e.g., a tracking object like an image, a marker, or a location).
457 * @param description The description of the new object, must be valid
458 * @return The unique id which is unique across all devices
459 */
460 ObjectId addUniqueObjectId(const std::string& description);
461
462 /**
463 * Unsubscribes a sample event callback function.
464 * @param subscriptionId The id of the event subscription to unsubscribe
465 */
466 void unsubscribeSampleEvent(const SubscriptionId subscriptionId);
467
468 /**
469 * Interpolates between two samples.
470 * This function can be overridden by derived classes to provide type-specific interpolation.
471 * The default implementation returns the lower sample without performing interpolation.
472 * @param lowerSample The sample with the earlier timestamp, must be valid
473 * @param upperSample The sample with the later timestamp, must be valid
474 * @param interpolationFactor The interpolation factor, with range [0, 1]
475 * @param interpolatedTimestamp The timestamp for the interpolated sample
476 * @return The interpolated sample, or the lower sample if interpolation is not supported
477 */
478 virtual SampleRef interpolateSamples(const SampleRef& lowerSample, const SampleRef& upperSample, const double interpolationFactor, const Timestamp& interpolatedTimestamp) const;
479
480 protected:
481
482 /// Sample lock.
484
485 /// Subscription lock.
487
488 private:
489
490 /// The most recent measurement samples.
492
493 /// The maximal number of samples this measurement object can hold.
494 size_t sampleCapacity_ = 200;
495
496 /// Map holding all sample event subscriptions.
498
499 /// The subscription id of the next event subscription.
500 SubscriptionId nextSampleSubscriptionId_ = SubscriptionId(invalidSubscriptionId() + 1u);
501
502 /// The map mapping object descriptions to object ids.
504
505 /// The map mapping object ids to descriptions.
507};
508
510{
511 return timestamp_;
512}
513
515{
516 return relativeTimestamp_;
517}
518
520{
521 return objectIds_;
522}
523
525{
526 return metadata_;
527}
528
529inline void Measurement::Sample::setRelativeTimestamp(const Timestamp& relativeTimestamp)
530{
531 ocean_assert(!relativeTimestamp_.isValid());
532 relativeTimestamp_ = relativeTimestamp;
533}
534
535template <typename TInternalId>
537 owner_(owner)
538{
539 // nothing to do here
540}
541
542template <typename TInternalId>
543bool Measurement::ObjectMapper<TInternalId>::hasInternalObject(const TInternalId& internalObjectId) const
544{
545 return internalObjectIdMap_.find(internalObjectId) != internalObjectIdMap_.cend();
546}
547
548template <typename TInternalId>
550{
551 ocean_assert(externalObjectId != invalidObjectId());
552
553 return externalObjectIdMap_.find(externalObjectId) != externalObjectIdMap_.cend();
554}
555
556template <typename TInternalId>
557Measurement::ObjectId Measurement::ObjectMapper<TInternalId>::newInternalObjectId(const TInternalId& internalObjectId, const std::string& description)
558{
559 const ObjectId externalObjectId = owner_.addUniqueObjectId(description);
560
561 internalObjectIdMap_.emplace(internalObjectId, externalObjectId);
562 externalObjectIdMap_.emplace(externalObjectId, internalObjectId);
563
564 return externalObjectId;
565}
566
567template <typename TInternalId>
569{
570 const ObjectId externalObjectId = externalObjectIdFromInternalObjectId(internalObjectId);
571
572 internalObjectIdMap_.erase(internalObjectId);
573 externalObjectIdMap_.erase(externalObjectId);
574}
575
576template <typename TInternalId>
578{
579 const typename InternalObjectIdMap::const_iterator i = internalObjectIdMap_.find(internalObjectId);
580
581 if (i == internalObjectIdMap_.cend())
582 {
583 ocean_assert(false && "This must never happen!");
584 return invalidObjectId();
585 }
586
587 return i->second;
588}
589
590template <typename TInternalId>
591TInternalId Measurement::ObjectMapper<TInternalId>::internalObjectIdFromExternalObjectId(const ObjectId externalObjectId, const TInternalId& invalidInternalId) const
592{
593 const typename ExternalObjectIdMap::const_iterator i = externalObjectIdMap_.find(externalObjectId);
594
595 if (i == externalObjectIdMap_.cend())
596 {
597 ocean_assert(false && "This must never happen!");
598 return invalidInternalId;
599 }
600
601 return i->second;
602}
603
605{
606 *this = std::move(sampleEventSubscription);
607}
608
613
615{
616 measurement_.release();
617}
618
619inline Measurement::SampleEventSubscription::operator bool() const
620{
621 return weakMeasurement_ != nullptr;
622}
623
624inline size_t Measurement::sampleCapacity() const
625{
626 const ScopedLock scopedLock(samplesLock_);
627
628 return sampleCapacity_;
629}
630
632{
633 return ObjectId(-1);
634}
635
636}
637
638}
639
640#endif // META_OCEAN_DEVICES_MEASUREMENT_H
This class implements a container for callback functions.
Definition Callback.h:3454
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
unsigned int SubscriptionId
Definition of a subscription id for event callbacks.
Definition devices/Device.h:151
This class implements a helper class to simplify the mapping between internal object ids (of the actu...
Definition Measurement.h:255
InternalObjectIdMap internalObjectIdMap_
The map mapping internal object ids to external object ids.
Definition Measurement.h:339
ObjectMapper & operator=(const ObjectMapper &objectMapper)=delete
Disabled copy operator.
ObjectId newInternalObjectId(const TInternalId &internalObjectId, const std::string &description)
Adds a new internal pattern id.
Definition Measurement.h:557
bool hasExternalObject(const Measurement::ObjectId &externalObjectId) const
Returns whether this mapping object holds a specific external object.
Definition Measurement.h:549
ObjectMapper(Measurement &owner)
Default constructor.
Definition Measurement.h:536
std::unordered_map< TInternalId, ObjectId > InternalObjectIdMap
Definition of an unordered map mapping internal object ids to external object ids.
Definition Measurement.h:261
ObjectMapper(const ObjectMapper &objectMapper)=delete
Disabled copy constructor.
bool hasInternalObject(const TInternalId &internalObjectId) const
Returns whether this mapping object holds a specific internal object.
Definition Measurement.h:543
ObjectId externalObjectIdFromInternalObjectId(const TInternalId &internalObjectId) const
Converts the tracker's internal object id to an external object id.
Definition Measurement.h:577
TInternalId internalObjectIdFromExternalObjectId(const ObjectId externalObjectId, const TInternalId &invalidInternalId) const
Converts an external object id to the tracker tracker's internal object id.
Definition Measurement.h:591
ExternalObjectIdMap externalObjectIdMap_
The map mapping external object ids to internal object ids.
Definition Measurement.h:342
void removeInternalObject(const TInternalId &internalObjectId)
Removes a mapping between internal and external object.
Definition Measurement.h:568
std::unordered_map< ObjectId, TInternalId > ExternalObjectIdMap
Definition of an unordered map mapping external object ids to internal object ids.
Definition Measurement.h:266
Measurement & owner_
The owner of this mapper.
Definition Measurement.h:336
This class manages the lifetime of an event subscription for sample events.
Definition Measurement.h:170
SampleEventSubscription & operator=(const SampleEventSubscription &sampleEventSubscription)=delete
Disabled assign operator.
void release()
Explicitly releases the subscription.
SampleEventSubscription & operator=(SampleEventSubscription &&sampleEventSubscription)
Replaces the current event subscription with a new event subscription.
void makeWeak()
Makes this subscription object weak so that is does not hold a reference to the actual measurement ob...
Definition Measurement.h:614
~SampleEventSubscription()
Destructs the subscription object and unsubscribes the object event.
Definition Measurement.h:609
MeasurementRef measurement_
The measurement object to which the event subscription belongs.
Definition Measurement.h:233
SampleEventSubscription()=default
Default constructor for a not active subscription.
SampleEventSubscription(const Measurement &measurement, const SubscriptionId subscriptionId)
Creates an active subscription object.
Definition of a sample holding a measurement.
Definition Measurement.h:68
virtual ~Sample()
Destructs a sample.
const ObjectIds & objectIds() const
Returns the sample object ids specifying possible different measurement units.
Definition Measurement.h:519
Timestamp relativeTimestamp_
The relative sample timestamp.
Definition Measurement.h:132
ObjectIds objectIds_
Measurement unit object ids.
Definition Measurement.h:135
Metadata metadata_
The metadata of this sample.
Definition Measurement.h:138
void setRelativeTimestamp(const Timestamp &relativeTimestamp)
Sets the relative timestamp of this sample.
Definition Measurement.h:529
const Timestamp & relativeTimestamp() const
Returns the relative timestamp of this sample.
Definition Measurement.h:514
const Metadata & metadata() const
Returns the metadata of this sample.
Definition Measurement.h:524
Sample(const Timestamp &timestamp, ObjectIds &&objectIds, Metadata &&metadata=Metadata())
Creates a new measurement sample.
const Timestamp & timestamp() const
Returns the sample timestamp.
Definition Measurement.h:509
Sample(const Timestamp &timestamp, const ObjectIds &objectIds, const Metadata &metadata=Metadata())
Creates a new measurement sample.
Timestamp timestamp_
The sample timestamp.
Definition Measurement.h:129
This class implements the base class for all devices providing measurement samples.
Definition Measurement.h:41
ObjectId objectId(const std::string &description) const
Returns the object id for an object description.
SampleEventSubscription subscribeSampleEvent(SampleCallback &&callback)
Subscribes a callback event function for new measurement sample events.
void postNewSample(const SampleRef &newSample)
Posts a new measurement sample.
virtual SampleRef sample() const
Returns the most recent sample.
static constexpr ObjectId invalidObjectId()
Returns an invalid object id.
Definition Measurement.h:631
Strings objectDescriptions() const
Returns descriptions of all objects currently available.
ObjectId addUniqueObjectId(const std::string &description)
Creates a unique object id for a new object (e.g., a tracking object like an image,...
SampleSubscriptionMap sampleSubscriptionMap_
Map holding all sample event subscriptions.
Definition Measurement.h:497
std::unordered_map< SubscriptionId, SampleCallback > SampleSubscriptionMap
Definition of a map mapping subscription ids to event sample callback functions.
Definition Measurement.h:358
virtual SampleRef sample(const Timestamp timestamp) const
Returns the sample with a specific timestamp.
std::unordered_set< ObjectId > ObjectIdSet
Definition of an unordered set holding object ids.
Definition Measurement.h:57
virtual SampleRef interpolateSamples(const SampleRef &lowerSample, const SampleRef &upperSample, const double interpolationFactor, const Timestamp &interpolatedTimestamp) const
Interpolates between two samples.
SampleMap sampleMap_
The most recent measurement samples.
Definition Measurement.h:491
InterpolationStrategy
Definition of individual interpolation strategies for samples.
Definition Measurement.h:157
@ IS_INVALID
An invalid strategy.
Definition Measurement.h:159
@ IS_TIMESTAMP_NEAREST
The sample with nearest/closest timestamp is used.
Definition Measurement.h:161
virtual SampleRef sample(const Timestamp &timestamp, const InterpolationStrategy interpolationStrategy) const
Returns the sample best matching with a specified timestamp.
std::unordered_map< std::string, ObjectId > ObjectDescriptionToIdMap
Definition of an unordered map mapping descriptions to unique object ids.
Definition Measurement.h:348
size_t sampleCapacity() const
Returns the capacity of the internal sample container.
Definition Measurement.h:624
std::unordered_map< ObjectId, std::string > ObjectIdToDescriptionMap
Definition of an unordered map mapping unique object ids to descriptions.
Definition Measurement.h:353
ObjectDescriptionToIdMap objectDescriptionToIdMap_
The map mapping object descriptions to object ids.
Definition Measurement.h:503
Lock samplesLock_
Sample lock.
Definition Measurement.h:483
void unsubscribeSampleEvent(const SubscriptionId subscriptionId)
Unsubscribes a sample event callback function.
size_t sampleCapacity_
The maximal number of samples this measurement object can hold.
Definition Measurement.h:494
uint32_t ObjectId
Definition of an object id.
Definition Measurement.h:47
~Measurement() override
Destructs a measurement object.
bool setSampleCapacity(const size_t capacity)
Sets the capacity of the internal sample container.
std::unordered_map< std::string, Value > Metadata
Definition of an unordered map mapping keys to values.
Definition Measurement.h:62
std::string objectDescription(const ObjectId objectId) const
Returns the description of one object of this measurement.
ObjectIdToDescriptionMap objectIdToDescriptionMap_
The map mapping object ids to descriptions.
Definition Measurement.h:506
Measurement(const std::string &name, const DeviceType type)
Creates a new measurement object.
Lock subscriptionLock_
Subscription lock.
Definition Measurement.h:486
std::map< Timestamp, SampleRef > SampleMap
Definition of a map holding the most recent samples.
Definition Measurement.h:247
This class implements a recursive lock object.
Definition Lock.h:31
This template class implements a object reference with an internal reference counter.
Definition base/ObjectRef.h:58
This class implements a scoped lock object for recursive lock objects.
Definition Lock.h:147
This class implements a timestamp.
Definition Timestamp.h:63
std::vector< std::string > Strings
Definition of a vector holding strings.
Definition Base.h:162
The namespace covering the entire Ocean framework.
Definition Accessor.h:15