CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
InputChunk Struct Reference

#include <FedRawDataInputSource.h>

Public Member Functions

 InputChunk (uint64_t size)
 
void reset (uint64_t newOffset, uint64_t toRead, unsigned int fileIndex)
 
bool resize (uint64_t wantedSize, uint64_t maxSize)
 
 ~InputChunk ()
 

Public Attributes

unsigned char * buf_
 
unsigned int fileIndex_
 
InputChunknext_ = nullptr
 
uint64_t offset_
 
std::atomic< bool > readComplete_
 
uint64_t size_
 
uint64_t usedSize_ = 0
 

Detailed Description

Definition at line 188 of file FedRawDataInputSource.h.

Constructor & Destructor Documentation

◆ InputChunk()

InputChunk::InputChunk ( uint64_t  size)
inline

Definition at line 198 of file FedRawDataInputSource.h.

References buf_, reset(), and size_.

198  : size_(size) {
199  buf_ = new unsigned char[size_];
200  reset(0, 0, 0);
201  }
size
Write out results.
void reset(uint64_t newOffset, uint64_t toRead, unsigned int fileIndex)
unsigned char * buf_

◆ ~InputChunk()

InputChunk::~InputChunk ( )
inline

Definition at line 220 of file FedRawDataInputSource.h.

References buf_.

220 { delete[] buf_; }
unsigned char * buf_

Member Function Documentation

◆ reset()

void InputChunk::reset ( uint64_t  newOffset,
uint64_t  toRead,
unsigned int  fileIndex 
)
inline

Definition at line 202 of file FedRawDataInputSource.h.

References fileIndex_, offset_, readComplete_, and usedSize_.

Referenced by InputChunk(), FedRawDataInputSource::readSupervisor(), and DAQSource::readSupervisor().

202  {
203  offset_ = newOffset;
204  usedSize_ = toRead;
205  fileIndex_ = fileIndex;
206  readComplete_ = false;
207  }
unsigned int fileIndex_
std::atomic< bool > readComplete_

◆ resize()

bool InputChunk::resize ( uint64_t  wantedSize,
uint64_t  maxSize 
)
inline

Definition at line 209 of file FedRawDataInputSource.h.

References buf_, reco_skim_cfg_mod::maxSize, and size_.

Referenced by DAQSource::readWorker().

209  {
210  if (wantedSize > maxSize)
211  return false;
212  if (size_ < wantedSize) {
213  size_ = uint64_t(wantedSize * 1.05);
214  delete[] buf_;
215  buf_ = new unsigned char[size_];
216  }
217  return true;
218  }
unsigned char * buf_
unsigned long long uint64_t
Definition: Time.h:13

Member Data Documentation

◆ buf_

unsigned char* InputChunk::buf_

◆ fileIndex_

unsigned int InputChunk::fileIndex_

◆ next_

InputChunk* InputChunk::next_ = nullptr

Definition at line 190 of file FedRawDataInputSource.h.

◆ offset_

uint64_t InputChunk::offset_

◆ readComplete_

std::atomic<bool> InputChunk::readComplete_

◆ size_

uint64_t InputChunk::size_

Definition at line 191 of file FedRawDataInputSource.h.

Referenced by InputChunk(), DAQSource::readWorker(), and resize().

◆ usedSize_

uint64_t InputChunk::usedSize_ = 0