artdaq
v2_03_02
|
This interface defines the functions used to transfer data between artdaq applications. More...
#include <artdaq/TransferPlugins/TransferInterface.hh>
Public Types | |
enum | Role { Role::kSend, Role::kReceive } |
Used to determine if a TransferInterface is a Sender or Receiver. More... | |
enum | CopyStatus { CopyStatus::kSuccess, CopyStatus::kTimeout, CopyStatus::kErrorNotRequiringException } |
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. More... | |
Public Member Functions | |
TransferInterface (const fhicl::ParameterSet &ps, Role role) | |
TransferInterface Constructor. More... | |
TransferInterface (const TransferInterface &)=delete | |
Copy Constructor is deleted. | |
TransferInterface & | operator= (const TransferInterface &)=delete |
Copy Assignment operator is deleted. More... | |
virtual | ~TransferInterface ()=default |
Default virtual Destructor. | |
virtual int | receiveFragment (artdaq::Fragment &fragment, size_t receiveTimeout)=0 |
Receive a Fragment from the transport mechanism. More... | |
virtual CopyStatus | copyFragment (artdaq::Fragment &fragment, size_t send_timeout_usec=std::numeric_limits< size_t >::max())=0 |
Copy a Fragment to the destination. May not necessarily be reliable. More... | |
virtual CopyStatus | moveFragment (artdaq::Fragment &&fragment, size_t send_timeout_usec=std::numeric_limits< size_t >::max())=0 |
Move a Fragment to the destination. This should be reliable, if the underlying transport mechanism supports reliable sending. More... | |
std::string | uniqueLabel () const |
Get the unique label of this TransferInterface instance. More... | |
virtual int | source_rank () const |
Get the source rank for this TransferInterface instance. More... | |
virtual int | destination_rank () const |
Get the destination rank for this TransferInterface instance. More... | |
Static Public Attributes | |
static const int | RECV_TIMEOUT = 0xfedcba98 |
Value to be returned upon receive timeout. Because receivers otherwise return rank, this is also the limit on the number of ranks that artdaq currently supports. | |
Protected Member Functions | |
Role | role () const |
Get the TransferInterface::Role of this TransferInterface. More... | |
Protected Attributes | |
size_t | buffer_count_ |
The number of Fragment transfers the TransferInterface can handle simultaneously. | |
const size_t | max_fragment_size_words_ |
The maximum size of the transferred Fragment objects, in artdaq::Fragment::RawDataType words. | |
This interface defines the functions used to transfer data between artdaq applications.
Definition at line 17 of file TransferInterface.hh.
|
strong |
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.
Enumerator | |
---|---|
kSuccess |
The send operation completed successfully. |
kTimeout |
The send operation timed out. |
kErrorNotRequiringException |
Some error occurred, but no exception was thrown. |
Definition at line 39 of file TransferInterface.hh.
|
strong |
Used to determine if a TransferInterface is a Sender or Receiver.
Enumerator | |
---|---|
kSend |
This TransferInterface is a Sender. |
kReceive |
This TransferInterface is a Receiver. |
Definition at line 29 of file TransferInterface.hh.
artdaq::TransferInterface::TransferInterface | ( | const fhicl::ParameterSet & | ps, |
Role | role | ||
) |
TransferInterface Constructor.
ps | ParameterSet used for configuring the TransferInterface |
role | Role of the TransferInterface (See TransferInterface::Role) |
* TransferInterface accepts the following Parameters: * "source_rank" (Default: my_rank): The rank that data is coming from * "destination_rank" (Default: my_rank): The rank that data is going to * "unique_label" (Default: "transfer_between_[source_rank]_and_[destination_rank]"): A label that uniquely identifies the TransferInterface instance * "buffer_count" (Default: 10): How many Fragments can the TransferInterface handle simultaneously * "max_fragment_size_words" (Default: 1024): The maximum Fragment size expected. May be used for static memory allocation, and will cause errors * if larger Fragments are sent. *
Definition at line 3 of file TransferInterface.cc.
|
pure virtual |
Copy a Fragment to the destination. May not necessarily be reliable.
fragment | Fragment to copy |
send_timeout_usec | Timeout for send, in microseconds |
Implemented in artdaq::MulticastTransfer, artdaq::RTIDDSTransfer, artdaq::AutodetectTransfer, and artdaq::NullTransfer.
|
inlinevirtual |
Get the destination rank for this TransferInterface instance.
Definition at line 121 of file TransferInterface.hh.
|
pure virtual |
Move a Fragment to the destination. This should be reliable, if the underlying transport mechanism supports reliable sending.
fragment | Fragment to move |
send_timeout_usec | Timeout for send, in microseconds |
Implemented in artdaq::MulticastTransfer, artdaq::RTIDDSTransfer, artdaq::AutodetectTransfer, and artdaq::NullTransfer.
|
delete |
Copy Assignment operator is deleted.
|
pure virtual |
Receive a Fragment from the transport mechanism.
[out] | fragment | Received Fragment |
receiveTimeout | Timeout for receive |
This is a pure virtual function, derived classes should override it
Implemented in artdaq::MulticastTransfer, artdaq::RTIDDSTransfer, artdaq::AutodetectTransfer, and artdaq::NullTransfer.
|
inlineprotected |
Get the TransferInterface::Role of this TransferInterface.
Definition at line 137 of file TransferInterface.hh.
|
inlinevirtual |
Get the source rank for this TransferInterface instance.
Definition at line 116 of file TransferInterface.hh.
|
inline |
Get the unique label of this TransferInterface instance.
Definition at line 110 of file TransferInterface.hh.