Apply readability-avoid-const-params-in-decls

This commit is contained in:
Alexey Rybalchenko 2021-09-13 10:57:36 +02:00 committed by Dennis Klein
parent 42a7e298c0
commit f33c597f34
27 changed files with 132 additions and 132 deletions

View File

@ -204,39 +204,39 @@ class Channel
/// Set socket send buffer size /// Set socket send buffer size
/// @param sndBufSize Socket send buffer size (in number of messages) /// @param sndBufSize Socket send buffer size (in number of messages)
void UpdateSndBufSize(const int sndBufSize) { fSndBufSize = sndBufSize; Invalidate(); } void UpdateSndBufSize(int sndBufSize) { fSndBufSize = sndBufSize; Invalidate(); }
/// Set socket receive buffer size /// Set socket receive buffer size
/// @param rcvBufSize Socket receive buffer size (in number of messages) /// @param rcvBufSize Socket receive buffer size (in number of messages)
void UpdateRcvBufSize(const int rcvBufSize) { fRcvBufSize = rcvBufSize; Invalidate(); } void UpdateRcvBufSize(int rcvBufSize) { fRcvBufSize = rcvBufSize; Invalidate(); }
/// Set socket kernel transmit send buffer size (in bytes) /// Set socket kernel transmit send buffer size (in bytes)
/// @param sndKernelSize Socket send buffer size (in bytes) /// @param sndKernelSize Socket send buffer size (in bytes)
void UpdateSndKernelSize(const int sndKernelSize) { fSndKernelSize = sndKernelSize; Invalidate(); } void UpdateSndKernelSize(int sndKernelSize) { fSndKernelSize = sndKernelSize; Invalidate(); }
/// Set socket kernel transmit receive buffer size (in bytes) /// Set socket kernel transmit receive buffer size (in bytes)
/// @param rcvKernelSize Socket receive buffer size (in bytes) /// @param rcvKernelSize Socket receive buffer size (in bytes)
void UpdateRcvKernelSize(const int rcvKernelSize) { fRcvKernelSize = rcvKernelSize; Invalidate(); } void UpdateRcvKernelSize(int rcvKernelSize) { fRcvKernelSize = rcvKernelSize; Invalidate(); }
/// Set linger duration (in milliseconds) /// Set linger duration (in milliseconds)
/// @param duration linger duration (in milliseconds) /// @param duration linger duration (in milliseconds)
void UpdateLinger(const int duration) { fLinger = duration; Invalidate(); } void UpdateLinger(int duration) { fLinger = duration; Invalidate(); }
/// Set socket rate logging interval (in seconds) /// Set socket rate logging interval (in seconds)
/// @param rateLogging Socket rate logging interval (in seconds) /// @param rateLogging Socket rate logging interval (in seconds)
void UpdateRateLogging(const int rateLogging) { fRateLogging = rateLogging; Invalidate(); } void UpdateRateLogging(int rateLogging) { fRateLogging = rateLogging; Invalidate(); }
/// Set start of the port range for automatic binding /// Set start of the port range for automatic binding
/// @param minPort start of the port range /// @param minPort start of the port range
void UpdatePortRangeMin(const int minPort) { fPortRangeMin = minPort; Invalidate(); } void UpdatePortRangeMin(int minPort) { fPortRangeMin = minPort; Invalidate(); }
/// Set end of the port range for automatic binding /// Set end of the port range for automatic binding
/// @param maxPort end of the port range /// @param maxPort end of the port range
void UpdatePortRangeMax(const int maxPort) { fPortRangeMax = maxPort; Invalidate(); } void UpdatePortRangeMax(int maxPort) { fPortRangeMax = maxPort; Invalidate(); }
/// Set automatic binding (pick random port if bind fails) /// Set automatic binding (pick random port if bind fails)
/// @param autobind true/false, true to enable automatic binding /// @param autobind true/false, true to enable automatic binding
void UpdateAutoBind(const bool autobind) { fAutoBind = autobind; Invalidate(); } void UpdateAutoBind(bool autobind) { fAutoBind = autobind; Invalidate(); }
/// Checks if the configured channel settings are valid (checks the validity parameter, without running full validation (as oposed to ValidateChannel())) /// Checks if the configured channel settings are valid (checks the validity parameter, without running full validation (as oposed to ValidateChannel()))
/// @return true if channel settings are valid, false otherwise. /// @return true if channel settings are valid, false otherwise.

View File

@ -60,15 +60,15 @@ Device::Device(ProgOptions& config)
: Device(&config, {0, 0, 0}) : Device(&config, {0, 0, 0})
{} {}
Device::Device(const tools::Version version) Device::Device(tools::Version version)
: Device(nullptr, version) : Device(nullptr, version)
{} {}
Device::Device(ProgOptions& config, const tools::Version version) Device::Device(ProgOptions& config, tools::Version version)
: Device(&config, version) : Device(&config, version)
{} {}
Device::Device(ProgOptions* config, const tools::Version version) Device::Device(ProgOptions* config, tools::Version version)
: fTransportFactory(nullptr) : fTransportFactory(nullptr)
, fInternalConfig(config ? nullptr : make_unique<ProgOptions>()) , fInternalConfig(config ? nullptr : make_unique<ProgOptions>())
, fConfig(config ? config : fInternalConfig.get()) , fConfig(config ? config : fInternalConfig.get())
@ -133,7 +133,7 @@ Device::Device(ProgOptions* config, const tools::Version version)
fStateMachine.Start(); fStateMachine.Start();
} }
void Device::TransitionTo(const State s) void Device::TransitionTo(State s)
{ {
{ {
lock_guard<mutex> lock(fTransitionMtx); lock_guard<mutex> lock(fTransitionMtx);

View File

@ -53,11 +53,11 @@ class Device
public: public:
Device(); Device();
Device(ProgOptions& config); Device(ProgOptions& config);
Device(const tools::Version version); Device(tools::Version version);
Device(ProgOptions& config, const tools::Version version); Device(ProgOptions& config, tools::Version version);
private: private:
Device(ProgOptions* config, const tools::Version version); Device(ProgOptions* config, tools::Version version);
public: public:
Device(const Device&) = delete; Device(const Device&) = delete;
@ -252,7 +252,7 @@ class Device
/// Adds a transport to the device if it doesn't exist /// Adds a transport to the device if it doesn't exist
/// @param transport Transport string ("zeromq"/"shmem") /// @param transport Transport string ("zeromq"/"shmem")
std::shared_ptr<TransportFactory> AddTransport(const mq::Transport transport); std::shared_ptr<TransportFactory> AddTransport(mq::Transport transport);
/// Assigns config to the device /// Assigns config to the device
void SetConfig(ProgOptions& config); void SetConfig(ProgOptions& config);
@ -489,7 +489,7 @@ class Device
/// @param state state to wait for /// @param state state to wait for
void WaitForState(const std::string& state) { WaitForState(GetState(state)); } void WaitForState(const std::string& state) { WaitForState(GetState(state)); }
void TransitionTo(const State state); void TransitionTo(State state);
/// @brief Subscribe with a callback to state changes /// @brief Subscribe with a callback to state changes
/// @param key id to identify your subscription /// @param key id to identify your subscription
@ -537,11 +537,11 @@ class Device
/// @brief Returns name of the given state as a string /// @brief Returns name of the given state as a string
/// @param state state /// @param state state
[[deprecated("Use fair::mq::GetStateName from <fairmq/States.h> directly")]] [[deprecated("Use fair::mq::GetStateName from <fairmq/States.h> directly")]]
static std::string GetStateName(const State state) { return fair::mq::GetStateName(state); } static std::string GetStateName(State state) { return fair::mq::GetStateName(state); }
/// @brief Returns name of the given transition as a string /// @brief Returns name of the given transition as a string
/// @param transition transition /// @param transition transition
[[deprecated("Use fair::mq::GetTransitionName from <fairmq/States.h> directly")]] [[deprecated("Use fair::mq::GetTransitionName from <fairmq/States.h> directly")]]
static std::string GetTransitionName(const Transition transition) static std::string GetTransitionName(Transition transition)
{ {
return fair::mq::GetTransitionName(transition); return fair::mq::GetTransitionName(transition);
} }

View File

@ -34,14 +34,14 @@ struct Message
virtual void Rebuild() = 0; virtual void Rebuild() = 0;
virtual void Rebuild(Alignment alignment) = 0; virtual void Rebuild(Alignment alignment) = 0;
virtual void Rebuild(const size_t size) = 0; virtual void Rebuild(size_t size) = 0;
virtual void Rebuild(const size_t size, Alignment alignment) = 0; virtual void Rebuild(size_t size, Alignment alignment) = 0;
virtual void Rebuild(void* data, const size_t size, FreeFn* ffn, void* hint = nullptr) = 0; virtual void Rebuild(void* data, size_t size, FreeFn* ffn, void* hint = nullptr) = 0;
virtual void* GetData() const = 0; virtual void* GetData() const = 0;
virtual size_t GetSize() const = 0; virtual size_t GetSize() const = 0;
virtual bool SetUsedSize(const size_t size) = 0; virtual bool SetUsedSize(size_t size) = 0;
virtual Transport GetType() const = 0; virtual Transport GetType() const = 0;
TransportFactory* GetTransport() { return fTransport; } TransportFactory* GetTransport() { return fTransport; }

View File

@ -35,7 +35,7 @@ fair::mq::PluginManager::PluginManager()
{ {
} }
fair::mq::PluginManager::PluginManager(const vector<string> args) fair::mq::PluginManager::PluginManager(const vector<string>& args)
: fPluginServices() : fPluginServices()
{ {
// Parse command line options // Parse command line options

View File

@ -49,7 +49,7 @@ class PluginManager
using PluginFactory = std::unique_ptr<fair::mq::Plugin>(PluginServices&); using PluginFactory = std::unique_ptr<fair::mq::Plugin>(PluginServices&);
PluginManager(); PluginManager();
PluginManager(const std::vector<std::string> args); PluginManager(const std::vector<std::string>& args);
~PluginManager() ~PluginManager()
{ {

View File

@ -17,11 +17,11 @@ namespace fair::mq {
struct Poller struct Poller
{ {
virtual void Poll(const int timeout) = 0; virtual void Poll(int timeout) = 0;
virtual bool CheckInput(const int index) = 0; virtual bool CheckInput(int index) = 0;
virtual bool CheckOutput(const int index) = 0; virtual bool CheckOutput(int index) = 0;
virtual bool CheckInput(const std::string& channelKey, const int index) = 0; virtual bool CheckInput(const std::string& channelKey, int index) = 0;
virtual bool CheckOutput(const std::string& channelKey, const int index) = 0; virtual bool CheckOutput(const std::string& channelKey, int index) = 0;
virtual ~Poller() = default; virtual ~Poller() = default;
}; };

View File

@ -53,15 +53,15 @@ struct Socket
/// DISCLAIMER: this API is experimental and unsupported and might be dropped / refactored in /// DISCLAIMER: this API is experimental and unsupported and might be dropped / refactored in
/// the future. /// the future.
virtual int Events(uint32_t* events) = 0; virtual int Events(uint32_t* events) = 0;
virtual void SetLinger(const int value) = 0; virtual void SetLinger(int value) = 0;
virtual int GetLinger() const = 0; virtual int GetLinger() const = 0;
virtual void SetSndBufSize(const int value) = 0; virtual void SetSndBufSize(int value) = 0;
virtual int GetSndBufSize() const = 0; virtual int GetSndBufSize() const = 0;
virtual void SetRcvBufSize(const int value) = 0; virtual void SetRcvBufSize(int value) = 0;
virtual int GetRcvBufSize() const = 0; virtual int GetRcvBufSize() const = 0;
virtual void SetSndKernelSize(const int value) = 0; virtual void SetSndKernelSize(int value) = 0;
virtual int GetSndKernelSize() const = 0; virtual int GetSndKernelSize() const = 0;
virtual void SetRcvKernelSize(const int value) = 0; virtual void SetRcvKernelSize(int value) = 0;
virtual int GetRcvKernelSize() const = 0; virtual int GetRcvKernelSize() const = 0;
virtual unsigned long GetBytesTx() const = 0; virtual unsigned long GetBytesTx() const = 0;

View File

@ -246,7 +246,7 @@ StateMachine::StateMachine() : fFsm(new FairMQFSM) {}
void StateMachine::Start() { static_pointer_cast<FairMQFSM>(fFsm)->start(); } void StateMachine::Start() { static_pointer_cast<FairMQFSM>(fFsm)->start(); }
StateMachine::~StateMachine() { static_pointer_cast<FairMQFSM>(fFsm)->stop(); } StateMachine::~StateMachine() { static_pointer_cast<FairMQFSM>(fFsm)->stop(); }
bool StateMachine::ChangeState(const Transition transition) bool StateMachine::ChangeState(Transition transition)
try { try {
auto fsm = static_pointer_cast<FairMQFSM>(fFsm); auto fsm = static_pointer_cast<FairMQFSM>(fFsm);
lock_guard<mutex> lock(fsm->fStateMtx); lock_guard<mutex> lock(fsm->fStateMtx);
@ -357,7 +357,7 @@ void StateMachine::WaitForPendingState() const
unique_lock<mutex> lock(fsm->fStateMtx); unique_lock<mutex> lock(fsm->fStateMtx);
fsm->fNewStatePendingCV.wait(lock, [&]{ return static_cast<bool>(fsm->fNewStatePending); }); fsm->fNewStatePendingCV.wait(lock, [&]{ return static_cast<bool>(fsm->fNewStatePending); });
} }
bool StateMachine::WaitForPendingStateFor(const int durationInMs) const bool StateMachine::WaitForPendingStateFor(int durationInMs) const
{ {
auto fsm = static_pointer_cast<FairMQFSM>(fFsm); auto fsm = static_pointer_cast<FairMQFSM>(fFsm);
unique_lock<mutex> lock(fsm->fStateMtx); unique_lock<mutex> lock(fsm->fStateMtx);

View File

@ -25,7 +25,7 @@ class StateMachine
StateMachine(); StateMachine();
virtual ~StateMachine(); virtual ~StateMachine();
bool ChangeState(const Transition transition); bool ChangeState(Transition transition);
bool ChangeState(const std::string& transition) { return ChangeState(GetTransition(transition)); } bool ChangeState(const std::string& transition) { return ChangeState(GetTransition(transition)); }
void SubscribeToStateChange(const std::string& key, std::function<void(const State)> callback); void SubscribeToStateChange(const std::string& key, std::function<void(const State)> callback);
@ -39,7 +39,7 @@ class StateMachine
bool NewStatePending() const; bool NewStatePending() const;
void WaitForPendingState() const; void WaitForPendingState() const;
bool WaitForPendingStateFor(const int durationInMs) const; bool WaitForPendingStateFor(int durationInMs) const;
State GetCurrentState() const; State GetCurrentState() const;
std::string GetCurrentStateName() const; std::string GetCurrentStateName() const;

View File

@ -104,12 +104,12 @@ class TransportFactory
/// @param path optional parameter to pass to the underlying transport /// @param path optional parameter to pass to the underlying transport
/// @param flags optional parameter to pass to the underlying transport /// @param flags optional parameter to pass to the underlying transport
/// @return pointer to UnmanagedRegion /// @return pointer to UnmanagedRegion
virtual UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, virtual UnmanagedRegionPtr CreateUnmanagedRegion(size_t size,
RegionCallback callback = nullptr, RegionCallback callback = nullptr,
const std::string& path = "", const std::string& path = "",
int flags = 0, int flags = 0,
RegionConfig cfg = RegionConfig()) = 0; RegionConfig cfg = RegionConfig()) = 0;
virtual UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, virtual UnmanagedRegionPtr CreateUnmanagedRegion(size_t size,
RegionBulkCallback callback = nullptr, RegionBulkCallback callback = nullptr,
const std::string& path = "", const std::string& path = "",
int flags = 0, int flags = 0,
@ -123,14 +123,14 @@ class TransportFactory
/// @param path optional parameter to pass to the underlying transport /// @param path optional parameter to pass to the underlying transport
/// @param flags optional parameter to pass to the underlying transport /// @param flags optional parameter to pass to the underlying transport
/// @return pointer to UnmanagedRegion /// @return pointer to UnmanagedRegion
virtual UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, virtual UnmanagedRegionPtr CreateUnmanagedRegion(size_t size,
const int64_t userFlags, int64_t userFlags,
RegionCallback callback = nullptr, RegionCallback callback = nullptr,
const std::string& path = "", const std::string& path = "",
int flags = 0, int flags = 0,
RegionConfig cfg = RegionConfig()) = 0; RegionConfig cfg = RegionConfig()) = 0;
virtual UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, virtual UnmanagedRegionPtr CreateUnmanagedRegion(size_t size,
const int64_t userFlags, int64_t userFlags,
RegionBulkCallback callback = nullptr, RegionBulkCallback callback = nullptr,
const std::string& path = "", const std::string& path = "",
int flags = 0, int flags = 0,

View File

@ -110,7 +110,7 @@ auto Message::Rebuild(Alignment /* alignment */) -> void
Rebuild(); Rebuild();
} }
auto Message::Rebuild(const size_t size) -> void auto Message::Rebuild(size_t size) -> void
{ {
if (fFreeFunction) { if (fFreeFunction) {
fFreeFunction(fData, fHint); fFreeFunction(fData, fHint);
@ -131,13 +131,13 @@ auto Message::Rebuild(const size_t size) -> void
fHint = nullptr; fHint = nullptr;
} }
auto Message::Rebuild(const size_t size, Alignment /* alignment */) -> void auto Message::Rebuild(size_t size, Alignment /* alignment */) -> void
{ {
// TODO: implement alignment // TODO: implement alignment
Rebuild(size); Rebuild(size);
} }
auto Message::Rebuild(void* /*data*/, const size_t size, fairmq_free_fn* ffn, void* hint) -> void auto Message::Rebuild(void* /*data*/, size_t size, fairmq_free_fn* ffn, void* hint) -> void
{ {
if (fFreeFunction) { if (fFreeFunction) {
fFreeFunction(fData, fHint); fFreeFunction(fData, fHint);
@ -169,7 +169,7 @@ auto Message::GetSize() const -> size_t
return fSize; return fSize;
} }
auto Message::SetUsedSize(const size_t size) -> bool auto Message::SetUsedSize(size_t size) -> bool
{ {
if (size == fSize) { if (size == fSize) {
return true; return true;

View File

@ -32,17 +32,17 @@ class Message final : public fair::mq::Message
public: public:
Message(std::pmr::memory_resource* pmr); Message(std::pmr::memory_resource* pmr);
Message(std::pmr::memory_resource* pmr, Alignment alignment); Message(std::pmr::memory_resource* pmr, Alignment alignment);
Message(std::pmr::memory_resource* pmr, const size_t size); Message(std::pmr::memory_resource* pmr, size_t size);
Message(std::pmr::memory_resource* pmr, const size_t size, Alignment alignment); Message(std::pmr::memory_resource* pmr, size_t size, Alignment alignment);
Message(std::pmr::memory_resource* pmr, Message(std::pmr::memory_resource* pmr,
void* data, void* data,
const size_t size, size_t size,
fairmq_free_fn* ffn, fairmq_free_fn* ffn,
void* hint = nullptr); void* hint = nullptr);
Message(std::pmr::memory_resource* pmr, Message(std::pmr::memory_resource* pmr,
fair::mq::UnmanagedRegionPtr& region, fair::mq::UnmanagedRegionPtr& region,
void* data, void* data,
const size_t size, size_t size,
void* hint = 0); void* hint = 0);
Message(const Message&) = delete; Message(const Message&) = delete;
@ -50,14 +50,14 @@ class Message final : public fair::mq::Message
auto Rebuild() -> void override; auto Rebuild() -> void override;
auto Rebuild(Alignment alignment) -> void override; auto Rebuild(Alignment alignment) -> void override;
auto Rebuild(const size_t size) -> void override; auto Rebuild(size_t size) -> void override;
auto Rebuild(const size_t size, Alignment alignment) -> void override; auto Rebuild(size_t size, Alignment alignment) -> void override;
auto Rebuild(void* data, const size_t size, fairmq_free_fn* ffn, void* hint = nullptr) -> void override; auto Rebuild(void* data, size_t size, fairmq_free_fn* ffn, void* hint = nullptr) -> void override;
auto GetData() const -> void* override; auto GetData() const -> void* override;
auto GetSize() const -> size_t override; auto GetSize() const -> size_t override;
auto SetUsedSize(const size_t size) -> bool override; auto SetUsedSize(size_t size) -> bool override;
auto GetType() const -> fair::mq::Transport override { return fair::mq::Transport::OFI; } auto GetType() const -> fair::mq::Transport override { return fair::mq::Transport::OFI; }

View File

@ -250,7 +250,7 @@ auto Socket::ConnectEndpoint(std::unique_ptr<asiofi::connected_endpoint>& endpoi
} }
} }
auto Socket::Send(MessagePtr& msg, const int /*timeout*/) -> int64_t auto Socket::Send(MessagePtr& msg, int /*timeout*/) -> int64_t
{ {
// timeout argument not yet implemented // timeout argument not yet implemented
@ -261,7 +261,7 @@ auto Socket::Send(MessagePtr& msg, const int /*timeout*/) -> int64_t
return Send(msgVec); return Send(msgVec);
} }
auto Socket::Send(std::vector<MessagePtr>& msgVec, const int /*timeout*/) -> int64_t auto Socket::Send(std::vector<MessagePtr>& msgVec, int /*timeout*/) -> int64_t
try { try {
// timeout argument not yet implemented // timeout argument not yet implemented
@ -408,7 +408,7 @@ auto Socket::SendQueueReaderStatic() -> void
}); });
} }
auto Socket::Receive(MessagePtr& msg, const int /*timeout*/) -> int64_t auto Socket::Receive(MessagePtr& msg, int /*timeout*/) -> int64_t
try { try {
// timeout argument not yet implemented // timeout argument not yet implemented
@ -430,7 +430,7 @@ try {
return static_cast<int>(TransferCode::error); return static_cast<int>(TransferCode::error);
} }
auto Socket::Receive(std::vector<MessagePtr>& msgVec, const int /*timeout*/) -> int64_t auto Socket::Receive(std::vector<MessagePtr>& msgVec, int /*timeout*/) -> int64_t
try { try {
// timeout argument not yet implemented // timeout argument not yet implemented
@ -609,7 +609,7 @@ auto Socket::GetOption(const string& /*option*/, void* /*value*/, size_t* /*valu
// } // }
} }
void Socket::SetLinger(const int /*value*/) void Socket::SetLinger(int /*value*/)
{ {
LOG(debug) << "OFI transport (" << fId << "): Not yet implemented."; LOG(debug) << "OFI transport (" << fId << "): Not yet implemented.";
} }
@ -620,7 +620,7 @@ int Socket::GetLinger() const
return 0; return 0;
} }
void Socket::SetSndBufSize(const int /*value*/) void Socket::SetSndBufSize(int /*value*/)
{ {
LOG(debug) << "OFI transport (" << fId << "): Not yet implemented."; LOG(debug) << "OFI transport (" << fId << "): Not yet implemented.";
} }
@ -631,7 +631,7 @@ int Socket::GetSndBufSize() const
return 0; return 0;
} }
void Socket::SetRcvBufSize(const int /*value*/) void Socket::SetRcvBufSize(int /*value*/)
{ {
LOG(debug) << "OFI transport (" << fId << "): Not yet implemented."; LOG(debug) << "OFI transport (" << fId << "): Not yet implemented.";
} }
@ -642,7 +642,7 @@ int Socket::GetRcvBufSize() const
return 0; return 0;
} }
void Socket::SetSndKernelSize(const int /*value*/) void Socket::SetSndKernelSize(int /*value*/)
{ {
LOG(debug) << "OFI transport (" << fId << "): Not yet implemented."; LOG(debug) << "OFI transport (" << fId << "): Not yet implemented.";
} }
@ -653,7 +653,7 @@ int Socket::GetSndKernelSize() const
return 0; return 0;
} }
void Socket::SetRcvKernelSize(const int /*value*/) void Socket::SetRcvKernelSize(int /*value*/)
{ {
LOG(debug) << "OFI transport (" << fId << "): Not yet implemented."; LOG(debug) << "OFI transport (" << fId << "): Not yet implemented.";
} }

View File

@ -51,15 +51,15 @@ class Socket final : public fair::mq::Socket
auto GetSocket() const -> void* { return nullptr; } auto GetSocket() const -> void* { return nullptr; }
void SetLinger(const int value) override; void SetLinger(int value) override;
int GetLinger() const override; int GetLinger() const override;
void SetSndBufSize(const int value) override; void SetSndBufSize(int value) override;
int GetSndBufSize() const override; int GetSndBufSize() const override;
void SetRcvBufSize(const int value) override; void SetRcvBufSize(int value) override;
int GetRcvBufSize() const override; int GetRcvBufSize() const override;
void SetSndKernelSize(const int value) override; void SetSndKernelSize(int value) override;
int GetSndKernelSize() const override; int GetSndKernelSize() const override;
void SetRcvKernelSize(const int value) override; void SetRcvKernelSize(int value) override;
int GetRcvKernelSize() const override; int GetRcvKernelSize() const override;
auto Close() -> void override; auto Close() -> void override;

View File

@ -18,7 +18,7 @@ using namespace std;
namespace fair::mq::plugins namespace fair::mq::plugins
{ {
Config::Config(const string& name, const Plugin::Version version, const string& maintainer, const string& homepage, PluginServices* pluginServices) Config::Config(const string& name, Plugin::Version version, const string& maintainer, const string& homepage, PluginServices* pluginServices)
: Plugin(name, version, maintainer, homepage, pluginServices) : Plugin(name, version, maintainer, homepage, pluginServices)
{ {
SubscribeToDeviceStateChange([&](DeviceState newState) { SubscribeToDeviceStateChange([&](DeviceState newState) {

View File

@ -20,7 +20,7 @@ namespace fair::mq::plugins
class Config : public Plugin class Config : public Plugin
{ {
public: public:
Config(const std::string& name, const Plugin::Version version, const std::string& maintainer, const std::string& homepage, PluginServices* pluginServices); Config(const std::string& name, Plugin::Version version, const std::string& maintainer, const std::string& homepage, PluginServices* pluginServices);
~Config(); ~Config();
}; };

View File

@ -46,7 +46,7 @@ namespace
namespace fair::mq::plugins namespace fair::mq::plugins
{ {
Control::Control(const string& name, const Plugin::Version version, const string& maintainer, const string& homepage, PluginServices* pluginServices) Control::Control(const string& name, Plugin::Version version, const string& maintainer, const string& homepage, PluginServices* pluginServices)
: Plugin(name, version, maintainer, homepage, pluginServices) : Plugin(name, version, maintainer, homepage, pluginServices)
, fDeviceShutdownRequested(false) , fDeviceShutdownRequested(false)
, fDeviceHasShutdown(false) , fDeviceHasShutdown(false)

View File

@ -27,7 +27,7 @@ namespace fair::mq::plugins
class Control : public Plugin class Control : public Plugin
{ {
public: public:
Control(const std::string& name, const Plugin::Version version, const std::string& maintainer, const std::string& homepage, PluginServices* pluginServices); Control(const std::string& name, Plugin::Version version, const std::string& maintainer, const std::string& homepage, PluginServices* pluginServices);
~Control(); ~Control();

View File

@ -151,14 +151,14 @@ class Message final : public fair::mq::Message
fAlignment = alignment.alignment; fAlignment = alignment.alignment;
} }
void Rebuild(const size_t size) override void Rebuild(size_t size) override
{ {
CloseMessage(); CloseMessage();
fQueued = false; fQueued = false;
InitializeChunk(size); InitializeChunk(size);
} }
void Rebuild(const size_t size, Alignment alignment) override void Rebuild(size_t size, Alignment alignment) override
{ {
CloseMessage(); CloseMessage();
fQueued = false; fQueued = false;
@ -166,7 +166,7 @@ class Message final : public fair::mq::Message
InitializeChunk(size, fAlignment); InitializeChunk(size, fAlignment);
} }
void Rebuild(void* data, const size_t size, fairmq_free_fn* ffn, void* hint = nullptr) override void Rebuild(void* data, size_t size, fairmq_free_fn* ffn, void* hint = nullptr) override
{ {
CloseMessage(); CloseMessage();
fQueued = false; fQueued = false;
@ -207,7 +207,7 @@ class Message final : public fair::mq::Message
size_t GetSize() const override { return fMeta.fSize; } size_t GetSize() const override { return fMeta.fSize; }
bool SetUsedSize(const size_t newSize) override bool SetUsedSize(size_t newSize) override
{ {
if (newSize == fMeta.fSize) { if (newSize == fMeta.fSize) {
return true; return true;

View File

@ -104,7 +104,7 @@ class Poller final : public fair::mq::Poller
Poller(const Poller&) = delete; Poller(const Poller&) = delete;
Poller operator=(const Poller&) = delete; Poller operator=(const Poller&) = delete;
void SetItemEvents(zmq_pollitem_t& item, const int type) void SetItemEvents(zmq_pollitem_t& item, int type)
{ {
if (type == ZMQ_REQ || type == ZMQ_REP || type == ZMQ_PAIR || type == ZMQ_DEALER || type == ZMQ_ROUTER) { if (type == ZMQ_REQ || type == ZMQ_REP || type == ZMQ_PAIR || type == ZMQ_DEALER || type == ZMQ_ROUTER) {
item.events = ZMQ_POLLIN | ZMQ_POLLOUT; item.events = ZMQ_POLLIN | ZMQ_POLLOUT;
@ -118,7 +118,7 @@ class Poller final : public fair::mq::Poller
} }
} }
void Poll(const int timeout) override void Poll(int timeout) override
{ {
while (true) { while (true) {
if (zmq_poll(fItems, fNumItems, timeout) < 0) { if (zmq_poll(fItems, fNumItems, timeout) < 0) {
@ -137,7 +137,7 @@ class Poller final : public fair::mq::Poller
} }
} }
bool CheckInput(const int index) override bool CheckInput(int index) override
{ {
if (fItems[index].revents & ZMQ_POLLIN) { if (fItems[index].revents & ZMQ_POLLIN) {
return true; return true;
@ -146,7 +146,7 @@ class Poller final : public fair::mq::Poller
return false; return false;
} }
bool CheckOutput(const int index) override bool CheckOutput(int index) override
{ {
if (fItems[index].revents & ZMQ_POLLOUT) { if (fItems[index].revents & ZMQ_POLLOUT) {
return true; return true;
@ -155,7 +155,7 @@ class Poller final : public fair::mq::Poller
return false; return false;
} }
bool CheckInput(const std::string& channelKey, const int index) override bool CheckInput(const std::string& channelKey, int index) override
{ {
try { try {
if (fItems[fOffsetMap.at(channelKey) + index].revents & ZMQ_POLLIN) { if (fItems[fOffsetMap.at(channelKey) + index].revents & ZMQ_POLLIN) {
@ -170,7 +170,7 @@ class Poller final : public fair::mq::Poller
} }
} }
bool CheckOutput(const std::string& channelKey, const int index) override bool CheckOutput(const std::string& channelKey, int index) override
{ {
try { try {
if (fItems[fOffsetMap.at(channelKey) + index].revents & ZMQ_POLLOUT) { if (fItems[fOffsetMap.at(channelKey) + index].revents & ZMQ_POLLOUT) {

View File

@ -154,7 +154,7 @@ class Socket final : public fair::mq::Socket
} }
} }
int64_t Send(MessagePtr& msg, const int timeout = -1) override int64_t Send(MessagePtr& msg, int timeout = -1) override
{ {
int flags = 0; int flags = 0;
if (timeout == 0) { if (timeout == 0) {
@ -188,7 +188,7 @@ class Socket final : public fair::mq::Socket
return static_cast<int>(TransferCode::error); return static_cast<int>(TransferCode::error);
} }
int64_t Receive(MessagePtr& msg, const int timeout = -1) override int64_t Receive(MessagePtr& msg, int timeout = -1) override
{ {
int flags = 0; int flags = 0;
if (timeout == 0) { if (timeout == 0) {
@ -226,7 +226,7 @@ class Socket final : public fair::mq::Socket
} }
} }
int64_t Send(std::vector<MessagePtr>& msgVec, const int timeout = -1) override int64_t Send(std::vector<MessagePtr>& msgVec, int timeout = -1) override
{ {
int flags = 0; int flags = 0;
if (timeout == 0) { if (timeout == 0) {
@ -279,7 +279,7 @@ class Socket final : public fair::mq::Socket
return static_cast<int>(TransferCode::error); return static_cast<int>(TransferCode::error);
} }
int64_t Receive(std::vector<MessagePtr>& msgVec, const int timeout = -1) override int64_t Receive(std::vector<MessagePtr>& msgVec, int timeout = -1) override
{ {
int flags = 0; int flags = 0;
if (timeout == 0) { if (timeout == 0) {
@ -366,7 +366,7 @@ class Socket final : public fair::mq::Socket
} }
} }
void SetLinger(const int value) override void SetLinger(int value) override
{ {
if (zmq_setsockopt(fSocket, ZMQ_LINGER, &value, sizeof(value)) < 0) { if (zmq_setsockopt(fSocket, ZMQ_LINGER, &value, sizeof(value)) < 0) {
throw SocketError(tools::ToString("failed setting ZMQ_LINGER, reason: ", zmq_strerror(errno))); throw SocketError(tools::ToString("failed setting ZMQ_LINGER, reason: ", zmq_strerror(errno)));
@ -389,7 +389,7 @@ class Socket final : public fair::mq::Socket
return value; return value;
} }
void SetSndBufSize(const int value) override void SetSndBufSize(int value) override
{ {
if (zmq_setsockopt(fSocket, ZMQ_SNDHWM, &value, sizeof(value)) < 0) { if (zmq_setsockopt(fSocket, ZMQ_SNDHWM, &value, sizeof(value)) < 0) {
throw SocketError(tools::ToString("failed setting ZMQ_SNDHWM, reason: ", zmq_strerror(errno))); throw SocketError(tools::ToString("failed setting ZMQ_SNDHWM, reason: ", zmq_strerror(errno)));
@ -406,7 +406,7 @@ class Socket final : public fair::mq::Socket
return value; return value;
} }
void SetRcvBufSize(const int value) override void SetRcvBufSize(int value) override
{ {
if (zmq_setsockopt(fSocket, ZMQ_RCVHWM, &value, sizeof(value)) < 0) { if (zmq_setsockopt(fSocket, ZMQ_RCVHWM, &value, sizeof(value)) < 0) {
throw SocketError(tools::ToString("failed setting ZMQ_RCVHWM, reason: ", zmq_strerror(errno))); throw SocketError(tools::ToString("failed setting ZMQ_RCVHWM, reason: ", zmq_strerror(errno)));
@ -423,7 +423,7 @@ class Socket final : public fair::mq::Socket
return value; return value;
} }
void SetSndKernelSize(const int value) override void SetSndKernelSize(int value) override
{ {
if (zmq_setsockopt(fSocket, ZMQ_SNDBUF, &value, sizeof(value)) < 0) { if (zmq_setsockopt(fSocket, ZMQ_SNDBUF, &value, sizeof(value)) < 0) {
throw SocketError(tools::ToString("failed getting ZMQ_SNDBUF, reason: ", zmq_strerror(errno))); throw SocketError(tools::ToString("failed getting ZMQ_SNDBUF, reason: ", zmq_strerror(errno)));
@ -440,7 +440,7 @@ class Socket final : public fair::mq::Socket
return value; return value;
} }
void SetRcvKernelSize(const int value) override void SetRcvKernelSize(int value) override
{ {
if (zmq_setsockopt(fSocket, ZMQ_RCVBUF, &value, sizeof(value)) < 0) { if (zmq_setsockopt(fSocket, ZMQ_RCVBUF, &value, sizeof(value)) < 0) {
throw SocketError(tools::ToString("failed getting ZMQ_RCVBUF, reason: ", zmq_strerror(errno))); throw SocketError(tools::ToString("failed getting ZMQ_RCVBUF, reason: ", zmq_strerror(errno)));

View File

@ -101,22 +101,22 @@ class TransportFactory final : public fair::mq::TransportFactory
return std::make_unique<Message>(*fManager, alignment, this); return std::make_unique<Message>(*fManager, alignment, this);
} }
MessagePtr CreateMessage(const size_t size) override MessagePtr CreateMessage(size_t size) override
{ {
return std::make_unique<Message>(*fManager, size, this); return std::make_unique<Message>(*fManager, size, this);
} }
MessagePtr CreateMessage(const size_t size, Alignment alignment) override MessagePtr CreateMessage(size_t size, Alignment alignment) override
{ {
return std::make_unique<Message>(*fManager, size, alignment, this); return std::make_unique<Message>(*fManager, size, alignment, this);
} }
MessagePtr CreateMessage(void* data, const size_t size, fairmq_free_fn* ffn, void* hint = nullptr) override MessagePtr CreateMessage(void* data, size_t size, fairmq_free_fn* ffn, void* hint = nullptr) override
{ {
return std::make_unique<Message>(*fManager, data, size, ffn, hint, this); return std::make_unique<Message>(*fManager, data, size, ffn, hint, this);
} }
MessagePtr CreateMessage(UnmanagedRegionPtr& region, void* data, const size_t size, void* hint = 0) override MessagePtr CreateMessage(UnmanagedRegionPtr& region, void* data, size_t size, void* hint = 0) override
{ {
return std::make_unique<Message>(*fManager, region, data, size, hint, this); return std::make_unique<Message>(*fManager, region, data, size, hint, this);
} }
@ -141,27 +141,27 @@ class TransportFactory final : public fair::mq::TransportFactory
return std::make_unique<Poller>(channelsMap, channelList); return std::make_unique<Poller>(channelsMap, channelList);
} }
UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, RegionCallback callback = nullptr, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override UnmanagedRegionPtr CreateUnmanagedRegion(size_t size, RegionCallback callback = nullptr, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override
{ {
return CreateUnmanagedRegion(size, 0, callback, nullptr, path, flags, cfg); return CreateUnmanagedRegion(size, 0, callback, nullptr, path, flags, cfg);
} }
UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, RegionBulkCallback bulkCallback = nullptr, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override UnmanagedRegionPtr CreateUnmanagedRegion(size_t size, RegionBulkCallback bulkCallback = nullptr, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override
{ {
return CreateUnmanagedRegion(size, 0, nullptr, bulkCallback, path, flags, cfg); return CreateUnmanagedRegion(size, 0, nullptr, bulkCallback, path, flags, cfg);
} }
UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, int64_t userFlags, RegionCallback callback = nullptr, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override UnmanagedRegionPtr CreateUnmanagedRegion(size_t size, int64_t userFlags, RegionCallback callback = nullptr, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override
{ {
return CreateUnmanagedRegion(size, userFlags, callback, nullptr, path, flags, cfg); return CreateUnmanagedRegion(size, userFlags, callback, nullptr, path, flags, cfg);
} }
UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, int64_t userFlags, RegionBulkCallback bulkCallback = nullptr, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override UnmanagedRegionPtr CreateUnmanagedRegion(size_t size, int64_t userFlags, RegionBulkCallback bulkCallback = nullptr, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override
{ {
return CreateUnmanagedRegion(size, userFlags, nullptr, bulkCallback, path, flags, cfg); return CreateUnmanagedRegion(size, userFlags, nullptr, bulkCallback, path, flags, cfg);
} }
UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, int64_t userFlags, RegionCallback callback, RegionBulkCallback bulkCallback, const std::string& path, int flags, fair::mq::RegionConfig cfg) UnmanagedRegionPtr CreateUnmanagedRegion(size_t size, int64_t userFlags, RegionCallback callback, RegionBulkCallback bulkCallback, const std::string& path, int flags, fair::mq::RegionConfig cfg)
{ {
return std::make_unique<UnmanagedRegion>(*fManager, size, userFlags, callback, bulkCallback, path, flags, this, cfg); return std::make_unique<UnmanagedRegion>(*fManager, size, userFlags, callback, bulkCallback, path, flags, this, cfg);
} }

View File

@ -152,7 +152,7 @@ class Message final : public fair::mq::Message
} }
} }
void Rebuild(const size_t size) override void Rebuild(size_t size) override
{ {
CloseMessage(); CloseMessage();
fMsg = std::make_unique<zmq_msg_t>(); fMsg = std::make_unique<zmq_msg_t>();
@ -161,7 +161,7 @@ class Message final : public fair::mq::Message
} }
} }
void Rebuild(const size_t size, Alignment alignment) override void Rebuild(size_t size, Alignment alignment) override
{ {
CloseMessage(); CloseMessage();
fAlignment = alignment.alignment; fAlignment = alignment.alignment;
@ -179,7 +179,7 @@ class Message final : public fair::mq::Message
} }
} }
void Rebuild(void* data, const size_t size, fairmq_free_fn* ffn, void* hint = nullptr) override void Rebuild(void* data, size_t size, fairmq_free_fn* ffn, void* hint = nullptr) override
{ {
CloseMessage(); CloseMessage();
fMsg = std::make_unique<zmq_msg_t>(); fMsg = std::make_unique<zmq_msg_t>();
@ -204,7 +204,7 @@ class Message final : public fair::mq::Message
// destroyed. Used size is applied only once in ApplyUsedSize, which is called by the socket // destroyed. Used size is applied only once in ApplyUsedSize, which is called by the socket
// before sending. This function just updates the desired size until the actual "resizing" // before sending. This function just updates the desired size until the actual "resizing"
// happens. // happens.
bool SetUsedSize(const size_t size) override bool SetUsedSize(size_t size) override
{ {
if (size == GetSize()) { if (size == GetSize()) {
// nothing to do // nothing to do

View File

@ -105,7 +105,7 @@ class Poller final : public fair::mq::Poller
Poller(const Poller&) = delete; Poller(const Poller&) = delete;
Poller operator=(const Poller&) = delete; Poller operator=(const Poller&) = delete;
void SetItemEvents(zmq_pollitem_t& item, const int type) void SetItemEvents(zmq_pollitem_t& item, int type)
{ {
if (type == ZMQ_REQ || type == ZMQ_REP || type == ZMQ_PAIR || type == ZMQ_DEALER || type == ZMQ_ROUTER) { if (type == ZMQ_REQ || type == ZMQ_REP || type == ZMQ_PAIR || type == ZMQ_DEALER || type == ZMQ_ROUTER) {
item.events = ZMQ_POLLIN | ZMQ_POLLOUT; item.events = ZMQ_POLLIN | ZMQ_POLLOUT;
@ -119,7 +119,7 @@ class Poller final : public fair::mq::Poller
} }
} }
void Poll(const int timeout) override void Poll(int timeout) override
{ {
while (true) { while (true) {
if (zmq_poll(fItems, fNumItems, timeout) < 0) { if (zmq_poll(fItems, fNumItems, timeout) < 0) {
@ -138,7 +138,7 @@ class Poller final : public fair::mq::Poller
} }
} }
bool CheckInput(const int index) override bool CheckInput(int index) override
{ {
if (fItems[index].revents & ZMQ_POLLIN) { if (fItems[index].revents & ZMQ_POLLIN) {
return true; return true;
@ -147,7 +147,7 @@ class Poller final : public fair::mq::Poller
return false; return false;
} }
bool CheckOutput(const int index) override bool CheckOutput(int index) override
{ {
if (fItems[index].revents & ZMQ_POLLOUT) { if (fItems[index].revents & ZMQ_POLLOUT) {
return true; return true;
@ -156,7 +156,7 @@ class Poller final : public fair::mq::Poller
return false; return false;
} }
bool CheckInput(const std::string& channelKey, const int index) override bool CheckInput(const std::string& channelKey, int index) override
{ {
try { try {
if (fItems[fOffsetMap.at(channelKey) + index].revents & ZMQ_POLLIN) { if (fItems[fOffsetMap.at(channelKey) + index].revents & ZMQ_POLLIN) {
@ -171,7 +171,7 @@ class Poller final : public fair::mq::Poller
} }
} }
bool CheckOutput(const std::string& channelKey, const int index) override bool CheckOutput(const std::string& channelKey, int index) override
{ {
try { try {
if (fItems[fOffsetMap.at(channelKey) + index].revents & ZMQ_POLLOUT) { if (fItems[fOffsetMap.at(channelKey) + index].revents & ZMQ_POLLOUT) {

View File

@ -131,7 +131,7 @@ class Socket final : public fair::mq::Socket
} }
} }
int64_t Send(MessagePtr& msg, const int timeout = -1) override int64_t Send(MessagePtr& msg, int timeout = -1) override
{ {
int flags = 0; int flags = 0;
if (timeout == 0) { if (timeout == 0) {
@ -161,7 +161,7 @@ class Socket final : public fair::mq::Socket
} }
} }
int64_t Receive(MessagePtr& msg, const int timeout = -1) override int64_t Receive(MessagePtr& msg, int timeout = -1) override
{ {
int flags = 0; int flags = 0;
if (timeout == 0) { if (timeout == 0) {
@ -191,7 +191,7 @@ class Socket final : public fair::mq::Socket
} }
} }
int64_t Send(std::vector<std::unique_ptr<fair::mq::Message>>& msgVec, const int timeout = -1) override int64_t Send(std::vector<std::unique_ptr<fair::mq::Message>>& msgVec, int timeout = -1) override
{ {
int flags = 0; int flags = 0;
if (timeout == 0) { if (timeout == 0) {
@ -243,7 +243,7 @@ class Socket final : public fair::mq::Socket
} }
} }
int64_t Receive(std::vector<std::unique_ptr<fair::mq::Message>>& msgVec, const int timeout = -1) override int64_t Receive(std::vector<std::unique_ptr<fair::mq::Message>>& msgVec, int timeout = -1) override
{ {
int flags = 0; int flags = 0;
if (timeout == 0) { if (timeout == 0) {
@ -329,7 +329,7 @@ class Socket final : public fair::mq::Socket
return zmq_getsockopt(fSocket, ZMQ_EVENTS, events, &eventsSize); return zmq_getsockopt(fSocket, ZMQ_EVENTS, events, &eventsSize);
} }
void SetLinger(const int value) override void SetLinger(int value) override
{ {
if (zmq_setsockopt(fSocket, ZMQ_LINGER, &value, sizeof(value)) < 0) { if (zmq_setsockopt(fSocket, ZMQ_LINGER, &value, sizeof(value)) < 0) {
throw SocketError(tools::ToString("failed setting ZMQ_LINGER, reason: ", zmq_strerror(errno))); throw SocketError(tools::ToString("failed setting ZMQ_LINGER, reason: ", zmq_strerror(errno)));
@ -346,7 +346,7 @@ class Socket final : public fair::mq::Socket
return value; return value;
} }
void SetSndBufSize(const int value) override void SetSndBufSize(int value) override
{ {
if (zmq_setsockopt(fSocket, ZMQ_SNDHWM, &value, sizeof(value)) < 0) { if (zmq_setsockopt(fSocket, ZMQ_SNDHWM, &value, sizeof(value)) < 0) {
throw SocketError(tools::ToString("failed setting ZMQ_SNDHWM, reason: ", zmq_strerror(errno))); throw SocketError(tools::ToString("failed setting ZMQ_SNDHWM, reason: ", zmq_strerror(errno)));
@ -363,7 +363,7 @@ class Socket final : public fair::mq::Socket
return value; return value;
} }
void SetRcvBufSize(const int value) override void SetRcvBufSize(int value) override
{ {
if (zmq_setsockopt(fSocket, ZMQ_RCVHWM, &value, sizeof(value)) < 0) { if (zmq_setsockopt(fSocket, ZMQ_RCVHWM, &value, sizeof(value)) < 0) {
throw SocketError(tools::ToString("failed setting ZMQ_RCVHWM, reason: ", zmq_strerror(errno))); throw SocketError(tools::ToString("failed setting ZMQ_RCVHWM, reason: ", zmq_strerror(errno)));
@ -380,7 +380,7 @@ class Socket final : public fair::mq::Socket
return value; return value;
} }
void SetSndKernelSize(const int value) override void SetSndKernelSize(int value) override
{ {
if (zmq_setsockopt(fSocket, ZMQ_SNDBUF, &value, sizeof(value)) < 0) { if (zmq_setsockopt(fSocket, ZMQ_SNDBUF, &value, sizeof(value)) < 0) {
throw SocketError(tools::ToString("failed getting ZMQ_SNDBUF, reason: ", zmq_strerror(errno))); throw SocketError(tools::ToString("failed getting ZMQ_SNDBUF, reason: ", zmq_strerror(errno)));
@ -397,7 +397,7 @@ class Socket final : public fair::mq::Socket
return value; return value;
} }
void SetRcvKernelSize(const int value) override void SetRcvKernelSize(int value) override
{ {
if (zmq_setsockopt(fSocket, ZMQ_RCVBUF, &value, sizeof(value)) < 0) { if (zmq_setsockopt(fSocket, ZMQ_RCVBUF, &value, sizeof(value)) < 0) {
throw SocketError(tools::ToString("failed getting ZMQ_RCVBUF, reason: ", zmq_strerror(errno))); throw SocketError(tools::ToString("failed getting ZMQ_RCVBUF, reason: ", zmq_strerror(errno)));

View File

@ -56,22 +56,22 @@ class TransportFactory final : public FairMQTransportFactory
return std::make_unique<Message>(alignment, this); return std::make_unique<Message>(alignment, this);
} }
MessagePtr CreateMessage(const size_t size) override MessagePtr CreateMessage(size_t size) override
{ {
return std::make_unique<Message>(size, this); return std::make_unique<Message>(size, this);
} }
MessagePtr CreateMessage(const size_t size, Alignment alignment) override MessagePtr CreateMessage(size_t size, Alignment alignment) override
{ {
return std::make_unique<Message>(size, alignment, this); return std::make_unique<Message>(size, alignment, this);
} }
MessagePtr CreateMessage(void* data, const size_t size, fairmq_free_fn* ffn, void* hint = nullptr) override MessagePtr CreateMessage(void* data, size_t size, fairmq_free_fn* ffn, void* hint = nullptr) override
{ {
return std::make_unique<Message>(data, size, ffn, hint, this); return std::make_unique<Message>(data, size, ffn, hint, this);
} }
MessagePtr CreateMessage(UnmanagedRegionPtr& region, void* data, const size_t size, void* hint = 0) override MessagePtr CreateMessage(UnmanagedRegionPtr& region, void* data, size_t size, void* hint = 0) override
{ {
return std::make_unique<Message>(region, data, size, hint, this); return std::make_unique<Message>(region, data, size, hint, this);
} }
@ -96,27 +96,27 @@ class TransportFactory final : public FairMQTransportFactory
return std::make_unique<Poller>(channelsMap, channelList); return std::make_unique<Poller>(channelsMap, channelList);
} }
UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, RegionCallback callback, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override UnmanagedRegionPtr CreateUnmanagedRegion(size_t size, RegionCallback callback, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override
{ {
return CreateUnmanagedRegion(size, 0, callback, nullptr, path, flags, cfg); return CreateUnmanagedRegion(size, 0, callback, nullptr, path, flags, cfg);
} }
UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, RegionBulkCallback bulkCallback, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override UnmanagedRegionPtr CreateUnmanagedRegion(size_t size, RegionBulkCallback bulkCallback, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override
{ {
return CreateUnmanagedRegion(size, 0, nullptr, bulkCallback, path, flags, cfg); return CreateUnmanagedRegion(size, 0, nullptr, bulkCallback, path, flags, cfg);
} }
UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, const int64_t userFlags, RegionCallback callback, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override UnmanagedRegionPtr CreateUnmanagedRegion(size_t size, int64_t userFlags, RegionCallback callback, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override
{ {
return CreateUnmanagedRegion(size, userFlags, callback, nullptr, path, flags, cfg); return CreateUnmanagedRegion(size, userFlags, callback, nullptr, path, flags, cfg);
} }
UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, const int64_t userFlags, RegionBulkCallback bulkCallback, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override UnmanagedRegionPtr CreateUnmanagedRegion(size_t size, int64_t userFlags, RegionBulkCallback bulkCallback, const std::string& path = "", int flags = 0, fair::mq::RegionConfig cfg = fair::mq::RegionConfig()) override
{ {
return CreateUnmanagedRegion(size, userFlags, nullptr, bulkCallback, path, flags, cfg); return CreateUnmanagedRegion(size, userFlags, nullptr, bulkCallback, path, flags, cfg);
} }
UnmanagedRegionPtr CreateUnmanagedRegion(const size_t size, const int64_t userFlags, RegionCallback callback, RegionBulkCallback bulkCallback, const std::string&, int /* flags */, fair::mq::RegionConfig cfg) UnmanagedRegionPtr CreateUnmanagedRegion(size_t size, int64_t userFlags, RegionCallback callback, RegionBulkCallback bulkCallback, const std::string&, int /* flags */, fair::mq::RegionConfig cfg)
{ {
UnmanagedRegionPtr ptr = std::make_unique<UnmanagedRegion>(*fCtx, size, userFlags, callback, bulkCallback, this, cfg); UnmanagedRegionPtr ptr = std::make_unique<UnmanagedRegion>(*fCtx, size, userFlags, callback, bulkCallback, this, cfg);
auto zPtr = static_cast<UnmanagedRegion*>(ptr.get()); auto zPtr = static_cast<UnmanagedRegion*>(ptr.get());