PAASS
Software suite to Acquire and Analyze Data from Pixie16
|
#include <hribf_buffers.h>
Public Member Functions | |
DATA_buffer () | |
Default constructor. More... | |
bool | Close (std::ofstream *file_) |
0x41544144 "DATA" More... | |
int | GetSpillSize (std::ifstream *file_) |
int | GetRetval () |
unsigned int | GetNumChunks () |
Return the number of good spill chunks which were read. More... | |
unsigned int | GetNumMissing () |
Return the number of missing or dropped spill chunks. More... | |
virtual bool | Write (std::ofstream *file_, char *data_, unsigned int nWords_, int &buffs_written) |
Write a data spill to file. More... | |
virtual bool | Read (std::ifstream *file_, char *data_, unsigned int &nBytes_, unsigned int max_bytes_, bool &full_spill, bool &bad_spill, bool dry_run_mode=false) |
Read a data spill from a file. More... | |
virtual void | Reset () |
Set initial values. More... | |
![]() | |
unsigned int | GetBufferType () |
unsigned int | GetBufferSize () |
unsigned int | GetBufferEndFlag () |
bool | DebugMode () |
void | SetDebugMode (bool debug_=true) |
bool | ReadHeader (std::ifstream *file_) |
Return true if the first word of the current buffer is equal to this buffer type. More... | |
Private Member Functions | |
bool | open_ (std::ofstream *file_) |
The actual position in the current ldf buffer. More... | |
bool | read_next_buffer (std::ifstream *f_, bool force_=false) |
Private Attributes | |
int | retval |
unsigned int | buffer1 [ACTUAL_BUFF_SIZE] |
The error code for the read method. More... | |
unsigned int | buffer2 [ACTUAL_BUFF_SIZE] |
Container for a ldf buffer. More... | |
unsigned int * | curr_buffer |
Container for a second ldf buffer. More... | |
unsigned int * | next_buffer |
Pointer to the current ldf buffer. More... | |
unsigned int | bcount |
Pointer to the next ldf buffer. More... | |
unsigned int | buff_head |
The total number of ldf buffers read from file. More... | |
unsigned int | buff_size |
The ldf buffer header ID. More... | |
unsigned int | good_chunks |
Total size of ldf buffer (in 4 byte words). More... | |
unsigned int | missing_chunks |
Count of the number of good spill chunks which were read. More... | |
unsigned int | buff_pos |
Count of the number of missing spill chunks which were dropped. More... | |
Additional Inherited Members | |
![]() | |
BufferType (unsigned int bufftype_, unsigned int buffsize_, unsigned int buffend_=0xFFFFFFFF) | |
Generic BufferType constructor. More... | |
virtual bool | Write (std::ofstream *file_) |
Returns only false if not overloaded. More... | |
virtual bool | Read (std::ifstream *file_) |
Returns only false if not overloaded. More... | |
![]() | |
unsigned int | bufftype |
unsigned int | buffsize |
unsigned int | buffend |
unsigned int | zero |
bool | debug_mode |
Definition at line 240 of file hribf_buffers.h.
DATA_buffer::DATA_buffer | ( | ) |
Default constructor.
Definition at line 591 of file hribf_buffers.cpp.
bool DATA_buffer::Close | ( | std::ofstream * | file_ | ) |
0x41544144 "DATA"
Close a ldf data buffer by padding with 0xFFFFFFFF.
Close a data buffer by padding with 0xFFFFFFFF
Definition at line 600 of file hribf_buffers.cpp.
|
inline |
Return the number of good spill chunks which were read.
Definition at line 286 of file hribf_buffers.h.
|
inline |
Return the number of missing or dropped spill chunks.
Definition at line 289 of file hribf_buffers.h.
|
inline |
Get the return value from the read method. 0 - Success 1 - Encountered single EOF buffer (end of run) 2 - Encountered double EOF buffer (end of file) 3 - Encountered unknown ldf buffer type 4 - Encountered invalid spill chunk 5 - Received bad spill footer size 6 - Failed to read buffer from file
Definition at line 283 of file hribf_buffers.h.
int DATA_buffer::GetSpillSize | ( | std::ifstream * | file_ | ) |
Get the standard data spill size for a given data file. This number is set at runtime by poll and should be the same for each and every spill in the file. Returns the spill size in words or -1 in the event of an error. This method should be called whenever a new file is opened.
|
private |
The actual position in the current ldf buffer.
Write a ldf data buffer header (2 words).
DATA buffer (1 word buffer type, 1 word buffer size)
Definition at line 529 of file hribf_buffers.cpp.
|
virtual |
Read a data spill from a file.
Read a ldf data spill from a file.
Definition at line 730 of file hribf_buffers.cpp.
|
private |
|
virtual |
Set initial values.
Reimplemented from BufferType.
Definition at line 889 of file hribf_buffers.cpp.
|
virtual |
Write a data spill to file.
Write a ldf data buffer to disk.
Definition at line 616 of file hribf_buffers.cpp.
|
private |
Pointer to the next ldf buffer.
Definition at line 250 of file hribf_buffers.h.
|
private |
The total number of ldf buffers read from file.
Definition at line 251 of file hribf_buffers.h.
|
private |
Count of the number of missing spill chunks which were dropped.
Definition at line 256 of file hribf_buffers.h.
|
private |
The ldf buffer header ID.
Definition at line 252 of file hribf_buffers.h.
|
private |
The error code for the read method.
Definition at line 244 of file hribf_buffers.h.
|
private |
Container for a ldf buffer.
Definition at line 245 of file hribf_buffers.h.
|
private |
Container for a second ldf buffer.
Definition at line 247 of file hribf_buffers.h.
|
private |
Total size of ldf buffer (in 4 byte words).
Definition at line 253 of file hribf_buffers.h.
|
private |
Count of the number of good spill chunks which were read.
Definition at line 254 of file hribf_buffers.h.
|
private |
Pointer to the current ldf buffer.
Definition at line 248 of file hribf_buffers.h.
|
private |
Definition at line 242 of file hribf_buffers.h.