DABC (Data Acquisition Backbone Core)  2.9.9
Public Member Functions | Protected Attributes
mbs::WriteIterator Class Reference

Write iterator for MBS events/subevents. More...

#include <mbs/Iterator.h>

Public Member Functions

bool AddRawData (const void *src, unsigned len)
 
bool AddSubevent (const dabc::Pointer &source)
 
bool AddSubevent (SubeventHeader *sub)
 
dabc::Buffer Close ()
 
dabc::Buffer CloseAndTransfer (dabc::Buffer &newbuf)
 Method could be used to close current buffer and transfer all uncompleted parts to new buffer. More...
 
bool CopyEventFrom (const dabc::Pointer &ptr, bool finish=true)
 Method to copy full event from the other place. More...
 
void DiscardEvent ()
 Ignore all data, which were add with last NewEvent call. More...
 
EventHeaderevnt () const
 
bool FinishEvent ()
 
bool FinishSubEvent (uint32_t rawdatasz=0)
 
bool IsAnyData () const
 Return true if anything was written to the buffer. More...
 
bool IsAnyEvent () const
 Return true if any complete event was written to the buffer. More...
 
bool IsAnyIncompleteData () const
 Return true if any incomplete data were provided to the iterator. More...
 
bool IsBuffer () const
 
bool IsEmpty () const
 
bool IsEventStarted () const
 Return true if new event was started and was not yet closed. More...
 
bool IsPlaceForEvent (uint32_t subeventsize, bool add_subev_header=false)
 
bool IsPlaceForRawData (unsigned len) const
 
uint32_t maxrawdatasize () const
 
bool NewEvent (EventNumType event_number=0, uint32_t subeventsize=0)
 
bool NewSubevent (uint32_t minrawsize=0, uint8_t crate=0, uint16_t procid=0, uint8_t control=0)
 
bool NewSubevent2 (uint32_t fullid)
 
void * rawdata () const
 
bool Reset (dabc::Buffer &buf)
 
SubeventHeadersubevnt () const
 
 WriteIterator ()
 
 WriteIterator (dabc::Buffer &buf)
 
 ~WriteIterator ()
 

Protected Attributes

dabc::Buffer fBuffer
 here we keep buffer - mean onwership is delivered to iterator More...
 
dabc::Pointer fEvPtr
 place for current event More...
 
dabc::BufferSize_t fFullSize
 size of accumulated events More...
 
dabc::Pointer fSubData
 pointer to place raw data of current subevent More...
 
dabc::Pointer fSubPtr
 place for subevents More...
 

Detailed Description

Write iterator for MBS events/subevents.

Definition at line 97 of file Iterator.h.

Constructor & Destructor Documentation

◆ WriteIterator() [1/2]

mbs::WriteIterator::WriteIterator ( )

Definition at line 197 of file Iterator.cxx.

◆ WriteIterator() [2/2]

mbs::WriteIterator::WriteIterator ( dabc::Buffer buf)

Definition at line 205 of file Iterator.cxx.

◆ ~WriteIterator()

mbs::WriteIterator::~WriteIterator ( )

Definition at line 214 of file Iterator.cxx.

Member Function Documentation

◆ Reset()

bool mbs::WriteIterator::Reset ( dabc::Buffer buf)

Definition at line 219 of file Iterator.cxx.

◆ IsBuffer()

bool mbs::WriteIterator::IsBuffer ( ) const
inline

Definition at line 112 of file Iterator.h.

◆ IsEmpty()

bool mbs::WriteIterator::IsEmpty ( ) const
inline

Definition at line 113 of file Iterator.h.

◆ IsAnyEvent()

bool mbs::WriteIterator::IsAnyEvent ( ) const
inline

Return true if any complete event was written to the buffer.

Definition at line 116 of file Iterator.h.

◆ IsAnyIncompleteData()

bool mbs::WriteIterator::IsAnyIncompleteData ( ) const
inline

Return true if any incomplete data were provided to the iterator.

Definition at line 119 of file Iterator.h.

◆ IsAnyData()

bool mbs::WriteIterator::IsAnyData ( ) const
inline

Return true if anything was written to the buffer.

Definition at line 122 of file Iterator.h.

◆ IsPlaceForEvent()

bool mbs::WriteIterator::IsPlaceForEvent ( uint32_t  subeventsize,
bool  add_subev_header = false 
)

Definition at line 298 of file Iterator.cxx.

◆ NewEvent()

bool mbs::WriteIterator::NewEvent ( EventNumType  event_number = 0,
uint32_t  subeventsize = 0 
)

Definition at line 304 of file Iterator.cxx.

◆ IsEventStarted()

bool mbs::WriteIterator::IsEventStarted ( ) const
inline

Return true if new event was started and was not yet closed.

Definition at line 127 of file Iterator.h.

◆ NewSubevent()

bool mbs::WriteIterator::NewSubevent ( uint32_t  minrawsize = 0,
uint8_t  crate = 0,
uint16_t  procid = 0,
uint8_t  control = 0 
)

Definition at line 329 of file Iterator.cxx.

◆ NewSubevent2()

bool mbs::WriteIterator::NewSubevent2 ( uint32_t  fullid)

Definition at line 347 of file Iterator.cxx.

◆ IsPlaceForRawData()

bool mbs::WriteIterator::IsPlaceForRawData ( unsigned  len) const

Definition at line 365 of file Iterator.cxx.

◆ AddRawData()

bool mbs::WriteIterator::AddRawData ( const void *  src,
unsigned  len 
)

Definition at line 371 of file Iterator.cxx.

◆ FinishSubEvent()

bool mbs::WriteIterator::FinishSubEvent ( uint32_t  rawdatasz = 0)

Definition at line 378 of file Iterator.cxx.

◆ AddSubevent() [1/2]

bool mbs::WriteIterator::AddSubevent ( const dabc::Pointer source)

Definition at line 409 of file Iterator.cxx.

◆ AddSubevent() [2/2]

bool mbs::WriteIterator::AddSubevent ( mbs::SubeventHeader sub)

Definition at line 423 of file Iterator.cxx.

◆ FinishEvent()

bool mbs::WriteIterator::FinishEvent ( )

Definition at line 428 of file Iterator.cxx.

◆ DiscardEvent()

void mbs::WriteIterator::DiscardEvent ( )

Ignore all data, which were add with last NewEvent call.

Can be used when not enough place were available

Definition at line 449 of file Iterator.cxx.

◆ CopyEventFrom()

bool mbs::WriteIterator::CopyEventFrom ( const dabc::Pointer ptr,
bool  finish = true 
)

Method to copy full event from the other place.

ptr should contain event with full header. Fot instance, mbs::ReadIterator.AssignEventPointer() could be used. If finish==false, one could add more subevents.

Definition at line 456 of file Iterator.cxx.

◆ Close()

dabc::Buffer mbs::WriteIterator::Close ( )

Definition at line 237 of file Iterator.cxx.

◆ CloseAndTransfer()

dabc::Buffer mbs::WriteIterator::CloseAndTransfer ( dabc::Buffer newbuf)

Method could be used to close current buffer and transfer all uncompleted parts to new buffer.

Definition at line 256 of file Iterator.cxx.

◆ evnt()

EventHeader* mbs::WriteIterator::evnt ( ) const
inline

Definition at line 156 of file Iterator.h.

◆ subevnt()

SubeventHeader* mbs::WriteIterator::subevnt ( ) const
inline

Definition at line 157 of file Iterator.h.

◆ rawdata()

void* mbs::WriteIterator::rawdata ( ) const
inline

Definition at line 158 of file Iterator.h.

◆ maxrawdatasize()

uint32_t mbs::WriteIterator::maxrawdatasize ( ) const
inline

Definition at line 159 of file Iterator.h.

Field Documentation

◆ fBuffer

dabc::Buffer mbs::WriteIterator::fBuffer
protected

here we keep buffer - mean onwership is delivered to iterator

Definition at line 99 of file Iterator.h.

◆ fEvPtr

dabc::Pointer mbs::WriteIterator::fEvPtr
protected

place for current event

Definition at line 100 of file Iterator.h.

◆ fSubPtr

dabc::Pointer mbs::WriteIterator::fSubPtr
protected

place for subevents

Definition at line 101 of file Iterator.h.

◆ fSubData

dabc::Pointer mbs::WriteIterator::fSubData
protected

pointer to place raw data of current subevent

Definition at line 102 of file Iterator.h.

◆ fFullSize

dabc::BufferSize_t mbs::WriteIterator::fFullSize
protected

size of accumulated events

Definition at line 103 of file Iterator.h.


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