RTC Toolkit 5.0.0
Loading...
Searching...
No Matches
oldbAdapter.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_OLDBADAPTER_HPP
14#define RTCTK_COMPONENTFRAMEWORK_OLDBADAPTER_HPP
15
17
18#include <ciiOldb.hpp>
19#include <ciiOldbSubscription.hpp>
20#include <ciiOldbTypedDataBase.hpp>
21
23
29class OldbAdapter : public OldbIf {
30public:
31 inline static const std::string SUPPORTED_URI_SCHEME = "cii.oldb";
32
34 OldbAdapter() = delete;
35
37 OldbAdapter(const OldbAdapter&) = delete;
38
41
44
47
53 explicit OldbAdapter(const elt::mal::Uri& baseuri);
54
55 virtual ~OldbAdapter();
56
57protected:
59
60 template <typename T>
62
63 template <typename T>
65
66 template <typename T>
68
70 template <typename T>
72
74 template <typename T>
76
79
82
88
91
93
96
98
99 virtual void InvokeRequestHandler(std::any&);
100
101 template <typename T>
103 const std::shared_ptr<elt::oldb::CiiOldbTypedDataBase>&);
104
109 const elt::mal::Uri m_baseuri;
110
112 mutable std::shared_ptr<elt::oldb::CiiOldb> m_client;
113
115 mutable std::mutex m_mutex;
116
117 // data structures to hold active subscriptions
119 std::shared_ptr<elt::oldb::CiiOldbTypedDataBase> dp;
120 std::shared_ptr<elt::oldb::CiiOldbDpSubscriptionBase> sub;
122 };
123 std::map<SubscriptionId, SubscriptionEntry> m_subscriptions;
124
125 using DispatchFunction = std::function<void(OldbAdapter*, std::any&)>;
126 using LookupTable = std::unordered_map<std::type_index, DispatchFunction>;
127 using TableEntry = typename LookupTable::value_type;
128
129 template <typename T>
130 static TableEntry Bind(void (OldbAdapter::*method)(T&));
131
133};
134
135} // namespace rtctk::componentFramework
136
137#endif // RTCTK_COMPONENTFRAMEWORK_OLDBADAPTER_HPP
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:74
Implementation of the OLDB Adapter.
Definition oldbAdapter.hpp:29
void GetChildrenImpl(detail::GetChildrenRequest &)
Definition oldbAdapter.cpp:1249
std::unordered_map< std::type_index, DispatchFunction > LookupTable
Definition oldbAdapter.hpp:126
void WriteImpl(detail::WriteRequest< T > &)
Definition oldbAdapter.cpp:629
void GetChildrenImplRecursive(const DataPointPath &, PathList &, PathList &, bool)
Definition oldbAdapter.cpp:1259
void UnsubscribeImpl(detail::UnsubscribeRequest &)
Definition oldbAdapter.cpp:1544
void AddSubscription(detail::ValueSubscribeRequest &, const std::shared_ptr< elt::oldb::CiiOldbTypedDataBase > &)
void CreateLinkImpl(detail::CreateSymlinkRequest &)
Definition oldbAdapter.cpp:1286
OldbAdapter(const OldbAdapter &)=delete
This class cannot be copy constructed.
static const LookupTable S_REQUEST_DISPATCHER_TABLE
Definition oldbAdapter.hpp:132
const elt::mal::Uri m_baseuri
The prefix part for OLDB URIs.
Definition oldbAdapter.hpp:109
OldbAdapter & operator=(const OldbAdapter &)=delete
This class cannot be copy assigned.
static const std::string SUPPORTED_URI_SCHEME
Definition oldbAdapter.hpp:31
OldbAdapter()=delete
Do not allow construction with no arguments.
std::map< SubscriptionId, SubscriptionEntry > m_subscriptions
Definition oldbAdapter.hpp:123
void WriteMetaDataImpl(detail::WriteMetaDataRequest &)
operation partially supported by this backend, limited metadata functionality
Definition oldbAdapter.cpp:725
std::function< void(OldbAdapter *, std::any &)> DispatchFunction
Definition oldbAdapter.hpp:125
void CreateImpl(detail::CreateRequest< T > &)
Definition oldbAdapter.cpp:596
BatchResponse ProcessRequests(const RequestList &requests) override
Definition oldbAdapter.cpp:1553
virtual void InvokeRequestHandler(std::any &)
Definition oldbAdapter.cpp:1594
void UpdateLinkImpl(detail::UpdateSymlinkRequest &)
operation not supported by this backend, invocation will result in exception
Definition oldbAdapter.cpp:1313
void PartialReadImpl(detail::PartialReadRequest< T > &)
operation not supported by this backend, invocation will result in exception
Definition oldbAdapter.cpp:929
virtual ~OldbAdapter()
Definition oldbAdapter.cpp:592
OldbAdapter & operator=(OldbAdapter &&)=default
Objects of this class can be moved with the move assignment operator.
static TableEntry Bind(void(OldbAdapter::*method)(T &))
Definition oldbAdapter.cpp:1604
void ExistsImpl(detail::ExistsRequest &)
Definition oldbAdapter.cpp:1225
void PartialWriteImpl(detail::PartialWriteRequest< T > &)
operation not supported by this backend, invocation will result in exception
Definition oldbAdapter.cpp:721
void CreateDeleteSubscribeImpl(detail::CreateDeleteSubscribeRequest &)
operation not supported by this backend, invocation will result in exception
Definition oldbAdapter.cpp:1540
void ReadMetaDataImpl(detail::ReadMetaDataRequest &)
operation partially supported by this backend, limited metadata functionality
Definition oldbAdapter.cpp:933
std::mutex m_mutex
Mutex for synchronising access to subscriptions.
Definition oldbAdapter.hpp:115
typename LookupTable::value_type TableEntry
Definition oldbAdapter.hpp:127
OldbAdapter(OldbAdapter &&)=default
Objects of this class can be moved.
std::shared_ptr< elt::oldb::CiiOldb > m_client
Pointer to the CII OLDB API client object.
Definition oldbAdapter.hpp:112
void DeleteImpl(detail::DeleteRequest &)
Definition oldbAdapter.cpp:1065
void SubscribeImpl(detail::ValueSubscribeRequest &)
Definition oldbAdapter.cpp:1414
void ReadImpl(detail::ReadRequest< T > &)
Definition oldbAdapter.cpp:858
Base interface for all OLDB adapters.
Definition oldbIf.hpp:25
std::vector< std::any > RequestList
Definition repositoryIf.hpp:106
Definition commandReplier.cpp:22
RepositoryIf::PathList PathList
Definition oldbAdapterLegacy.cpp:322
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Header file for OldbIf, which defines the API for OldbAdapters.
std::function< void(SubscriptionEntry &) unreg_cb)
Definition oldbAdapter.hpp:121
std::shared_ptr< elt::oldb::CiiOldbDpSubscriptionBase > sub
Definition oldbAdapter.hpp:120
std::shared_ptr< elt::oldb::CiiOldbTypedDataBase > dp
Definition oldbAdapter.hpp:119
Definition repositorySubscriberIf.ipp:41
Definition repositorySubscriberIf.ipp:27