Skip to content

ofxOSC: consider renaming ofxOscReceiver::message_buffer, should it be private? remove ofxOscMessage::getRemoteIp() #8412

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

Open
danomatika opened this issue Mar 31, 2025 · 3 comments

Comments

@danomatika
Copy link
Contributor

With of_v20250330_osx_release:

There is a new ofxOscReceiver::message_buffer member variable. I suggest that it should be renamed "messageBuffer" in order to better match the overall OF API, however this is not a container (vector) but a single message, so maybe "buffer" doesn't quite make sense?

Also, should this be public? It looks like it is a storage object for calls to getMessage(). I suggest adding a comment about that this is for so we can know if we should use it or not, etc.

@danomatika
Copy link
Contributor Author

Somewhat related: ofxOscMessage::getRemoteIp() is deprecated but it was added since the OF 0.12.0 release. Can we just remove it?

@danomatika danomatika changed the title ofxOSC: consider renaming ofxOscReceiver::message_buffer, should it be private? ofxOSC: consider renaming ofxOscReceiver::message_buffer, should it be private? remove ofxOscMessage::getRemoteIp() Mar 31, 2025
@danomatika
Copy link
Contributor Author

I reported the last post as spam.

@artificiel
Copy link
Contributor

@danomatika it seems getRemoteIp() got deprecated 8 years ago — but recently the deprecations moved from OF_DEPRECATED_MSG() to [[deprecated]] — maybe that's what you're picking up?
https://github.com/openframeworks/openFrameworks/blame/70bb1b22b5175c6779ed95cceff482302f919208/addons/ofxOsc/src/ofxOscMessage.h#L29

the ofxOscReceiver::message_buffer should indeed be private; it's a scratch buffer to pass to the swap within the thread channel. maybe ofxOscReceiver::scratch_channel_message would be more precise? due to the working of thread channel a placeholder is required prior to the call, and the idea is not to constantly/needlessly reallocate an empty ofxOscMessage. I wonder now if the const is useful, and if and explicit std::move would be appropriate to ensure the optional alloc skips copies when possible? (maybe it already does?) the swap does not mind a moved-from state object as it's never used as such on the other side of the channel.

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

No branches or pull requests

3 participants
@danomatika @artificiel and others