16 #ifndef ACSDK_NOTIFIER_INTERNAL_NOTIFIERTRAITS_H_ 17 #define ACSDK_NOTIFIER_INTERNAL_NOTIFIERTRAITS_H_ 35 class NotifierTraits {
38 NotifierTraits() noexcept = delete;
39 ~NotifierTraits() noexcept = delete;
40 void operator=(
const NotifierTraits<T>&) noexcept = delete;
53 static
std::shared_ptr<
void> toVoidPtr(
const std::shared_ptr<T>& src) noexcept;
67 static
std::shared_ptr<T> fromVoidPtr(
const std::shared_ptr<
void>& src) noexcept;
81 static
std::function<
void(
const std::shared_ptr<
void>&)> adaptFunction(
82 std::function<
void(
const std::shared_ptr<T>&)>&& notify) noexcept;
95 static
void invokeNotify(
97 const std::shared_ptr<
void>& data) noexcept;
101 std::shared_ptr<
void> NotifierTraits<T>::toVoidPtr(
const std::shared_ptr<T>& src) noexcept {
102 return std::static_pointer_cast<
void>(src);
106 std::shared_ptr<T> NotifierTraits<T>::fromVoidPtr(
const std::shared_ptr<void>& src) noexcept {
107 return std::static_pointer_cast<T>(src);
111 std::function<void(const std::shared_ptr<void>&)> NotifierTraits<T>::adaptFunction(
112 std::function<
void(
const std::shared_ptr<T>&)>&& notify) noexcept {
114 return std::bind(&NotifierTraits<T>::invokeNotify,
std::move(notify), std::placeholders::_1);
121 void NotifierTraits<T>::invokeNotify(
122 const std::function<
void(
const std::shared_ptr<T>&)>& notify,
123 const std::shared_ptr<void>& data) noexcept {
124 notify(fromVoidPtr(data));
130 #endif // ACSDK_NOTIFIER_INTERNAL_NOTIFIERTRAITS_H_ Definition: CapabilityConfiguration.h:190
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
const
Definition: upload.py:398
const T & move(const T &t)
Definition: gtest-port.h:1317