|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Owns the page-aligned region in which batches are built and decides when a batch has expired. More...
#include <BatchManager.hh>
Public Member Functions | |
| BatchManager () | |
| Construct with no region. | |
| ~BatchManager () | |
| Free the region. | |
| int | initialize (size_t maxEntrySize, unsigned maxEntries, unsigned numBatches) |
| Reallocate the region for numBatches batches of maxEntries entries of maxEntrySize bytes if that total size changed, and set the expiration mask from maxEntries. | |
| void | shutdown () |
| Zero the whole region; it is not freed. | |
| void * | fetch (unsigned idx) const |
| Return the address of entry idx: the region start plus idx times the entry size. | |
| void * | batchRegion () const |
| Return the start of the region. | |
| size_t | batchRegionSize () const |
| Return the size of the region in bytes. | |
| bool | expired (uint64_t pid, uint64_t start) const |
| Return true if pid and start differ in any bit above the low log2(maxEntries) bits, that is, if they lie in different batch periods. | |
| void | dump () const |
| Print the region base, region size, maximum batch size and entry size to stderr. | |
Owns the page-aligned region in which batches are built and decides when a batch has expired.
| Pds::Eb::BatchManager::BatchManager | ( | ) |
Construct with no region.
| Pds::Eb::BatchManager::~BatchManager | ( | ) |
Free the region.
|
inline |
Return the start of the region.
|
inline |
Return the size of the region in bytes.
| void Pds::Eb::BatchManager::dump | ( | ) | const |
Print the region base, region size, maximum batch size and entry size to stderr.
|
inline |
Return true if pid and start differ in any bit above the low log2(maxEntries) bits, that is, if they lie in different batch periods.
|
inline |
Return the address of entry idx: the region start plus idx times the entry size.
| int Pds::Eb::BatchManager::initialize | ( | size_t | maxEntrySize, |
| unsigned | maxEntries, | ||
| unsigned | numBatches | ||
| ) |
Reallocate the region for numBatches batches of maxEntries entries of maxEntrySize bytes if that total size changed, and set the expiration mask from maxEntries.
Returns 0, 1 if maxEntries is not a power of 2, or ENOMEM if allocation fails.
| void Pds::Eb::BatchManager::shutdown | ( | ) |
Zero the whole region; it is not freed.