|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Growable array of struct iovec entries plus one memory-region descriptor per entry, for vectored libfabric calls. More...
#include <Endpoint.hh>
Public Member Functions | |
| LocalIOVec (size_t count=1) | |
| Construct an empty vector (count() is 0) with capacity for count entries. | |
| LocalIOVec (LocalAddress *local_addrs, size_t count) | |
| Construct from an array of count LocalAddress objects, copying each iovec and, where a MemoryRegion is set, its descriptor. | |
| LocalIOVec (const std::vector< LocalAddress * > &local_addrs) | |
| Construct from a vector of LocalAddress pointers, copying each iovec and, where a MemoryRegion is set, its descriptor. | |
| ~LocalIOVec () | |
| Free the iovec and descriptor arrays. | |
| void | reset () |
| Set count() to 0 and set the all-descriptors-present flag; the capacity is kept. | |
| bool | check_mr () |
| Return the cached flag that says every entry has a memory-region descriptor. | |
| size_t | count () const |
| Return the number of entries in use. | |
| const struct iovec * | iovecs () const |
| Return the iovec array. | |
| void ** | desc () const |
| Return the descriptor array (one entry per iovec). | |
| void * | allocate () |
| Grow the capacity by one if needed and return a pointer to the next unused iovec, incrementing count(). | |
| bool | add_iovec (LocalAddress *local_addr, size_t count=1) |
| Append count entries from the LocalAddress array local_addr, copying descriptors where a MemoryRegion is set. | |
| bool | add_iovec (std::vector< LocalAddress * > &local_addr) |
| Append one entry per LocalAddress in the vector, copying descriptors where a MemoryRegion is set; always returns true. | |
| bool | add_iovec (void *buf, size_t len, MemoryRegion *mr=NULL) |
| Append one entry for buf and len, recording the descriptor of mr when mr is given; always returns true. | |
| bool | set_count (size_t count) |
| Set count() to count; returns false without a change if count is not less than the current capacity. | |
| bool | set_iovec (unsigned index, LocalAddress *local_addr) |
| Overwrite entry index from local_addr, including its descriptor if it has a MemoryRegion (otherwise check_mr() becomes false). | |
| bool | set_iovec (unsigned index, void *buf, size_t len, MemoryRegion *mr=NULL) |
| Overwrite entry index with buf and len and, if mr is given, its descriptor (otherwise check_mr() becomes false). | |
| bool | set_iovec_mr (unsigned index, MemoryRegion *mr) |
| Set the descriptor of entry index from mr; returns false if index is not less than the capacity or mr is NULL. | |
Growable array of struct iovec entries plus one memory-region descriptor per entry, for vectored libfabric calls.
| Pds::Fabrics::LocalIOVec::LocalIOVec | ( | size_t | count = 1 | ) |
Construct an empty vector (count() is 0) with capacity for count entries.
| Pds::Fabrics::LocalIOVec::LocalIOVec | ( | LocalAddress * | local_addrs, |
| size_t | count | ||
| ) |
Construct from an array of count LocalAddress objects, copying each iovec and, where a MemoryRegion is set, its descriptor.
If local_addrs is NULL, count() is still count but the entries are not filled and check_mr() is false.
| Pds::Fabrics::LocalIOVec::LocalIOVec | ( | const std::vector< LocalAddress * > & | local_addrs | ) |
Construct from a vector of LocalAddress pointers, copying each iovec and, where a MemoryRegion is set, its descriptor.
| Pds::Fabrics::LocalIOVec::~LocalIOVec | ( | ) |
Free the iovec and descriptor arrays.
| bool Pds::Fabrics::LocalIOVec::add_iovec | ( | LocalAddress * | local_addr, |
| size_t | count = 1 |
||
| ) |
Append count entries from the LocalAddress array local_addr, copying descriptors where a MemoryRegion is set.
Returns false if local_addr is NULL (the capacity may still have grown), otherwise true.
| bool Pds::Fabrics::LocalIOVec::add_iovec | ( | std::vector< LocalAddress * > & | local_addr | ) |
Append one entry per LocalAddress in the vector, copying descriptors where a MemoryRegion is set; always returns true.
| bool Pds::Fabrics::LocalIOVec::add_iovec | ( | void * | buf, |
| size_t | len, | ||
| MemoryRegion * | mr = NULL |
||
| ) |
Append one entry for buf and len, recording the descriptor of mr when mr is given; always returns true.
| void * Pds::Fabrics::LocalIOVec::allocate | ( | ) |
Grow the capacity by one if needed and return a pointer to the next unused iovec, incrementing count().
The descriptor of that entry is not set.
| bool Pds::Fabrics::LocalIOVec::check_mr | ( | ) |
Return the cached flag that says every entry has a memory-region descriptor.
| size_t Pds::Fabrics::LocalIOVec::count | ( | ) | const |
Return the number of entries in use.
| void ** Pds::Fabrics::LocalIOVec::desc | ( | ) | const |
Return the descriptor array (one entry per iovec).
| const struct iovec * Pds::Fabrics::LocalIOVec::iovecs | ( | ) | const |
Return the iovec array.
| void Pds::Fabrics::LocalIOVec::reset | ( | ) |
Set count() to 0 and set the all-descriptors-present flag; the capacity is kept.
| bool Pds::Fabrics::LocalIOVec::set_count | ( | size_t | count | ) |
Set count() to count; returns false without a change if count is not less than the current capacity.
| bool Pds::Fabrics::LocalIOVec::set_iovec | ( | unsigned | index, |
| LocalAddress * | local_addr | ||
| ) |
Overwrite entry index from local_addr, including its descriptor if it has a MemoryRegion (otherwise check_mr() becomes false).
Returns false if index is not less than the capacity.
| bool Pds::Fabrics::LocalIOVec::set_iovec | ( | unsigned | index, |
| void * | buf, | ||
| size_t | len, | ||
| MemoryRegion * | mr = NULL |
||
| ) |
Overwrite entry index with buf and len and, if mr is given, its descriptor (otherwise check_mr() becomes false).
Returns false if index is not less than the capacity.
| bool Pds::Fabrics::LocalIOVec::set_iovec_mr | ( | unsigned | index, |
| MemoryRegion * | mr | ||
| ) |
Set the descriptor of entry index from mr; returns false if index is not less than the capacity or mr is NULL.