-
Notifications
You must be signed in to change notification settings - Fork 212
Description
As this library already requires C++ 14 , using std::function (https://en.cppreference.com/w/cpp/utility/functional/function) for the notifications should improve the usability a lot (e.g. bind to class members, use custom handler types, ...). As a function pointer can be bound to an std::function, too, this would not break existing code.
This would require changes in these places:
ADS/AdsLib/AdsNotificationOOI.h
Line 14 in 3824918
| struct AdsNotification { |
Lines 83 to 87 in 3824918
| AdsHandle AdsDevice::GetHandle(const uint32_t indexGroup, | |
| const uint32_t indexOffset, | |
| const AdsNotificationAttrib& notificationAttributes, | |
| PAdsNotificationFuncEx callback, | |
| const uint32_t hUser) const |
ADS/AdsLib/standalone/AdsLib.cpp
Lines 261 to 268 in 3824918
| long AdsSyncAddDeviceNotificationReqEx(long port, | |
| const AmsAddr* pAddr, | |
| uint32_t indexGroup, | |
| uint32_t indexOffset, | |
| const AdsNotificationAttrib* pAttrib, | |
| PAdsNotificationFuncEx pFunc, | |
| uint32_t hUser, | |
| uint32_t* pNotification) |
Line 15 in 3824918
| struct Notification { |
PS: I'm aware that this is a feature request, but I just want to get a general opinion about this, before I potentially work on this.