lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Drp::Pebble Class Reference

One page-aligned allocation holding the L1Accept buffers followed by the transition buffers; each buffer ends with a sentinel word used to detect overruns. More...

#include <drp.hh>

Public Member Functions

 ~Pebble ()
 Release the allocation with delete if it is non-null.
 
void create (unsigned nL1Buffers, size_t l1BufSize, unsigned nTrBuffers, size_t trBufSize)
 Allocate nL1Buffers buffers of l1BufSize bytes and nTrBuffers buffers of trBufSize bytes (each size rounded up to 16 bytes, each pool rounded up to whole pages plus one extra page) and write sentinel words (0xcdcdcdcd for L1Accept, 0xefefefef for transitions) at the end of every buffer and after each pool.
 
uint8_t * operator[] (unsigned index)
 Return the address of L1Accept buffer index.
 
unsigned index (void *buffer) const
 Return the index of the L1Accept buffer that contains buffer.
 
size_t size () const
 Return the total allocation size in bytes.
 
uint8_t * buffer () const
 Return the start of the L1Accept buffer pool.
 
size_t bufferSize () const
 Return the size of one L1Accept buffer (rounded up to 16 bytes).
 
size_t trBufSize () const
 Return the size of one transition buffer (rounded up to 16 bytes).
 
uint8_t * trBuffer () const
 Return the start of the transition buffer pool.
 
unsigned nTrBuffers () const
 Return the number of transition buffers.
 
unsigned nL1Buffers () const
 Return the number of L1Accept buffers.
 

Detailed Description

One page-aligned allocation holding the L1Accept buffers followed by the transition buffers; each buffer ends with a sentinel word used to detect overruns.

Constructor & Destructor Documentation

◆ ~Pebble()

Drp::Pebble::~Pebble ( )
inline

Release the allocation with delete if it is non-null.

Note that create() allocates it with posix_memalign().

Member Function Documentation

◆ buffer()

uint8_t * Drp::Pebble::buffer ( ) const
inline

Return the start of the L1Accept buffer pool.

◆ bufferSize()

size_t Drp::Pebble::bufferSize ( ) const
inline

Return the size of one L1Accept buffer (rounded up to 16 bytes).

◆ create()

void Drp::Pebble::create ( unsigned  nL1Buffers,
size_t  l1BufSize,
unsigned  nTrBuffers,
size_t  trBufSize 
)

Allocate nL1Buffers buffers of l1BufSize bytes and nTrBuffers buffers of trBufSize bytes (each size rounded up to 16 bytes, each pool rounded up to whole pages plus one extra page) and write sentinel words (0xcdcdcdcd for L1Accept, 0xefefefef for transitions) at the end of every buffer and after each pool.

Throws a C string if the allocation fails.

◆ index()

unsigned Drp::Pebble::index ( void *  buffer) const
inline

Return the index of the L1Accept buffer that contains buffer.

◆ nL1Buffers()

unsigned Drp::Pebble::nL1Buffers ( ) const
inline

Return the number of L1Accept buffers.

◆ nTrBuffers()

unsigned Drp::Pebble::nTrBuffers ( ) const
inline

Return the number of transition buffers.

◆ operator[]()

uint8_t * Drp::Pebble::operator[] ( unsigned  index)
inline

Return the address of L1Accept buffer index.

◆ size()

size_t Drp::Pebble::size ( ) const
inline

Return the total allocation size in bytes.

◆ trBuffer()

uint8_t * Drp::Pebble::trBuffer ( ) const
inline

Return the start of the transition buffer pool.

◆ trBufSize()

size_t Drp::Pebble::trBufSize ( ) const
inline

Return the size of one transition buffer (rounded up to 16 bytes).


The documentation for this class was generated from the following file: