53 std::is_convertible_v<F, RepositorySubscriberIf::NotifyCallbackType>
or
54 (
not std::is_same_v<T, void>
and
55 std::is_convertible_v<
F,
57 std::conditional_t<std::is_same_v<T, void>, std::byte, T>>>),
64 if constexpr (std::is_convertible_v<F, NotifyCallbackType>) {
67 static_assert(std::is_convertible_v<F, ValueCallbackType<T>>,
68 "The cb_value callback must have a signature compatible with"
69 " void(const DataPointPath&, T&, const MetaData&).");
76 if (
md.Contains(
"sequence_id")) {
81 cb_value(path2, *
buf,
md);
89 cb_value(path2, *
buf,
md);
132 "The handler callback must have a signature compatible with void(const DataPointPath&).");
164template <
typename T,
typename F>
168 static_assert(std::is_convertible_v<F, ValueHandler<T>>,
169 "The handler callback must have a signature compatible with void(const"
170 " DataPointPath&, T&).");
201 static_assert(std::is_convertible_v<F, NotifyHandler>,
202 "The handler callback must have a signature compatible with void(const"
203 " DataPointPath&).");
207 m_params.push_back(
Parameters(path,
false,
nullptr,
typeid(
void),
nullptr, callback));
235 std::enable_if_t<not std::is_convertible_v<T, RepositorySubscriberIf::NotifyCallbackType>,
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:74
void ReadDataPoint(const DataPointPath &path, T &buffer, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr) const
Definition repositoryIf.ipp:1395
void Wait()
Definition repositoryIf.cpp:342
void Wait()
Waits for the request that was sent to the repository to complete.
Definition repositoryIf.cpp:611
BatchResponse SendRequest(const BatchRequest &request)
Definition repositoryIf.cpp:364
std::function< void(const DataPointPath &)> CallbackType
Signature of the callback functions that can be registered with the repository requests.
Definition repositoryIf.hpp:114
Definition repositorySubscriberIf.hpp:83
void Unsubscribe(SubscriptionId) const
Definition repositorySubscriberIf.cpp:49
SubscriptionId Subscribe(const DataPointPath &, NotifyCallbackType, ErrorCallbackType) const
Definition repositorySubscriberIf.cpp:30
Definition repositorySubscriberIf.hpp:40
A structure to hold the arguments passed to the Add method.
Definition repositorySubscriberIf.hpp:167
A request object to pass information about datapoints to subscribe to.
Definition repositorySubscriberIf.hpp:161
void AddNewValueHandler(const DataPointPath &path, T &buffer, F handler)
Adds a request to subscribe to new data values for a particular datapoint.
Definition repositorySubscriberIf.ipp:165
void AddRemovedHandler(const DataPointPath &path, F handler)
Adds a request to subscribe to removal notifications for a particular datapoint.
Definition repositorySubscriberIf.ipp:128
void AddValueChangedHandler(const DataPointPath &path, F handler)
Adds a request to subscribe to value change notifications for a particular datapoint.
Definition repositorySubscriberIf.ipp:199
RAII wrapper class used to manage the life-time of individual subscriptions.
Definition repositorySubscriberIf.hpp:64
std::function< void(std::exception_ptr)> ErrorCallbackType
Definition repositorySubscriberIf.hpp:49
virtual RepositoryIf::Response SendSubscribeRequest(const SubscribeRequest &request) const
This is called to asynchronously send a subscription request for datapoints.
Definition repositorySubscriberIf.cpp:162
Subscription Subscribe(const DataPointPath &path, const F &cb_value, const ErrorCallbackType &cb_error) const
Subscribes to datapoint values change events by registering callbacks.
Definition repositorySubscriberIf.ipp:60
std::function< void(const DataPointPath &, T &, const MetaData &)> ValueCallbackType
Definition repositorySubscriberIf.hpp:46
std::function< void(const DataPointPath &, const MetaData &)> NotifyCallbackType
Definition repositorySubscriberIf.hpp:48
size_t SubscriptionId
Definition repositorySubscriberIf.hpp:51
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
uint64_t RtcUInt64
Definition repositoryIf.hpp:61
Definition repositorySubscriberIf.ipp:34
RepositorySubscriberIf::CallbackType cb_created
Definition repositorySubscriberIf.ipp:36
RepositorySubscriberIf::SubscriptionId id
Definition repositorySubscriberIf.ipp:35
RepositorySubscriberIf::ErrorCallbackType cb_error
Definition repositorySubscriberIf.ipp:38
RepositorySubscriberIf::CallbackType cb_deleted
Definition repositorySubscriberIf.ipp:37
Definition repositorySubscriberIf.ipp:41
RepositorySubscriberIf::SubscriptionId id
Definition repositorySubscriberIf.ipp:42
Definition repositorySubscriberIf.ipp:27
RepositorySubscriberIf::ErrorCallbackType cb_error
Definition repositorySubscriberIf.ipp:31
RepositorySubscriberIf::SubscriptionId id
Definition repositorySubscriberIf.ipp:28
RepositorySubscriberIf::NotifyCallbackType cb_value
Definition repositorySubscriberIf.ipp:30
DataPointPath path
Definition repositorySubscriberIf.ipp:29