mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
FairMQ: Introduce callbacks for the FairMQUnmanagedRegion.
Callbacks are called when the data buffer of the message assiciated with the corresponding region is no longer needed by the transport. Example in examples/advanced/Region/
This commit is contained in:
committed by
Mohammad Al-Turany
parent
378c47c5e5
commit
58a312b730
@@ -1,8 +1,8 @@
|
||||
/********************************************************************************
|
||||
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* *
|
||||
* This software is distributed under the terms of the *
|
||||
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
|
||||
* This software is distributed under the terms of the *
|
||||
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
|
||||
* copied verbatim in the file "LICENSE" *
|
||||
********************************************************************************/
|
||||
#ifndef FAIRMQSOCKETSHM_H_
|
||||
@@ -14,52 +14,53 @@
|
||||
|
||||
#include "FairMQSocket.h"
|
||||
#include "FairMQMessage.h"
|
||||
#include "FairMQShmManager.h"
|
||||
#include "Manager.h"
|
||||
|
||||
class FairMQSocketSHM : public FairMQSocket
|
||||
{
|
||||
public:
|
||||
FairMQSocketSHM(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);
|
||||
FairMQSocketSHM(const FairMQSocketSHM&) = delete;
|
||||
FairMQSocketSHM operator=(const FairMQSocketSHM&) = delete;
|
||||
|
||||
virtual std::string GetId();
|
||||
std::string GetId() override;
|
||||
|
||||
virtual bool Bind(const std::string& address);
|
||||
virtual void Connect(const std::string& address);
|
||||
bool Bind(const std::string& address) override;
|
||||
void Connect(const std::string& address) override;
|
||||
|
||||
virtual int Send(FairMQMessagePtr& msg, const int flags = 0);
|
||||
virtual int Receive(FairMQMessagePtr& msg, const int flags = 0);
|
||||
int Send(FairMQMessagePtr& msg, const int flags = 0) override;
|
||||
int Receive(FairMQMessagePtr& msg, const int flags = 0) override;
|
||||
|
||||
virtual int64_t Send(std::vector<std::unique_ptr<FairMQMessage>>& msgVec, const int flags = 0);
|
||||
virtual int64_t Receive(std::vector<std::unique_ptr<FairMQMessage>>& msgVec, const int flags = 0);
|
||||
int64_t Send(std::vector<std::unique_ptr<FairMQMessage>>& msgVec, const int flags = 0) override;
|
||||
int64_t Receive(std::vector<std::unique_ptr<FairMQMessage>>& msgVec, const int flags = 0) override;
|
||||
|
||||
virtual void* GetSocket() const;
|
||||
virtual int GetSocket(int nothing) const;
|
||||
virtual void Close();
|
||||
void* GetSocket() const override;
|
||||
int GetSocket(int nothing) const override;
|
||||
void Close() override;
|
||||
|
||||
virtual void Interrupt();
|
||||
virtual void Resume();
|
||||
void Interrupt() override;
|
||||
void Resume() override;
|
||||
|
||||
virtual void SetOption(const std::string& option, const void* value, size_t valueSize);
|
||||
virtual void GetOption(const std::string& option, void* value, size_t* valueSize);
|
||||
void SetOption(const std::string& option, const void* value, size_t valueSize) override;
|
||||
void GetOption(const std::string& option, void* value, size_t* valueSize) override;
|
||||
|
||||
virtual unsigned long GetBytesTx() const;
|
||||
virtual unsigned long GetBytesRx() const;
|
||||
virtual unsigned long GetMessagesTx() const;
|
||||
virtual unsigned long GetMessagesRx() const;
|
||||
unsigned long GetBytesTx() const override;
|
||||
unsigned long GetBytesRx() const override;
|
||||
unsigned long GetMessagesTx() const override;
|
||||
unsigned long GetMessagesRx() const override;
|
||||
|
||||
virtual bool SetSendTimeout(const int timeout, const std::string& address, const std::string& method);
|
||||
virtual int GetSendTimeout() const;
|
||||
virtual bool SetReceiveTimeout(const int timeout, const std::string& address, const std::string& method);
|
||||
virtual int GetReceiveTimeout() const;
|
||||
bool SetSendTimeout(const int timeout, const std::string& address, const std::string& method) override;
|
||||
int GetSendTimeout() const override;
|
||||
bool SetReceiveTimeout(const int timeout, const std::string& address, const std::string& method) override;
|
||||
int GetReceiveTimeout() const override;
|
||||
|
||||
static int GetConstant(const std::string& constant);
|
||||
|
||||
virtual ~FairMQSocketSHM();
|
||||
~FairMQSocketSHM() override;
|
||||
|
||||
private:
|
||||
void* fSocket;
|
||||
fair::mq::shmem::Manager& fManager;
|
||||
std::string fId;
|
||||
std::atomic<unsigned long> fBytesTx;
|
||||
std::atomic<unsigned long> fBytesRx;
|
||||
|
Reference in New Issue
Block a user