Skip to content
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

Modified to be compatible with more OOP paradigms. #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MysteryPoo
Copy link

This methodology allows the mqtt driver to exist in non-global space (such as belonging to another wrapper class).
Other features here allow default constructor, with post constructed Initialization (but only a single time).
Also, the callback feature is backwards compatible with a global function callback OR the option of registering
other objects (by means of the ISubCallback interface) to a list of callback listeners.


void MQTT::RegisterCallbackListener(ISubCallback *listener)
{
this->callbackListeners.push_back(listener);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For thread enable, MutexLocker lock(this) is needed before push_back.

@hirotakaster
Copy link
Owner

Hi @MysteryPoo ,
Thanks for your PR. I have a comment about the MutexLocker and UnRegisterCallback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants