#include <Iterator.h>
Public Member Functions | |
Iterator (int fmt=formatSpadic10Optic) | |
~Iterator () | |
void | setFormat (int fmt) |
int | getFormat () const |
void | setBoardId (unsigned id) |
void | resetBoardId () |
bool | isBoardId () const |
unsigned | getBoardId () const |
bool | assign (void *buf, unsigned sz) |
bool | nextBuffer (sp605::Board *brd, double tmout=1.) |
bool | next (double tmout=1.) |
bool | at_the_end () const |
bool | isSpadicMsg () const |
sp605::Message & | msg () |
void | setSpadicId (unsigned id) |
unsigned | getSpadicId () const |
bool | isRocMsg () const |
roc::Message & | rocmsg () |
uint64_t | getMsgFullTime () const |
double | getMsgFullTimeD () const |
void | printMessage () |
Protected Types | |
enum | IteratorMessageKind { kindNone, kindRoc, kindSpadic } |
enum | { MaxGroupId = 2, MaxSpadicId = 4 } |
Protected Member Functions | |
void | allocateInterm () |
Protected Attributes | |
sp605::Board * | fBoard |
pointer on board object - source of buffers | |
int | fFormat |
format of data in binary buffer | |
void * | fBuffer |
assigned buffer | |
unsigned | fBufferLen |
length of assigned buffer | |
unsigned | fBufferPos |
current position | |
void * | fInterm |
intermediate memory for messages | |
unsigned | fIntermSize |
allocated size of intermediate memory | |
unsigned | fIntermFill |
filled number of bytes in intermediate buffer | |
unsigned | fSP605Id |
current identifier of the SP605 board | |
IteratorMessageKind | fKind |
kind of the current message | |
sp605::Message | fMsg |
content of current message | |
unsigned | fLastEpoch [MaxSpadicId][MaxGroupId] |
value of last epoch for each spadic/group id combination | |
unsigned | fLastSenderId |
last id, that was taken from buffer in intermediate buffer | |
unsigned | fSpadicId |
current id of spadic chip | |
roc::Message | fRocMsg |
roc message, used to decode SYNC/AUX/SYS messages | |
unsigned | fLastRocEpoch |
last seen ROC epoch |
Definition at line 12 of file Iterator.h.
anonymous enum [protected] |
Definition at line 17 of file Iterator.h.
enum sp605::Iterator::IteratorMessageKind [protected] |
Definition at line 15 of file Iterator.h.
sp605::Iterator::Iterator | ( | int | fmt = formatSpadic10Optic |
) |
Definition at line 9 of file Iterator.cxx.
References fLastEpoch.
sp605::Iterator::~Iterator | ( | ) |
Definition at line 30 of file Iterator.cxx.
References fInterm.
void sp605::Iterator::allocateInterm | ( | ) | [protected] |
Definition at line 60 of file Iterator.cxx.
References fInterm, fIntermFill, and fIntermSize.
Referenced by next().
bool sp605::Iterator::assign | ( | void * | buf, | |
unsigned | sz | |||
) |
Assigns directly raw buffer
Definition at line 35 of file Iterator.cxx.
References fBuffer, fBufferLen, fBufferPos, and fKind.
Referenced by main(), and nextBuffer().
bool sp605::Iterator::at_the_end | ( | ) | const [inline] |
Check if current buffer is at the end
Definition at line 67 of file Iterator.h.
References fBufferLen, and fBufferPos.
unsigned sp605::Iterator::getBoardId | ( | ) | const [inline] |
Definition at line 55 of file Iterator.h.
References fSP605Id, and isBoardId().
int sp605::Iterator::getFormat | ( | ) | const [inline] |
Definition at line 50 of file Iterator.h.
References fFormat.
uint64_t sp605::Iterator::getMsgFullTime | ( | ) | const |
Time, returned in nanoseconds
Definition at line 262 of file Iterator.cxx.
References fLastEpoch, fLastRocEpoch, fMsg, fRocMsg, sp605::Message::getGroup(), sp605::Message::getMsgFullTime(), roc::Message::getMsgFullTime(), sp605::Message::getSpadicNumber(), isRocMsg(), and isSpadicMsg().
double sp605::Iterator::getMsgFullTimeD | ( | ) | const |
Definition at line 270 of file Iterator.cxx.
References fLastEpoch, fLastRocEpoch, fMsg, fRocMsg, sp605::Message::getGroup(), sp605::Message::getMsgFullTimeD(), roc::Message::getMsgFullTimeD(), sp605::Message::getSpadicNumber(), isRocMsg(), and isSpadicMsg().
unsigned sp605::Iterator::getSpadicId | ( | ) | const [inline] |
bool sp605::Iterator::isBoardId | ( | ) | const [inline] |
bool sp605::Iterator::isRocMsg | ( | ) | const [inline] |
Specific for ROC message methods
Definition at line 79 of file Iterator.h.
References fKind.
Referenced by getMsgFullTime(), getMsgFullTimeD(), and printMessage().
bool sp605::Iterator::isSpadicMsg | ( | ) | const [inline] |
Specific for Spadic message methods
Definition at line 71 of file Iterator.h.
References fKind.
Referenced by getMsgFullTime(), getMsgFullTimeD(), and printMessage().
sp605::Message& sp605::Iterator::msg | ( | ) | [inline] |
Definition at line 72 of file Iterator.h.
References fMsg.
bool sp605::Iterator::next | ( | double | tmout = 1. |
) |
Extract next message from the buffer
Definition at line 70 of file Iterator.cxx.
References allocateInterm(), roc::Message::assign(), sp605::Message::assign(), fBoard, fBuffer, fBufferLen, fBufferPos, fFormat, fInterm, fIntermFill, fIntermSize, fKind, fLastEpoch, fLastRocEpoch, fLastSenderId, fMsg, roc::formatOptic2, sp605::formatSpadic10Direct, sp605::formatSpadic10Optic, fRocMsg, fSP605Id, sp605::Message::getEpoch(), roc::Message::getEpochNumber(), sp605::Message::getGroup(), getSpadicId(), sp605::Message::getSpadicNumber(), sp605::Message::isEpoch(), roc::Message::isEpochMsg(), kindNone, nextBuffer(), roc::Message::setRocNumber(), setSpadicId(), and sp605::Message::setSpadicNumber().
Referenced by main().
bool sp605::Iterator::nextBuffer | ( | sp605::Board * | brd, | |
double | tmout = 1. | |||
) |
Extract next buffer from the board
Definition at line 45 of file Iterator.cxx.
References assign(), fFormat, base::Board::getMsgFormat(), and base::Board::getNextBuffer().
Referenced by next().
void sp605::Iterator::printMessage | ( | ) |
Definition at line 278 of file Iterator.cxx.
References fMsg, fRocMsg, isRocMsg(), isSpadicMsg(), sp605::Message::printData(), and roc::Message::printData().
Referenced by main().
void sp605::Iterator::resetBoardId | ( | ) | [inline] |
Definition at line 53 of file Iterator.h.
References fSP605Id.
roc::Message& sp605::Iterator::rocmsg | ( | ) | [inline] |
Definition at line 80 of file Iterator.h.
References fRocMsg.
void sp605::Iterator::setBoardId | ( | unsigned | id | ) | [inline] |
Definition at line 52 of file Iterator.h.
References fSP605Id.
void sp605::Iterator::setFormat | ( | int | fmt | ) | [inline] |
Definition at line 49 of file Iterator.h.
References fFormat.
void sp605::Iterator::setSpadicId | ( | unsigned | id | ) | [inline] |
sp605::Board* sp605::Iterator::fBoard [protected] |
pointer on board object - source of buffers
Definition at line 19 of file Iterator.h.
Referenced by next().
void* sp605::Iterator::fBuffer [protected] |
unsigned sp605::Iterator::fBufferLen [protected] |
length of assigned buffer
Definition at line 24 of file Iterator.h.
Referenced by assign(), at_the_end(), and next().
unsigned sp605::Iterator::fBufferPos [protected] |
current position
Definition at line 25 of file Iterator.h.
Referenced by assign(), at_the_end(), and next().
int sp605::Iterator::fFormat [protected] |
format of data in binary buffer
Definition at line 21 of file Iterator.h.
Referenced by getFormat(), next(), nextBuffer(), and setFormat().
void* sp605::Iterator::fInterm [protected] |
intermediate memory for messages
Definition at line 27 of file Iterator.h.
Referenced by allocateInterm(), next(), and ~Iterator().
unsigned sp605::Iterator::fIntermFill [protected] |
filled number of bytes in intermediate buffer
Definition at line 29 of file Iterator.h.
Referenced by allocateInterm(), and next().
unsigned sp605::Iterator::fIntermSize [protected] |
allocated size of intermediate memory
Definition at line 28 of file Iterator.h.
Referenced by allocateInterm(), and next().
IteratorMessageKind sp605::Iterator::fKind [protected] |
kind of the current message
Definition at line 33 of file Iterator.h.
Referenced by assign(), isRocMsg(), isSpadicMsg(), and next().
unsigned sp605::Iterator::fLastEpoch[MaxSpadicId][MaxGroupId] [protected] |
value of last epoch for each spadic/group id combination
Definition at line 36 of file Iterator.h.
Referenced by getMsgFullTime(), getMsgFullTimeD(), Iterator(), and next().
unsigned sp605::Iterator::fLastRocEpoch [protected] |
last seen ROC epoch
Definition at line 41 of file Iterator.h.
Referenced by getMsgFullTime(), getMsgFullTimeD(), and next().
unsigned sp605::Iterator::fLastSenderId [protected] |
last id, that was taken from buffer in intermediate buffer
Definition at line 37 of file Iterator.h.
Referenced by next().
sp605::Message sp605::Iterator::fMsg [protected] |
content of current message
Definition at line 35 of file Iterator.h.
Referenced by getMsgFullTime(), getMsgFullTimeD(), msg(), next(), and printMessage().
roc::Message sp605::Iterator::fRocMsg [protected] |
roc message, used to decode SYNC/AUX/SYS messages
Definition at line 40 of file Iterator.h.
Referenced by getMsgFullTime(), getMsgFullTimeD(), next(), printMessage(), and rocmsg().
unsigned sp605::Iterator::fSP605Id [protected] |
current identifier of the SP605 board
Definition at line 31 of file Iterator.h.
Referenced by getBoardId(), isBoardId(), next(), resetBoardId(), and setBoardId().
unsigned sp605::Iterator::fSpadicId [protected] |
current id of spadic chip
Definition at line 38 of file Iterator.h.
Referenced by getSpadicId(), and setSpadicId().