-
Notifications
You must be signed in to change notification settings - Fork 75
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
Remove persistant callbacks #109
Conversation
operator== to functionpointerWithContext class
conversion and function operator syntax to CallChainOfFunctionPointerWithContext
Provide access to Callchains
… with the continuation function
…ut it is a mechanism internal to CallChain object. This change allow to safelly remove a callback in a callchain while calling it. It also clean responsabilities and reduce coupling.
* | ||
* @oaram toDetach FunctionPointerWithContext to detach from this callchain | ||
* | ||
* @return true if a function pointer has been detached and false otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice to return true if detach was successful. currently the doc-header doesn't match the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups sorry about this, I will fix it right away
onHVXCallbackChain.add(callback); | ||
} | ||
|
||
HVXCallbackChain_t& onHVX() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a documentation header. it might be good to add a code-example showing its use
looks good other than the comments made already. This is a useful contribution. |
Add SafeBool class which allow to easily declare a safe bool operator in c++03. CallChainOfFunctionPointerswithContext: - unify syntax of add - detach function now return true if a function has been detached and false otherwise - Explanations about function call operator - use safe bool idiom - explanations about iterator and why it is mutable FunctionPointerWithContext: - fix call propagation - use safe bool idiom Gap: - add documentation - onRadioNotification does mot call initRadioNotification anymore GattClient: - documentation GattServer: - documentation
this is a new feature. this pushes ble to v2.1.0 |
This pull request improve
CallChainOfFunctionPointersWithContext
,FunctionPointerWithContext
and provide a way to unregister callbacks previously registered in a callchain.Changes in
FunctionPointerWithContext
are not minor, goals were to provide function pointer semantic and value semantic:next
FunctionPointerWithContext
, it is not its responsibility any more. This change can be seen as a breaking one.FunctionPointerWithContext
needs to handle less things, is it a list, a node of a list, a call chain ? Unfortunately, mixing responsibilities hurt and I was forced to make this change if I wanted to make callback called only once worked.CallChainOfFunctionPointersWithContext
improvements:DiscoveredCharacteristic
improvements:Gap
improvements:GattClient
improvements:GattServer
improvements:EventCallback_t
is now aFunctionPointerwithContext
instead of a plain function pointerServiceDiscovery
callbacks are FunctionPointerWithcontext instances instead of plain function pointer