#include <Sorter.h>
Public Member Functions | |
Sorter (unsigned maxinpbuf=1024, unsigned intern_out_buf=1024, int intern_out_fmt=roc::formatNormal, unsigned intbuf=128) | |
virtual | ~Sorter () |
bool | isInternData () const |
bool | addData (void *data, unsigned datalen, int fmt, bool flush_data=false) |
bool | flush () |
void | cleanBuffers () |
unsigned | sizeFilled () const |
void * | filledBuf () const |
bool | shiftFilledData (unsigned num) |
bool | startFill (void *buf, unsigned totalsize, int fmt=formatNormal) |
void | stopFill () |
Protected Types | |
enum | TimesConstants { tmLastValid = 0x3fffffff, tmEmpty = tmLastValid + 100, tmFailure = tmLastValid + 200, tmBoundary = 0x8100, tmFrontShift = 0x10000000 } |
Protected Member Functions | |
bool | flushBuffer (void *data, unsigned num_msg, int fmt, bool force=false) |
bool | checkLastEpoch (roc::Message *data, unsigned indx, const roc::Iterator &iter) |
Protected Attributes | |
unsigned | fRocId |
unsigned | fIntBufMaxSize |
unsigned | fExtBufMaxSize |
Message * | fIntBuf |
uint32_t * | fIntBufTimes |
unsigned | fIntBufSize |
uint32_t | fIntBufFrontEpoch |
bool | fIsIntBufFrontEpoch |
uint32_t | fIntBufCurrEpoch |
uint32_t | fIntBufCurrRealEpoch |
uint32_t | fIntBuffCurrMaxTm |
unsigned | fAccumMissed |
uint32_t | fLastOutEpoch |
void * | fFillBuffer |
unsigned | fFillTotalSize |
unsigned | fFillSize |
int | fFillFormat |
void * | fInternOutBuf |
unsigned | fInternOutBufSize |
int | fInternOutFormat |
Definition at line 10 of file Sorter.h.
enum roc::Sorter::TimesConstants [protected] |
roc::Sorter::Sorter | ( | unsigned | maxinpbuf = 1024 , |
|
unsigned | intern_out_buf = 1024 , |
|||
int | intern_out_fmt = roc::formatNormal , |
|||
unsigned | intbuf = 128 | |||
) | [explicit] |
Definition at line 9 of file Sorter.cxx.
References fAccumMissed, fExtBufMaxSize, fFillBuffer, fFillFormat, fFillSize, fFillTotalSize, fIntBuf, fIntBufCurrEpoch, fIntBufCurrRealEpoch, fIntBuffCurrMaxTm, fIntBufFrontEpoch, fIntBufMaxSize, fIntBufSize, fIntBufTimes, fInternOutBuf, fInternOutBufSize, fInternOutFormat, fIsIntBufFrontEpoch, fLastOutEpoch, fRocId, and roc::Message::RawSize().
roc::Sorter::~Sorter | ( | ) | [virtual] |
Definition at line 42 of file Sorter.cxx.
References fIntBuf, fIntBufTimes, and fInternOutBuf.
bool roc::Sorter::addData | ( | void * | data, | |
unsigned | datalen, | |||
int | fmt, | |||
bool | flush_data = false | |||
) |
Definition at line 162 of file Sorter.cxx.
References roc::Message::assign(), roc::Iterator::assign(), checkLastEpoch(), fFillBuffer, fIntBuf, fIntBufCurrEpoch, fIntBufCurrRealEpoch, fIntBuffCurrMaxTm, fIntBufFrontEpoch, fIntBufMaxSize, fIntBufSize, fIntBufTimes, fIsIntBufFrontEpoch, flushBuffer(), fRocId, roc::Message::getAuxEpochLSB(), roc::Message::getAuxTs(), roc::Message::getEpochNumber(), roc::Message::getMessageType(), roc::Message::getNxLastEpoch(), roc::Message::getNxTs(), roc::Message::getRocNumber(), roc::Message::getSyncEpochLSB(), roc::Message::getSyncTs(), roc::Message::isStopDaqMsg(), roc::Iterator::msg(), roc::MSG_AUX, roc::MSG_EPOCH, roc::MSG_HIT, roc::MSG_SYNC, roc::MSG_SYS, roc::Iterator::next(), roc::Message::RawSize(), tmBoundary, tmFrontShift, and tmLastValid.
bool roc::Sorter::checkLastEpoch | ( | roc::Message * | data, | |
unsigned | indx, | |||
const roc::Iterator & | iter | |||
) | [protected] |
Definition at line 99 of file Sorter.cxx.
References fIntBuf, fIntBufCurrEpoch, fIntBufSize, fIntBufTimes, roc::Message::getNxChNum(), roc::Message::getNxNumber(), roc::Message::getNxTs(), roc::Message::isHitMsg(), roc::Iterator::msg(), and roc::Iterator::prev().
Referenced by addData().
void roc::Sorter::cleanBuffers | ( | ) |
Definition at line 71 of file Sorter.cxx.
References fAccumMissed, fFillSize, fIntBufCurrEpoch, fIntBufCurrRealEpoch, fIntBuffCurrMaxTm, fIntBufFrontEpoch, fIntBufSize, fIsIntBufFrontEpoch, and fLastOutEpoch.
void* roc::Sorter::filledBuf | ( | ) | const [inline] |
Definition at line 69 of file Sorter.h.
References fFillBuffer.
bool roc::Sorter::flush | ( | ) | [inline] |
Definition at line 61 of file Sorter.h.
References flushBuffer(), and roc::formatNormal.
bool roc::Sorter::flushBuffer | ( | void * | data, | |
unsigned | num_msg, | |||
int | fmt, | |||
bool | force = false | |||
) | [protected] |
Definition at line 316 of file Sorter.cxx.
References roc::Iterator::assign(), roc::Message::assign(), roc::Message::copyto(), fAccumMissed, fExtBufMaxSize, fFillBuffer, fFillFormat, fFillSize, fFillTotalSize, fIntBuf, fIntBufFrontEpoch, fIntBufMaxSize, fIntBufSize, fIntBufTimes, fLastOutEpoch, fRocId, roc::Message::getEpochMissed(), roc::Message::getMessageType(), roc::Message::isAuxMsg(), roc::Message::isHitMsg(), roc::Message::isSyncMsg(), roc::Iterator::msg(), roc::MSG_AUX, roc::MSG_EPOCH, roc::MSG_HIT, roc::MSG_NOP, roc::MSG_SYNC, roc::MSG_SYS, roc::Iterator::next(), roc::Message::RawSize(), roc::Message::setAuxEpochLSB(), roc::Message::setEpochMissed(), roc::Message::setEpochNumber(), roc::Message::setMessageType(), roc::Message::setNxLastEpoch(), roc::Message::setRocNumber(), roc::Message::setSyncEpochLSB(), tmBoundary, and tmLastValid.
bool roc::Sorter::isInternData | ( | ) | const [inline] |
Definition at line 54 of file Sorter.h.
References fIntBufSize.
bool roc::Sorter::shiftFilledData | ( | unsigned | num | ) |
Definition at line 507 of file Sorter.cxx.
References fFillBuffer, fFillFormat, fFillSize, and roc::Message::RawSize().
unsigned roc::Sorter::sizeFilled | ( | ) | const [inline] |
bool roc::Sorter::startFill | ( | void * | buf, | |
unsigned | totalsize, | |||
int | fmt = formatNormal | |||
) |
Definition at line 49 of file Sorter.cxx.
References fFillBuffer, fFillFormat, fFillSize, fFillTotalSize, and roc::Message::RawSize().
void roc::Sorter::stopFill | ( | ) |
Definition at line 91 of file Sorter.cxx.
References fFillBuffer, fFillFormat, fFillSize, fFillTotalSize, fInternOutBuf, fInternOutBufSize, and fInternOutFormat.
unsigned roc::Sorter::fAccumMissed [protected] |
Definition at line 30 of file Sorter.h.
Referenced by cleanBuffers(), flushBuffer(), and Sorter().
unsigned roc::Sorter::fExtBufMaxSize [protected] |
Definition at line 19 of file Sorter.h.
Referenced by flushBuffer(), and Sorter().
void* roc::Sorter::fFillBuffer [protected] |
Definition at line 33 of file Sorter.h.
Referenced by addData(), filledBuf(), flushBuffer(), shiftFilledData(), Sorter(), startFill(), and stopFill().
int roc::Sorter::fFillFormat [protected] |
Definition at line 36 of file Sorter.h.
Referenced by flushBuffer(), shiftFilledData(), Sorter(), startFill(), and stopFill().
unsigned roc::Sorter::fFillSize [protected] |
Definition at line 35 of file Sorter.h.
Referenced by cleanBuffers(), flushBuffer(), shiftFilledData(), sizeFilled(), Sorter(), startFill(), and stopFill().
unsigned roc::Sorter::fFillTotalSize [protected] |
Definition at line 34 of file Sorter.h.
Referenced by flushBuffer(), Sorter(), startFill(), and stopFill().
Message* roc::Sorter::fIntBuf [protected] |
Definition at line 21 of file Sorter.h.
Referenced by addData(), checkLastEpoch(), flushBuffer(), Sorter(), and ~Sorter().
uint32_t roc::Sorter::fIntBufCurrEpoch [protected] |
Definition at line 26 of file Sorter.h.
Referenced by addData(), checkLastEpoch(), cleanBuffers(), and Sorter().
uint32_t roc::Sorter::fIntBufCurrRealEpoch [protected] |
Definition at line 27 of file Sorter.h.
Referenced by addData(), cleanBuffers(), and Sorter().
uint32_t roc::Sorter::fIntBuffCurrMaxTm [protected] |
Definition at line 28 of file Sorter.h.
Referenced by addData(), cleanBuffers(), and Sorter().
uint32_t roc::Sorter::fIntBufFrontEpoch [protected] |
Definition at line 24 of file Sorter.h.
Referenced by addData(), cleanBuffers(), flushBuffer(), and Sorter().
unsigned roc::Sorter::fIntBufMaxSize [protected] |
Definition at line 18 of file Sorter.h.
Referenced by addData(), flushBuffer(), and Sorter().
unsigned roc::Sorter::fIntBufSize [protected] |
Definition at line 23 of file Sorter.h.
Referenced by addData(), checkLastEpoch(), cleanBuffers(), flushBuffer(), isInternData(), and Sorter().
uint32_t* roc::Sorter::fIntBufTimes [protected] |
Definition at line 22 of file Sorter.h.
Referenced by addData(), checkLastEpoch(), flushBuffer(), Sorter(), and ~Sorter().
void* roc::Sorter::fInternOutBuf [protected] |
Definition at line 38 of file Sorter.h.
Referenced by Sorter(), stopFill(), and ~Sorter().
unsigned roc::Sorter::fInternOutBufSize [protected] |
Definition at line 39 of file Sorter.h.
Referenced by Sorter(), and stopFill().
int roc::Sorter::fInternOutFormat [protected] |
Definition at line 40 of file Sorter.h.
Referenced by Sorter(), and stopFill().
bool roc::Sorter::fIsIntBufFrontEpoch [protected] |
Definition at line 25 of file Sorter.h.
Referenced by addData(), cleanBuffers(), and Sorter().
uint32_t roc::Sorter::fLastOutEpoch [protected] |
Definition at line 31 of file Sorter.h.
Referenced by cleanBuffers(), flushBuffer(), and Sorter().
unsigned roc::Sorter::fRocId [protected] |
Definition at line 16 of file Sorter.h.
Referenced by addData(), flushBuffer(), and Sorter().