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
If it gets overridden by a run() method in a child class for extending its functionality, this child method has zero access to the required data of the base class (e.g. params provided to constructor, data added later through method calls etc.), since that data is completely private in base class. This also applies to several methods used in the original code of run() in the base class.
It is thus not possible to extend the functionality of the base class run() method.
To Reproduce
Create a child class inheriting from SocketReactor and add a run() method which overrides. Try to copy in the code from original run() method of the base class. It won´t compile because of accessing private members and methods. Try to instantiate an object just to ensure compilation is attempted.
Expected behavior
The currently private data of the base class SocketReactor should become protected so it can be accessed from overridden run() method in child class. This also applies to private methods used by the original run() method of the base class. Steps outlined in "To reproduce" should compile, link and work ok.
Logs
N/A
Screenshots
N/A
Please add relevant environment information:
Linux
Checked with POCO Version 1.13.3, most likely was in already earlier
Additional context
N/A
The text was updated successfully, but these errors were encountered:
If you want access to the private members from child classes, send a PR which provides it through protected member functions; we will not make the member variables protected.
SocketReactor has a virtual
run()
method, seepoco/Net/include/Poco/Net/SocketReactor.h
Line 184 in ad72b25
If it gets overridden by a
run()
method in a child class for extending its functionality, this child method has zero access to the required data of the base class (e.g. params provided to constructor, data added later through method calls etc.), since that data is completely private in base class. This also applies to several methods used in the original code of run() in the base class.It is thus not possible to extend the functionality of the base class
run()
method.To Reproduce
Create a child class inheriting from SocketReactor and add a run() method which overrides. Try to copy in the code from original
run()
method of the base class. It won´t compile because of accessing private members and methods. Try to instantiate an object just to ensure compilation is attempted.Expected behavior
The currently private data of the base class SocketReactor should become protected so it can be accessed from overridden
run()
method in child class. This also applies to private methods used by the originalrun()
method of the base class. Steps outlined in "To reproduce" should compile, link and work ok.Logs
N/A
Screenshots
N/A
Please add relevant environment information:
Additional context
N/A
The text was updated successfully, but these errors were encountered: