-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New class for return values of interface methods PART1 #3051
base: master
Are you sure you want to change the base?
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update the release notes by adding a file in |
d60a482
to
a410446
Compare
As we typically use |
Still not sure about the class name, but I like the idea of moving it to yarp::dev! |
a410446
to
c3863ab
Compare
c3863ab
to
e24c709
Compare
71900d2
to
ead1caf
Compare
Waiting for further comments. |
53d435e
to
40a95a3
Compare
40a95a3
to
20a1afb
Compare
20a1afb
to
47da963
Compare
Quality Gate failedFailed conditions |
I am not sure if it is the right time, it can be done also later but, at some point it would be nice to have a documentation/migration guide for introducing this new return value type instead of using bool, in the form of doxygen page or issue or discussion or even in the body of this PR. We may then link this guide when we announce the distro. |
This new class can be used in all interface methods to provide extra info about the success/failure of the method.
In this example, in the interface
ISpeechSynthesizer
is modified as follows:virtual bool setLanguage(const std::string& language="auto") = 0;
becomes:
virtual yarp::dev::yarp_ret_value setLanguage(const std::string& language="auto") = 0;
So the user can distinguish if a failure is due to missing implementation/internal error/communication error etc.
The class is also automatically converted to bool when tested by conditions.
Extra Notes: