diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-15 00:39:28 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-05-28 00:33:55 +0200 |
| commit | bc8d283f90d51480c0ee5d40d6c9dcde420d8222 (patch) | |
| tree | 2bcb005061081cc56d1bab9e3d1b6c7aeb1b8542 | |
| parent | daadf569cc8678421b9fe3a537c7a7fff346c98d (diff) | |
Cleanup: white space, superfluous void, const position.
| -rw-r--r-- | src/lib/grok/messenger.h | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/src/lib/grok/messenger.h b/src/lib/grok/messenger.h index c1e44ac7e..cdde6fd51 100644 --- a/src/lib/grok/messenger.h +++ b/src/lib/grok/messenger.h @@ -123,36 +123,50 @@ extern IMessengerLogger* sLogger; void setMessengerLogger(IMessengerLogger* logger); IMessengerLogger* getMessengerLogger(void); + struct MessengerInit { - MessengerInit(const std::string &outBuf, const std::string &outSent, - const std::string &outReceiveReady, const std::string &inBuf, - const std::string &inSent, - const std::string &inReceiveReady, - std::function<void(std::string)> processor, - size_t numProcessingThreads) - : outboundMessageBuf(outBuf), outboundSentSynch(outSent), - outboundReceiveReadySynch(outReceiveReady), inboundMessageBuf(inBuf), - inboundSentSynch(inSent), inboundReceiveReadySynch(inReceiveReady), processor_(processor), - numProcessingThreads_(numProcessingThreads), - uncompressedFrameSize_(0), compressedFrameSize_(0), - numFrames_(0) - { - if(firstLaunch(true)) + MessengerInit( + std::string const& outBuf, + std::string const& outSent, + std::string const& outReceiveReady, + std::string const& inBuf, + std::string const& inSent, + std::string const& inReceiveReady, + std::function<void(std::string)> processor, + size_t numProcessingThreads + ) + : outboundMessageBuf(outBuf) + , outboundSentSynch(outSent) + , outboundReceiveReadySynch(outReceiveReady) + , inboundMessageBuf(inBuf) + , inboundSentSynch(inSent) + , inboundReceiveReadySynch(inReceiveReady) + , processor_(processor) + , numProcessingThreads_(numProcessingThreads) + , uncompressedFrameSize_(0) + , compressedFrameSize_(0) + , numFrames_(0) + { + if (firstLaunch(true)) { unlink(); + } } - void unlink(void) + + void unlink() { #ifndef _WIN32 shm_unlink(grokToClientMessageBuf.c_str()); shm_unlink(clientToGrokMessageBuf.c_str()); #endif } + static bool firstLaunch(bool isClient) { bool debugGrok = false; return debugGrok != isClient; } + std::string outboundMessageBuf; std::string outboundSentSynch; std::string outboundReceiveReadySynch; @@ -169,6 +183,7 @@ struct MessengerInit size_t numFrames_; }; + /*************************** Synchronization *******************************/ enum SynchDirection { |
