RTC Toolkit 5.0.0
Loading...
Searching...
No Matches
repositoryIf.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_REPOSITORYIF_HPP
14#define RTCTK_COMPONENTFRAMEWORK_REPOSITORYIF_HPP
15
20#include <rtctk/config.hpp>
21
22#include <taiclock/taiClock.hpp>
23
24// FIXME: Add back when we start using CiiMatrix2D.
25// #include <common/datatypes/ciiMatrix2D.hpp>
26
27#include <gsl/span>
28
29#include <any>
30#include <chrono>
31#include <cstdint>
32#include <exception>
33#include <functional>
34#include <future>
35#include <initializer_list>
36#include <map>
37#include <memory>
38#include <optional>
39#include <type_traits>
40#include <vector>
41
42namespace rtctk {
43
44template <typename T>
45using RtcVector = std::vector<T>;
46
47// FIXME: Switch to using CII type for the matrix when we have ported to DevEnv 6.
48// template <typename T>
49// using RtcMatrix = elt::common::datatypes::CiiMatrix2D<T>;
50template <typename T>
52
53using RtcBool = bool;
54using RtcInt8 = int8_t;
55using RtcInt16 = int16_t;
56using RtcInt32 = int32_t;
57using RtcInt64 = int64_t;
58using RtcUInt8 = uint8_t;
59using RtcUInt16 = uint16_t;
60using RtcUInt32 = uint32_t;
61using RtcUInt64 = uint64_t;
62using RtcFloat = float;
63using RtcDouble = double;
64using RtcString = std::string;
65using RtcBinary = std::vector<std::byte>;
90
91} // namespace rtctk
92
94
105protected:
106 using RequestList = std::vector<std::any>;
107
108public:
109 using PathList = std::vector<DataPointPath>;
110 using Clock = taiclock::TaiClock;
111 using Timestamp = Clock::time_point;
112
114 using CallbackType = std::function<void(const DataPointPath&)>;
115
116 RepositoryIf() = default;
117 virtual ~RepositoryIf() = default;
118
120 using RtctkException::RtctkException;
121 };
122
124 using UnsupportedTypeException::UnsupportedTypeException;
125 };
126
128 using RtctkException::RtctkException;
129 };
130
132 using RtctkException::RtctkException;
133 };
134
136 using RtctkException::RtctkException;
137 };
138
143
145 using RtctkException::RtctkException;
146 };
147
149 using RtctkException::RtctkException;
150 };
151
153 public:
154 enum class Status : uint8_t { Success, Failed, Skipped };
155
156 struct Info {
158 std::exception_ptr exception;
159 };
160
161 MultipleRequestsFailed(const std::vector<Info>& info);
162 const std::vector<Info>& GetInfo() const;
163
164 private:
165 static RTCTK_LOCAL std::string InfoToString(const std::vector<Info>& info);
166 // Note that using shared_ptr makes the exception's copy constructor noexcept.
167 std::shared_ptr<std::vector<Info>> m_info;
168 };
169
195 class RTCTK_API MetaData final {
196 public:
204 public:
205 ConstValueProxy() = delete;
206 ConstValueProxy(const ConstValueProxy& rhs) = default;
208 ~ConstValueProxy() = default;
209
215 inline bool HasValue() const noexcept;
216
221 const std::type_info& GetValueType() const noexcept;
222
227 inline operator const std::any&() const;
228
236 template <typename T>
237 const T& Cast() const;
238
239 private:
240 friend MetaData;
241
242 RTCTK_LOCAL inline ConstValueProxy(const std::string& key, const std::any& value);
243
245 const std::string& m_key;
246
248 const std::any& m_value;
249 };
250
257 class RTCTK_API ValueProxy final {
258 public:
259 ValueProxy() = delete;
260 ValueProxy(const ValueProxy& rhs) = default;
261 ValueProxy(ValueProxy&& rhs) = default;
262 ~ValueProxy() = default;
263
269 inline bool HasValue() const noexcept;
270
275 const std::type_info& GetValueType() const noexcept;
276
281 inline operator const std::any&() const;
282
290 template <typename T>
291 T& Cast();
292
300 template <typename T>
301 const T& Cast() const;
302
310 ValueProxy& operator=(const ValueProxy& rhs);
311
322 template <typename T>
323 ValueProxy& operator=(T&& rhs);
324
330 inline void Reset() noexcept;
331
332 private:
333 friend MetaData;
334
335 RTCTK_LOCAL inline ValueProxy(const std::string& key, std::any& value);
336
338 const std::string& m_key;
339
341 std::any& m_value;
342 };
343
344 private:
345 using MapType = std::map<std::string, std::any>;
346
354 template <typename MapIterType, typename ProxyType>
355 class RTCTK_LOCAL IteratorImpl {
356 public:
357 using iterator_concept = std::bidirectional_iterator_tag;
358 using iterator_category = std::bidirectional_iterator_tag;
359 using value_type = std::pair<const MapType::key_type&, ProxyType>;
360 using difference_type = MapType::difference_type;
361 using pointer = void;
362 using reference = std::conditional_t<std::is_same_v<ProxyType, ConstValueProxy>,
363 const value_type&,
364 value_type&>;
365
366 IteratorImpl() = default;
367 IteratorImpl(const IteratorImpl& rhs) = default;
368 IteratorImpl(IteratorImpl&& rhs) noexcept = default;
369 ~IteratorImpl() = default;
370 IteratorImpl& operator=(const IteratorImpl& rhs) = default;
371 IteratorImpl& operator=(IteratorImpl&& rhs) noexcept = default;
372 value_type& operator*();
373 value_type operator*() const;
374 value_type* operator->();
375 const value_type* operator->() const;
376 IteratorImpl& operator++();
377 IteratorImpl operator++(int);
378 IteratorImpl& operator--();
379 IteratorImpl operator--(int);
380 bool operator==(const IteratorImpl& rhs) const;
381 bool operator!=(const IteratorImpl& rhs) const;
382
383 protected:
384 RTCTK_LOCAL IteratorImpl(MapIterType&& iter);
385
386 MapIterType m_iterator; // The underlying map iterator.
387
392 std::optional<value_type> m_pair;
393 };
394
395 public:
399 class RTCTK_API Iterator final : public IteratorImpl<MapType::iterator, ValueProxy> {
400 private:
401 friend MetaData;
402 RTCTK_LOCAL inline Iterator(MapType::iterator&& iter);
403 };
404
410 : public IteratorImpl<MapType::const_iterator, ConstValueProxy> {
411 private:
412 friend MetaData;
413 RTCTK_LOCAL inline ConstIterator(MapType::const_iterator&& iter);
414 };
415
420 : public IteratorImpl<MapType::reverse_iterator, ValueProxy> {
421 private:
422 friend MetaData;
423 RTCTK_LOCAL inline ReverseIterator(MapType::reverse_iterator&& iter);
424 };
425
431 : public IteratorImpl<MapType::const_reverse_iterator, ConstValueProxy> {
432 private:
433 friend MetaData;
434 RTCTK_LOCAL inline ConstReverseIterator(MapType::const_reverse_iterator&& iter);
435 };
436
441 public:
442 explicit KeyDoesNotExist(const std::string& key);
443 const std::string& GetKey() const;
444
445 private:
446 std::shared_ptr<std::string> m_key;
447 };
448
453 public:
454 explicit KeyAlreadyExists(const std::string& key);
455 const std::string& GetKey() const;
456
457 private:
458 std::shared_ptr<std::string> m_key;
459 };
460
466 public:
467 explicit TypeMismatch(const std::string& key,
468 const std::type_info& type_used,
469 const std::type_info& type_expected);
470 const std::string& GetKey() const;
471 const std::type_info& GetTypeUsed() const;
472 const std::type_info& GetTypeExpected() const;
473
474 private:
475 struct RTCTK_LOCAL Attributes {
476 inline Attributes(const std::string& key,
477 const std::type_info& type_used,
478 const std::type_info& type_expected);
479 std::string m_key;
480 std::reference_wrapper<const std::type_info> m_type_used;
481 std::reference_wrapper<const std::type_info> m_type_expected;
482 };
483 // Note that using shared_ptr makes the exception's copy constructor noexcept.
484 std::shared_ptr<Attributes> m_attribs;
485 };
486
491 public:
492 using UnsupportedTypeException::UnsupportedTypeException;
493 };
494
495 MetaData() = default;
496 MetaData(const MetaData& rhs) = default;
497 MetaData(MetaData&& rhs) = default;
498 MetaData(std::initializer_list<std::pair<std::string, std::any>> init_list);
499 ~MetaData() = default;
500 MetaData& operator=(const MetaData& rhs) = default;
501 MetaData& operator=(MetaData&& rhs) = default;
502
507 inline bool Empty() const;
508
513 inline size_t GetSize() const noexcept;
514
520 inline bool Contains(const std::string& key) const;
521
528 ValueProxy Insert(const std::string& key);
529
536 ValueProxy Insert(std::string&& key);
537
546 template <typename T>
547 auto& Insert(const std::string& key, T&& value);
548
557 template <typename T>
558 auto& Insert(std::string&& key, T&& value);
559
565 bool Remove(const std::string& key);
566
572 ValueProxy operator[](const std::string& key);
573
579 ValueProxy operator[](std::string&& key);
580
587 ConstValueProxy operator[](const std::string& key) const;
588
593 void Merge(const MetaData& source);
594
604 void Merge(MetaData&& source);
605
606 // The following methods are for STL compatibility and therefore must use lower case.
607 // NOLINTBEGIN(readability-identifier-naming)
611 inline Iterator begin();
612
616 inline ConstIterator begin() const;
617
621 inline ConstIterator cbegin() const noexcept;
622
626 inline Iterator end();
627
631 inline ConstIterator end() const;
632
636 inline ConstIterator cend() const noexcept;
637
641 inline ReverseIterator rbegin();
642
646 inline ConstReverseIterator rbegin() const;
647
651 inline ConstReverseIterator crbegin() const noexcept;
652
656 inline ReverseIterator rend();
657
661 inline ConstReverseIterator rend() const;
662
666 inline ConstReverseIterator crend() const noexcept;
667 // NOLINTEND(readability-identifier-naming)
668
669 private:
670 friend RepositoryIf;
671
672 // We are using an std::map because it is often faster to copy/manipulate for a small number
673 // of keys compared to std::unordered_map.
674 MapType m_metadata;
675 };
676
684 public:
685 virtual ~BatchRequest() = default;
686
711 template <typename T>
712 void CreateDataPoint(
713 const DataPointPath& path,
714 const T& initial_value,
715 std::optional<std::reference_wrapper<const MetaData>> metadata = std::nullopt,
716 const CallbackType& callback = nullptr);
717
721 template <typename T>
723 const DataPointPath& path,
724 const T&& initial_value,
725 std::optional<std::reference_wrapper<const MetaData>> metadata = std::nullopt,
726 const CallbackType& callback = nullptr) = delete;
727
728 void DeleteDataPoint(const DataPointPath& path, const CallbackType& callback = nullptr);
729
730 void DataPointExists(const DataPointPath& path,
731 bool& result,
732 const CallbackType& callback = nullptr) const;
733
765 void GetChildren(const DataPointPath& path,
766 std::pair<PathList, PathList>& result,
767 bool recurse = false,
768 const CallbackType& callback = nullptr) const;
769
773 void GetChildren(const DataPointPath& path,
774 std::pair<PathList, PathList>&& result,
775 bool recurse = false,
776 const CallbackType& callback = nullptr) const = delete;
777
778 template <typename T>
779 void ReadDataPoint(const DataPointPath& path,
780 T& buffer,
781 std::optional<std::reference_wrapper<MetaData>> metadata = std::nullopt,
782 const CallbackType& callback = nullptr) const;
783
787 template <typename T>
788 void ReadDataPoint(const DataPointPath& path,
789 T&& buffer,
790 std::optional<std::reference_wrapper<MetaData>> metadata = std::nullopt,
791 const CallbackType& callback = nullptr) const = delete;
792
793 template <typename T>
794 void WriteDataPoint(
795 const DataPointPath& path,
796 const T& buffer,
797 std::optional<std::reference_wrapper<const MetaData>> metadata = std::nullopt,
798 const CallbackType& callback = nullptr);
799
803 template <typename T>
805 const DataPointPath& path,
806 const T&& buffer,
807 std::optional<std::reference_wrapper<const MetaData>> metadata = std::nullopt,
808 const CallbackType& callback = nullptr) = delete;
809
846 template <typename T>
847 void PartialReadDataPoint(
848 const DataPointPath& path,
849 T& buffer,
850 size_t first,
851 size_t last,
852 size_t d_first,
853 std::optional<std::reference_wrapper<MetaData>> metadata = std::nullopt,
854 const CallbackType& callback = nullptr) const;
855
859 template <typename T>
861 const DataPointPath& path,
862 T&& buffer,
863 size_t first,
864 size_t last,
865 size_t d_first,
866 std::optional<std::reference_wrapper<MetaData>> metadata = std::nullopt,
867 const CallbackType& callback = nullptr) const = delete;
868
869 template <typename T>
870 void PartialWriteDataPoint(
871 const DataPointPath& path,
872 const T& buffer,
873 size_t first,
874 size_t last,
875 size_t d_first,
876 std::optional<std::reference_wrapper<const MetaData>> metadata = std::nullopt,
877 const CallbackType& callback = nullptr);
878
882 template <typename T>
884 const DataPointPath& path,
885 const T&& buffer,
886 size_t first,
887 size_t last,
888 size_t d_first,
889 std::optional<std::reference_wrapper<const MetaData>> metadata = std::nullopt,
890 const CallbackType& callback = nullptr) = delete;
891
892 void ReadMetaData(const DataPointPath& path,
893 MetaData& metadata,
894 const CallbackType& callback = nullptr) const;
895
899 void ReadMetaData(const DataPointPath& path,
900 MetaData&& metadata,
901 const CallbackType& callback = nullptr) const = delete;
902
903 void WriteMetaData(const DataPointPath& path,
904 const MetaData& metadata,
905 const CallbackType& callback = nullptr);
906
907 void CreateSymlink(const DataPointPath& dp,
908 const DataPointPath& link,
909 const CallbackType& callback = nullptr);
910
911 void UpdateSymlink(const DataPointPath& dp,
912 const DataPointPath& link,
913 const CallbackType& callback = nullptr);
914
915 protected:
918 };
919
921 public:
922 using ResponseList = std::vector<std::future<void>>;
923
925
926 // await all
927 void Wait();
928
929 template <typename Rep, typename Period>
930 bool WaitFor(const std::chrono::duration<Rep, Period>& timeout);
931
932 template <typename Clk, typename Duration>
933 bool WaitUntil(const std::chrono::time_point<Clk, Duration>& timeout);
934
935 protected:
937 };
938
939 BatchResponse SendRequest(const BatchRequest& request);
940 BatchResponse SendRequest(const BatchRequest& request) const;
941
942 // The following are synchronous convenience methods.
943
956 template <typename T>
957 void CreateDataPoint(const DataPointPath& path);
971 template <typename T>
972 void CreateDataPoint(const DataPointPath& path, const T& initial_value);
973
974 void CreateDataPoint(const DataPointPath& path, const char* initial_value);
975
985 void DeleteDataPoint(const DataPointPath& path, bool recurse = false);
986
1000 const std::type_info& GetDataPointType(const DataPointPath& path) const;
1001
1023 size_t GetDataPointSize(const DataPointPath& path) const;
1024
1047 RtcVectorUInt64 GetDataPointShape(const DataPointPath& path) const;
1048
1058 bool DataPointExists(const DataPointPath& path) const;
1059
1088 std::pair<PathList, PathList>
1089 GetChildren(const DataPointPath& path, bool recurse = false) const;
1090
1105 template <typename T>
1106 T GetDataPoint(const DataPointPath& path) const;
1107
1122 template <typename T>
1123 void SetDataPoint(const DataPointPath& path, const T& value);
1124
1125 void SetDataPoint(const DataPointPath& path, const char* value);
1126
1142 template <typename T>
1143 void ReadDataPoint(const DataPointPath& path, T& buffer) const;
1144
1163 template <typename T>
1164 void WriteDataPoint(const DataPointPath& path, const T& buffer);
1165
1166 void WriteDataPoint(const DataPointPath& path, const char* buffer);
1167
1168 template <typename... T>
1169 void WriteDataPoints(const T&... args);
1170
1171 template <typename... T>
1172 void ReadDataPoints(T&... args) const;
1173
1181 static const std::type_info& StringToType(const std::string& arg);
1182
1190 static std::string TypeToString(const std::type_info& arg);
1191
1192protected:
1193 virtual BatchResponse ProcessRequests(const RequestList& requests) = 0;
1194
1196 // The following is part of the legacy API:
1197
1198public:
1207 public:
1213 public:
1214 Parameters() = default;
1215
1223 explicit Parameters(const DataPointPath& path,
1224 void* buffer,
1225 const std::type_info& type,
1226 const std::function<void()>& callback)
1227 : m_path(path), m_buffer(buffer), m_type(&type), m_callback(callback) {
1228 }
1229
1230 inline const DataPointPath& GetPath() const {
1231 return m_path;
1232 };
1233 inline void* GetBuffer() const {
1234 return m_buffer;
1235 };
1236 inline const std::type_info& GetType() const {
1237 return *m_type;
1238 };
1239 inline const std::function<void()>& GetCallback() const {
1240 return m_callback;
1241 };
1242
1243 private:
1246
1248 void* m_buffer;
1249
1251 const std::type_info* m_type;
1252
1254 std::function<void()> m_callback;
1255 };
1256
1257 template <typename T>
1258 void Add(const DataPointPath& path, T& buffer);
1259 template <typename T, typename F>
1260 void Add(const DataPointPath& path, T& buffer, F handler);
1261 inline const std::vector<Parameters>& GetParams() const {
1262 return m_params;
1263 };
1264 inline std::vector<Parameters>& GetParams() {
1265 return m_params;
1266 };
1267
1268 private:
1269 std::vector<Parameters> m_params;
1270 };
1271
1280 public:
1286 public:
1287 Parameters() = default;
1288
1296 explicit Parameters(const DataPointPath& path,
1297 const void* buffer,
1298 const std::type_info& type,
1299 const std::function<void()>& callback)
1300 : m_path(path), m_buffer(buffer), m_type(&type), m_callback(callback) {
1301 }
1302
1303 inline const DataPointPath& GetPath() const {
1304 return m_path;
1305 };
1306 inline const void* GetBuffer() const {
1307 return m_buffer;
1308 };
1309 inline const std::type_info& GetType() const {
1310 return *m_type;
1311 };
1312 inline const std::function<void()>& GetCallback() const {
1313 return m_callback;
1314 };
1315
1316 private:
1319
1321 const void* m_buffer;
1322
1324 const std::type_info* m_type;
1325
1327 std::function<void()> m_callback;
1328 };
1329
1330 template <typename T>
1331 void Add(const DataPointPath& path, const T& buffer);
1332 template <typename T, typename F>
1333 void Add(const DataPointPath& path, const T& buffer, F handler);
1334 inline const std::vector<Parameters>& GetParams() const {
1335 return m_params;
1336 };
1337 inline std::vector<Parameters>& GetParams() {
1338 return m_params;
1339 };
1340
1341 private:
1342 std::vector<Parameters> m_params;
1343 };
1344
1354 class Response {
1355 public:
1356 explicit Response(std::future<void>&& future) noexcept;
1357 Response(Response&& other) noexcept;
1358 Response& operator=(Response&& other) noexcept;
1359
1368 void Wait();
1369
1385 bool Wait(const std::chrono::microseconds& timeout);
1386
1387 private:
1388 Response(const Response& other) = delete;
1389 Response& operator=(const Response& other) = delete;
1390
1391 std::future<void> m_future;
1392 };
1393
1425 virtual void CreateDataPoint(const DataPointPath& path, const std::type_info& type);
1426
1427protected:
1436 virtual void DeleteDataPointLegacy(const DataPointPath& path);
1437
1449 virtual const std::type_info& GetDataPointTypeLegacy(const DataPointPath& path) const;
1450
1470 virtual size_t GetDataPointSizeLegacy(const DataPointPath& path) const;
1471
1481 virtual bool DataPointExistsLegacy(const DataPointPath& path) const;
1482
1504 virtual std::pair<PathList, PathList> GetChildrenLegacy(const DataPointPath& path) const;
1505
1506public:
1531 virtual Response SendReadRequest(const ReadRequest& request) const;
1532
1559 virtual Response SendWriteRequest(const WriteRequest& request);
1560};
1561
1562} // namespace rtctk::componentFramework
1563
1565
1566#endif // RTCTK_COMPONENTFRAMEWORK_REPOSITORYIF_HPP
The BufferTooSmall is thrown when an API call fails because the provided buffer is not big enough to ...
Definition exceptions.hpp:264
BufferTooSmall(const std::size_t actual, const std::size_t expected)
Construct exception object.
Definition exceptions.cpp:159
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:74
A buffer class representing 2D matrix data.
Definition matrixBuffer.hpp:28
An object representing one or more asynchronous I/O requests to a repository.
Definition repositoryIf.hpp:683
void PartialReadDataPoint(const DataPointPath &path, T &&buffer, size_t first, size_t last, size_t d_first, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr) const =delete
Reading from a datapoint into an rvalue reference is not allowed.
void PartialWriteDataPoint(const DataPointPath &path, const T &&buffer, size_t first, size_t last, size_t d_first, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)=delete
Writing to a datapoint from an rvalue reference is not allowed.
RequestList m_requests
Definition repositoryIf.hpp:917
void GetChildren(const DataPointPath &path, std::pair< PathList, PathList > &&result, bool recurse=false, const CallbackType &callback=nullptr) const =delete
Querying children with an rvalue reference for the result is not allowed.
void GetChildren(const DataPointPath &path, std::pair< PathList, PathList > &result, bool recurse=false, const CallbackType &callback=nullptr) const
Add request to query the child datapoints and paths for a given parent path.
void CreateDataPoint(const DataPointPath &path, const T &&initial_value, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)=delete
Creation of datapoints from an rvalue reference is not allowed.
void ReadDataPoint(const DataPointPath &path, T &&buffer, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr) const =delete
Reading from a datapoint into an rvalue reference is not allowed.
void WriteDataPoint(const DataPointPath &path, const T &&buffer, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)=delete
Writing to a datapoint from an rvalue reference is not allowed.
void ReadMetaData(const DataPointPath &path, MetaData &&metadata, const CallbackType &callback=nullptr) const =delete
Reading metadata into an rvalue reference is not allowed.
friend RepositoryIf
Definition repositoryIf.hpp:916
std::vector< std::future< void > > ResponseList
Definition repositoryIf.hpp:922
ResponseList m_responses
Definition repositoryIf.hpp:936
Constant version of the bidirectional forward iterator returned by the cbegin/cend methods.
Definition repositoryIf.hpp:410
Constant version of the bidirectional reverse iterator returned by the crbegin/crend methods.
Definition repositoryIf.hpp:431
A read-only interface class to an underlying metadata value.
Definition repositoryIf.hpp:203
Bidirectional forward iterator returned by the begin/end methods.
Definition repositoryIf.hpp:399
Exception indicating that the metadata already contains the given key.
Definition repositoryIf.hpp:452
Exception indicating that the given key does not exist in the metadata.
Definition repositoryIf.hpp:440
Bidirectional reverse iterator returned by the rbegin/rend methods.
Definition repositoryIf.hpp:420
Exception indicating that a value with the wrong type was being assigned to a reserved key.
Definition repositoryIf.hpp:465
Exception indicating that an unsupported type was used for the metadata value.
Definition repositoryIf.hpp:490
Interface class to an underlying metadata value.
Definition repositoryIf.hpp:257
Class for passing/receiving metadata to/from the repository.
Definition repositoryIf.hpp:195
MetaData & operator=(const MetaData &rhs)=default
MetaData & operator=(MetaData &&rhs)=default
A structure to hold the arguments passed with one of the Add methods.
Definition repositoryIf.hpp:1212
const DataPointPath & GetPath() const
Definition repositoryIf.hpp:1230
const std::function< void()> & GetCallback() const
Definition repositoryIf.hpp:1239
Parameters(const DataPointPath &path, void *buffer, const std::type_info &type, const std::function< void()> &callback)
Allows to explicitly construct a complete parameters structure.
Definition repositoryIf.hpp:1223
const std::type_info & GetType() const
Definition repositoryIf.hpp:1236
void * GetBuffer() const
Definition repositoryIf.hpp:1233
A request object to pass information about datapoints that should be read from the repository.
Definition repositoryIf.hpp:1206
std::vector< Parameters > & GetParams()
Definition repositoryIf.hpp:1264
const std::vector< Parameters > & GetParams() const
Definition repositoryIf.hpp:1261
An object used to wait for a request to complete.
Definition repositoryIf.hpp:1354
A structure to hold the arguments passed with one of the Add methods.
Definition repositoryIf.hpp:1285
const void * GetBuffer() const
Definition repositoryIf.hpp:1306
const std::type_info & GetType() const
Definition repositoryIf.hpp:1309
const DataPointPath & GetPath() const
Definition repositoryIf.hpp:1303
const std::function< void()> & GetCallback() const
Definition repositoryIf.hpp:1312
Parameters(const DataPointPath &path, const void *buffer, const std::type_info &type, const std::function< void()> &callback)
Allows to explicitly construct a complete parameters structure.
Definition repositoryIf.hpp:1296
A request object to pass information about datapoints that should be written to the repository.
Definition repositoryIf.hpp:1279
std::vector< Parameters > & GetParams()
Definition repositoryIf.hpp:1337
const std::vector< Parameters > & GetParams() const
Definition repositoryIf.hpp:1334
Abstract interface providing basic read and write facilities to a repository.
Definition repositoryIf.hpp:104
virtual BatchResponse ProcessRequests(const RequestList &requests)=0
Clock::time_point Timestamp
Definition repositoryIf.hpp:111
taiclock::TaiClock Clock
Definition repositoryIf.hpp:110
std::vector< std::any > RequestList
Definition repositoryIf.hpp:106
std::vector< DataPointPath > PathList
Definition repositoryIf.hpp:109
std::function< void(const DataPointPath &)> CallbackType
Signature of the callback functions that can be registered with the repository requests.
Definition repositoryIf.hpp:114
The RtctkException class is the base class for all Rtctk exceptions.
Definition exceptions.hpp:211
The UnsupportedTypeException is thrown whenever an attempt is made to use an unsupported type in the ...
Definition exceptions.hpp:239
Project-wide configuration header.
#define RTCTK_LOCAL
Helper to hide a class or function from the public symbol table.
Definition config.hpp:60
#define RTCTK_API
Helper to indicate that a class or function must be exported in the public symbol table.
Definition config.hpp:33
Header file for DataPointPath.
Provides macros and utilities for exception handling.
Declaration of the MatrixBuffer template class used in APIs.
Declaration of the MatrixSpan template class used in APIs.
Definition commandReplier.cpp:22
constexpr bool operator!=(const MatrixBuffer< T, A > &lhs, const MatrixBuffer< T, A > &rhs) noexcept
Compares two MatrixBuffer objects and returns true if they do not have the same shape or the elements...
Definition matrixBuffer.hpp:129
bool operator==(const DataPointPath &lhs, const char *rhs) noexcept
Definition dataPointPath.hpp:358
Definition commandReplier.cpp:22
uint64_t RtcUInt64
Definition repositoryIf.hpp:61
uint8_t RtcUInt8
Definition repositoryIf.hpp:58
int64_t RtcInt64
Definition repositoryIf.hpp:57
float RtcFloat
Definition repositoryIf.hpp:62
RtcVector< RtcUInt32 > RtcVectorUInt32
Definition repositoryIf.hpp:73
RtcVector< RtcDouble > RtcVectorDouble
Definition repositoryIf.hpp:76
std::string RtcString
Definition repositoryIf.hpp:64
int8_t RtcInt8
Definition repositoryIf.hpp:54
std::vector< T > RtcVector
Definition repositoryIf.hpp:45
uint32_t RtcUInt32
Definition repositoryIf.hpp:60
bool RtcBool
Definition repositoryIf.hpp:53
int16_t RtcInt16
Definition repositoryIf.hpp:55
RtcVector< RtcUInt16 > RtcVectorUInt16
Definition repositoryIf.hpp:72
RtcVector< RtcInt16 > RtcVectorInt16
Definition repositoryIf.hpp:68
RtcVector< RtcFloat > RtcVectorFloat
Definition repositoryIf.hpp:75
RtcVector< RtcInt8 > RtcVectorInt8
Definition repositoryIf.hpp:67
uint16_t RtcUInt16
Definition repositoryIf.hpp:59
RtcVector< RtcBool > RtcVectorBool
Definition repositoryIf.hpp:66
int32_t RtcInt32
Definition repositoryIf.hpp:56
RtcVector< RtcUInt64 > RtcVectorUInt64
Definition repositoryIf.hpp:74
RtcVector< RtcString > RtcVectorString
Definition repositoryIf.hpp:77
RtcVector< RtcInt32 > RtcVectorInt32
Definition repositoryIf.hpp:69
std::vector< std::byte > RtcBinary
Definition repositoryIf.hpp:65
RtcVector< RtcUInt8 > RtcVectorUInt8
Definition repositoryIf.hpp:71
RtcVector< RtcInt64 > RtcVectorInt64
Definition repositoryIf.hpp:70
double RtcDouble
Definition repositoryIf.hpp:63
rtctk::componentFramework::RepositoryIf::Response Response
Definition oldbAdapterLegacy.cpp:54
DataPointPath m_path
Definition populateConfig.cpp:165
Implementation file for RepositoryIf template methods and related classes.
std::exception_ptr exception
Definition repositoryIf.hpp:158