mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Make factory classes final (optimization potential)
This commit is contained in:
parent
00800f16f1
commit
dfa1b68867
|
@ -65,7 +65,7 @@ FairMQChannel::FairMQChannel(const string& type, const string& method, const str
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
FairMQChannel::FairMQChannel(const string& name, const string& type, std::shared_ptr<FairMQTransportFactory> factory)
|
FairMQChannel::FairMQChannel(const string& name, const string& type, shared_ptr<FairMQTransportFactory> factory)
|
||||||
: fSocket(factory->CreateSocket(type, name))
|
: fSocket(factory->CreateSocket(type, name))
|
||||||
, fType(type)
|
, fType(type)
|
||||||
, fMethod("unspecified")
|
, fMethod("unspecified")
|
||||||
|
|
|
@ -302,7 +302,7 @@ bool FairMQDevice::AttachChannel(FairMQChannel& ch)
|
||||||
ch.fSocket->SetOption("snd-hwm", &(ch.fSndBufSize), sizeof(ch.fSndBufSize));
|
ch.fSocket->SetOption("snd-hwm", &(ch.fSndBufSize), sizeof(ch.fSndBufSize));
|
||||||
ch.fSocket->SetOption("rcv-hwm", &(ch.fRcvBufSize), sizeof(ch.fRcvBufSize));
|
ch.fSocket->SetOption("rcv-hwm", &(ch.fRcvBufSize), sizeof(ch.fRcvBufSize));
|
||||||
|
|
||||||
// set kernel transmit size
|
// set kernel transmit size (set it only if value is not the default value)
|
||||||
if (ch.fSndKernelSize != 0)
|
if (ch.fSndKernelSize != 0)
|
||||||
{
|
{
|
||||||
ch.fSocket->SetOption("snd-size", &(ch.fSndKernelSize), sizeof(ch.fSndKernelSize));
|
ch.fSocket->SetOption("snd-size", &(ch.fSndKernelSize), sizeof(ch.fSndKernelSize));
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
class FairMQSocketNN;
|
class FairMQSocketNN;
|
||||||
|
|
||||||
class FairMQMessageNN : public FairMQMessage
|
class FairMQMessageNN final : public FairMQMessage
|
||||||
{
|
{
|
||||||
friend class FairMQSocketNN;
|
friend class FairMQSocketNN;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
class FairMQChannel;
|
class FairMQChannel;
|
||||||
struct nn_pollfd;
|
struct nn_pollfd;
|
||||||
|
|
||||||
class FairMQPollerNN : public FairMQPoller
|
class FairMQPollerNN final : public FairMQPoller
|
||||||
{
|
{
|
||||||
friend class FairMQChannel;
|
friend class FairMQChannel;
|
||||||
friend class FairMQTransportFactoryNN;
|
friend class FairMQTransportFactoryNN;
|
||||||
|
@ -41,13 +41,13 @@ class FairMQPollerNN : public FairMQPoller
|
||||||
|
|
||||||
void SetItemEvents(nn_pollfd& item, const int type);
|
void SetItemEvents(nn_pollfd& item, const int type);
|
||||||
|
|
||||||
virtual void Poll(const int timeout);
|
void Poll(const int timeout) override;
|
||||||
virtual bool CheckInput(const int index);
|
bool CheckInput(const int index) override;
|
||||||
virtual bool CheckOutput(const int index);
|
bool CheckOutput(const int index) override;
|
||||||
virtual bool CheckInput(const std::string& channelKey, const int index);
|
bool CheckInput(const std::string& channelKey, const int index) override;
|
||||||
virtual bool CheckOutput(const std::string& channelKey, const int index);
|
bool CheckOutput(const std::string& channelKey, const int index) override;
|
||||||
|
|
||||||
virtual ~FairMQPollerNN();
|
~FairMQPollerNN() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FairMQPollerNN(const FairMQSocket& cmdSocket, const FairMQSocket& dataSocket);
|
FairMQPollerNN(const FairMQSocket& cmdSocket, const FairMQSocket& dataSocket);
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
class FairMQTransportFactoryNN;
|
class FairMQTransportFactoryNN;
|
||||||
|
|
||||||
class FairMQSocketNN : public FairMQSocket
|
class FairMQSocketNN final : public FairMQSocket
|
||||||
{
|
{
|
||||||
friend class FairMQTransportFactoryNN;
|
friend class FairMQTransportFactoryNN;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class FairMQTransportFactoryNN : public FairMQTransportFactory
|
class FairMQTransportFactoryNN final : public FairMQTransportFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FairMQTransportFactoryNN(const std::string& id = "", const FairMQProgOptions* config = nullptr);
|
FairMQTransportFactoryNN(const std::string& id = "", const FairMQProgOptions* config = nullptr);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
|
|
||||||
class FairMQUnmanagedRegionNN : public FairMQUnmanagedRegion
|
class FairMQUnmanagedRegionNN final : public FairMQUnmanagedRegion
|
||||||
{
|
{
|
||||||
friend class FairMQSocketNN;
|
friend class FairMQSocketNN;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace ofi
|
||||||
*
|
*
|
||||||
* @todo TODO insert long description
|
* @todo TODO insert long description
|
||||||
*/
|
*/
|
||||||
class Message : public fair::mq::Message
|
class Message final : public fair::mq::Message
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Message();
|
Message();
|
||||||
|
|
|
@ -33,7 +33,7 @@ class TransportFactory;
|
||||||
*
|
*
|
||||||
* @todo TODO insert long description
|
* @todo TODO insert long description
|
||||||
*/
|
*/
|
||||||
class Poller : public FairMQPoller
|
class Poller final : public FairMQPoller
|
||||||
{
|
{
|
||||||
friend class FairMQChannel;
|
friend class FairMQChannel;
|
||||||
friend class TransportFactory;
|
friend class TransportFactory;
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace ofi
|
||||||
*
|
*
|
||||||
* @todo TODO insert long description
|
* @todo TODO insert long description
|
||||||
*/
|
*/
|
||||||
class Socket : public fair::mq::Socket
|
class Socket final : public fair::mq::Socket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Socket(Context& factory, const std::string& type, const std::string& name, const std::string& id = "");
|
Socket(Context& factory, const std::string& type, const std::string& name, const std::string& id = "");
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace ofi
|
||||||
*
|
*
|
||||||
* @todo TODO insert long description
|
* @todo TODO insert long description
|
||||||
*/
|
*/
|
||||||
class TransportFactory : public FairMQTransportFactory
|
class TransportFactory final : public FairMQTransportFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TransportFactory(const std::string& id = "", const FairMQProgOptions* config = nullptr);
|
TransportFactory(const std::string& id = "", const FairMQProgOptions* config = nullptr);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
class FairMQSocketSHM;
|
class FairMQSocketSHM;
|
||||||
|
|
||||||
class FairMQMessageSHM : public FairMQMessage
|
class FairMQMessageSHM final : public FairMQMessage
|
||||||
{
|
{
|
||||||
friend class FairMQSocketSHM;
|
friend class FairMQSocketSHM;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
class FairMQChannel;
|
class FairMQChannel;
|
||||||
|
|
||||||
class FairMQPollerSHM : public FairMQPoller
|
class FairMQPollerSHM final : public FairMQPoller
|
||||||
{
|
{
|
||||||
friend class FairMQChannel;
|
friend class FairMQChannel;
|
||||||
friend class FairMQTransportFactorySHM;
|
friend class FairMQTransportFactorySHM;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <memory> // unique_ptr
|
#include <memory> // unique_ptr
|
||||||
|
|
||||||
class FairMQSocketSHM : public FairMQSocket
|
class FairMQSocketSHM final : public FairMQSocket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FairMQSocketSHM(fair::mq::shmem::Manager& manager, const std::string& type, const std::string& name, const std::string& id = "", void* context = nullptr);
|
FairMQSocketSHM(fair::mq::shmem::Manager& manager, const std::string& type, const std::string& name, const std::string& id = "", void* context = nullptr);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
class FairMQTransportFactorySHM : public FairMQTransportFactory
|
class FairMQTransportFactorySHM final : public FairMQTransportFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FairMQTransportFactorySHM(const std::string& id = "", const FairMQProgOptions* config = nullptr);
|
FairMQTransportFactorySHM(const std::string& id = "", const FairMQProgOptions* config = nullptr);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
|
|
||||||
class FairMQUnmanagedRegionSHM : public FairMQUnmanagedRegion
|
class FairMQUnmanagedRegionSHM final : public FairMQUnmanagedRegion
|
||||||
{
|
{
|
||||||
friend class FairMQSocketSHM;
|
friend class FairMQSocketSHM;
|
||||||
friend class FairMQMessageSHM;
|
friend class FairMQMessageSHM;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
class FairMQSocketZMQ;
|
class FairMQSocketZMQ;
|
||||||
|
|
||||||
class FairMQMessageZMQ : public FairMQMessage
|
class FairMQMessageZMQ final : public FairMQMessage
|
||||||
{
|
{
|
||||||
friend class FairMQSocketZMQ;
|
friend class FairMQSocketZMQ;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
class FairMQChannel;
|
class FairMQChannel;
|
||||||
|
|
||||||
class FairMQPollerZMQ : public FairMQPoller
|
class FairMQPollerZMQ final : public FairMQPoller
|
||||||
{
|
{
|
||||||
friend class FairMQChannel;
|
friend class FairMQChannel;
|
||||||
friend class FairMQTransportFactoryZMQ;
|
friend class FairMQTransportFactoryZMQ;
|
||||||
|
@ -42,13 +42,13 @@ class FairMQPollerZMQ : public FairMQPoller
|
||||||
|
|
||||||
void SetItemEvents(zmq_pollitem_t& item, const int type);
|
void SetItemEvents(zmq_pollitem_t& item, const int type);
|
||||||
|
|
||||||
virtual void Poll(const int timeout);
|
void Poll(const int timeout) override;
|
||||||
virtual bool CheckInput(const int index);
|
bool CheckInput(const int index) override;
|
||||||
virtual bool CheckOutput(const int index);
|
bool CheckOutput(const int index) override;
|
||||||
virtual bool CheckInput(const std::string& channelKey, const int index);
|
bool CheckInput(const std::string& channelKey, const int index) override;
|
||||||
virtual bool CheckOutput(const std::string& channelKey, const int index);
|
bool CheckOutput(const std::string& channelKey, const int index) override;
|
||||||
|
|
||||||
virtual ~FairMQPollerZMQ();
|
~FairMQPollerZMQ() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FairMQPollerZMQ(const FairMQSocket& cmdSocket, const FairMQSocket& dataSocket);
|
FairMQPollerZMQ(const FairMQSocket& cmdSocket, const FairMQSocket& dataSocket);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "FairMQSocket.h"
|
#include "FairMQSocket.h"
|
||||||
#include "FairMQMessage.h"
|
#include "FairMQMessage.h"
|
||||||
|
|
||||||
class FairMQSocketZMQ : public FairMQSocket
|
class FairMQSocketZMQ final : public FairMQSocket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FairMQSocketZMQ(const std::string& type, const std::string& name, const std::string& id = "", void* context = nullptr);
|
FairMQSocketZMQ(const std::string& type, const std::string& name, const std::string& id = "", void* context = nullptr);
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "FairMQUnmanagedRegionZMQ.h"
|
#include "FairMQUnmanagedRegionZMQ.h"
|
||||||
#include <options/FairMQProgOptions.h>
|
#include <options/FairMQProgOptions.h>
|
||||||
|
|
||||||
class FairMQTransportFactoryZMQ : public FairMQTransportFactory
|
class FairMQTransportFactoryZMQ final : public FairMQTransportFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FairMQTransportFactoryZMQ(const std::string& id = "", const FairMQProgOptions* config = nullptr);
|
FairMQTransportFactoryZMQ(const std::string& id = "", const FairMQProgOptions* config = nullptr);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
|
|
||||||
class FairMQUnmanagedRegionZMQ : public FairMQUnmanagedRegion
|
class FairMQUnmanagedRegionZMQ final : public FairMQUnmanagedRegion
|
||||||
{
|
{
|
||||||
friend class FairMQSocketZMQ;
|
friend class FairMQSocketZMQ;
|
||||||
friend class FairMQMessageZMQ;
|
friend class FairMQMessageZMQ;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user