You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Yes, you are not the first (#142) and I agree a std::function<> interface would be much nicer. Actually this is on my todo list for quite some time, but I had no time to look into this. Important is, that we don't break existing users. So it might be easier to add a new wrapper for this. If you have a good idea, go for it. But be warned I will only merge a clean solution.
EDIT: Beware you can not change AdsSyncAddDeviceNotificationReqEx as that is part of the legacy "TcAdsLib" interface [1]. We have to keep it in sync to keep the possibility to link against upstream TwinCAT TcAdsDll.dll.
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
ADS/AdsLib/AdsDevice.cpp
Lines 83 to 87 in 3824918
ADS/AdsLib/standalone/AdsLib.cpp
Lines 261 to 268 in 3824918
ADS/AdsLib/AdsNotification.h
Line 15 in 3824918
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.
The text was updated successfully, but these errors were encountered: