Apply modernize-pass-by-value

This commit is contained in:
Alexey Rybalchenko
2021-05-27 14:34:31 +02:00
committed by Dennis Klein
parent c847a7ca02
commit 882edbbdb8
12 changed files with 41 additions and 36 deletions

View File

@@ -77,7 +77,7 @@ void signalHandler(int signal)
gSignalStatus = signal;
}
Monitor::Monitor(const string& shmId, bool selfDestruct, bool interactive, bool viewOnly, unsigned int timeoutInMS, unsigned int intervalInMS, bool monitor, bool cleanOnExit)
Monitor::Monitor(string shmId, bool selfDestruct, bool interactive, bool viewOnly, unsigned int timeoutInMS, unsigned int intervalInMS, bool monitor, bool cleanOnExit)
: fSelfDestruct(selfDestruct)
, fInteractive(interactive)
, fViewOnly(viewOnly)
@@ -86,7 +86,7 @@ Monitor::Monitor(const string& shmId, bool selfDestruct, bool interactive, bool
, fCleanOnExit(cleanOnExit)
, fTimeoutInMS(timeoutInMS)
, fIntervalInMS(intervalInMS)
, fShmId(shmId)
, fShmId(std::move(shmId))
, fControlQueueName("fmq_" + fShmId + "_cq")
, fTerminating(false)
, fHeartbeatTriggered(false)

View File

@@ -52,7 +52,7 @@ struct BufferDebugInfo
class Monitor
{
public:
Monitor(const std::string& shmId, bool selfDestruct, bool interactive, bool viewOnly, unsigned int timeoutInMS, unsigned int intervalInMS, bool runAsDaemon, bool cleanOnExit);
Monitor(std::string shmId, bool selfDestruct, bool interactive, bool viewOnly, unsigned int timeoutInMS, unsigned int intervalInMS, bool runAsDaemon, bool cleanOnExit);
Monitor(const Monitor&) = delete;
Monitor operator=(const Monitor&) = delete;

View File

@@ -38,6 +38,7 @@
#include <cerrno>
#include <chrono>
#include <ios>
#include <utility> // move
namespace fair::mq::shmem
{
@@ -54,8 +55,8 @@ struct Region
, fFile(nullptr)
, fFileMapping()
, fQueue(nullptr)
, fCallback(callback)
, fBulkCallback(bulkCallback)
, fCallback(std::move(callback))
, fBulkCallback(std::move(bulkCallback))
{
using namespace boost::interprocess;