DABC (Data Acquisition Backbone Core)
2.9.9
|
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... | |
EventHeader * | evnt () 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) |
SubeventHeader * | subevnt () 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... | |
Write iterator for MBS events/subevents.
Definition at line 97 of file Iterator.h.
mbs::WriteIterator::WriteIterator | ( | ) |
Definition at line 197 of file Iterator.cxx.
mbs::WriteIterator::WriteIterator | ( | dabc::Buffer & | buf | ) |
Definition at line 205 of file Iterator.cxx.
mbs::WriteIterator::~WriteIterator | ( | ) |
Definition at line 214 of file Iterator.cxx.
bool mbs::WriteIterator::Reset | ( | dabc::Buffer & | buf | ) |
Definition at line 219 of file Iterator.cxx.
|
inline |
Definition at line 112 of file Iterator.h.
|
inline |
Definition at line 113 of file Iterator.h.
|
inline |
Return true if any complete event was written to the buffer.
Definition at line 116 of file Iterator.h.
|
inline |
Return true if any incomplete data were provided to the iterator.
Definition at line 119 of file Iterator.h.
|
inline |
Return true if anything was written to the buffer.
Definition at line 122 of file Iterator.h.
bool mbs::WriteIterator::IsPlaceForEvent | ( | uint32_t | subeventsize, |
bool | add_subev_header = false |
||
) |
Definition at line 298 of file Iterator.cxx.
bool mbs::WriteIterator::NewEvent | ( | EventNumType | event_number = 0 , |
uint32_t | subeventsize = 0 |
||
) |
Definition at line 304 of file Iterator.cxx.
|
inline |
Return true if new event was started and was not yet closed.
Definition at line 127 of file Iterator.h.
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.
bool mbs::WriteIterator::NewSubevent2 | ( | uint32_t | fullid | ) |
Definition at line 347 of file Iterator.cxx.
bool mbs::WriteIterator::IsPlaceForRawData | ( | unsigned | len | ) | const |
Definition at line 365 of file Iterator.cxx.
bool mbs::WriteIterator::AddRawData | ( | const void * | src, |
unsigned | len | ||
) |
Definition at line 371 of file Iterator.cxx.
bool mbs::WriteIterator::FinishSubEvent | ( | uint32_t | rawdatasz = 0 | ) |
Definition at line 378 of file Iterator.cxx.
bool mbs::WriteIterator::AddSubevent | ( | const dabc::Pointer & | source | ) |
Definition at line 409 of file Iterator.cxx.
bool mbs::WriteIterator::AddSubevent | ( | mbs::SubeventHeader * | sub | ) |
Definition at line 423 of file Iterator.cxx.
bool mbs::WriteIterator::FinishEvent | ( | ) |
Definition at line 428 of file Iterator.cxx.
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.
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.
dabc::Buffer mbs::WriteIterator::Close | ( | ) |
Definition at line 237 of file Iterator.cxx.
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.
|
inline |
Definition at line 156 of file Iterator.h.
|
inline |
Definition at line 157 of file Iterator.h.
|
inline |
Definition at line 158 of file Iterator.h.
|
inline |
Definition at line 159 of file Iterator.h.
|
protected |
here we keep buffer - mean onwership is delivered to iterator
Definition at line 99 of file Iterator.h.
|
protected |
place for current event
Definition at line 100 of file Iterator.h.
|
protected |
place for subevents
Definition at line 101 of file Iterator.h.
|
protected |
pointer to place raw data of current subevent
Definition at line 102 of file Iterator.h.
|
protected |
size of accumulated events
Definition at line 103 of file Iterator.h.