1 #ifndef artdaq_TransferPlugins_ShmemTransfer_hh
2 #define artdaq_TransferPlugins_ShemmTransfer_hh
4 #include "fhiclcpp/fwd.h"
7 #include "artdaq/TransferPlugins/TransferInterface.hh"
9 #define BUFFER_EMPTY 0UL
10 #define WRITING_FRAGMENT 1UL
11 #define FRAGMENT_READY 2UL
12 #define READING_FRAGMENT 3UL
48 size_t receiveTimeout)
override;
57 size_t send_timeout_usec = std::numeric_limits<size_t>::max())
override;
66 size_t send_timeout_usec = std::numeric_limits<size_t>::max())
override;
70 size_t send_timeout_usec,
bool reliable =
false);
74 bool readyForWrite_();
76 RawDataType* offsetToPtr(
size_t offset);
81 size_t fragmentSizeWords;
82 std::atomic<unsigned int> sem;
83 unsigned int writeCount;
88 std::atomic<unsigned int> read_pos;
89 std::atomic<unsigned int> write_pos;
90 ShmBuffer buffers[100];
94 size_t send_timeout_usec_;
103 #endif // artdaq_TransferPlugins/ShmemTransfer_hh
Role role() const
Get the TransferInterface::Role of this TransferInterface.
CopyStatus moveFragment(Fragment &&fragment, size_t send_timeout_usec=std::numeric_limits< size_t >::max()) override
Move a Fragment to the destination.
CopyStatus copyFragment(Fragment &fragment, size_t send_timeout_usec=std::numeric_limits< size_t >::max()) override
Copy a Fragment to the destination. May be unreliable.
ShmemTransfer(fhicl::ParameterSet const &pset, Role role)
ShmemTransfer Constructor.
virtual ~ShmemTransfer() noexcept
ShmemTransfer Destructor.
Role
Used to determine if a TransferInterface is a Sender or Receiver.
A TransferInterface implementation plugin that transfers data using Shared Memory.
This interface defines the functions used to transfer data between artdaq applications.
int receiveFragment(Fragment &fragment, size_t receiveTimeout) override
Receive a Fragment from Shared Memory.
CopyStatus
Returned from the send functions, this enumeration describes the possible return codes. If an exception occurs, it will be thrown and should be handled normally.