Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

sp605::Iterator Class Reference

#include <Iterator.h>

Collaboration diagram for sp605::Iterator:
Collaboration graph
[legend]

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::Messagemsg ()
void setSpadicId (unsigned id)
unsigned getSpadicId () const
bool isRocMsg () const
roc::Messagerocmsg ()
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::BoardfBoard
 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

Detailed Description

Definition at line 12 of file Iterator.h.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
MaxGroupId 
MaxSpadicId 

Definition at line 17 of file Iterator.h.

Enumerator:
kindNone 
kindRoc 
kindSpadic 

Definition at line 15 of file Iterator.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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
double sp605::Iterator::getMsgFullTimeD (  )  const
unsigned sp605::Iterator::getSpadicId (  )  const [inline]

Definition at line 75 of file Iterator.h.

References fSpadicId.

Referenced by next().

bool sp605::Iterator::isBoardId (  )  const [inline]

Definition at line 54 of file Iterator.h.

References fSP605Id.

Referenced by getBoardId().

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.  ) 
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]

Definition at line 74 of file Iterator.h.

References fSpadicId.

Referenced by next().


Field Documentation

pointer on board object - source of buffers

Definition at line 19 of file Iterator.h.

Referenced by next().

void* sp605::Iterator::fBuffer [protected]

assigned buffer

Definition at line 23 of file Iterator.h.

Referenced by assign(), and next().

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().

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().

content of current message

Definition at line 35 of file Iterator.h.

Referenced by getMsgFullTime(), getMsgFullTimeD(), msg(), next(), and printMessage().

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().


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