PAASS
Software suite to Acquire and Analyze Data from Pixie16
DATA_buffer Class Reference

#include <hribf_buffers.h>

Inheritance diagram for DATA_buffer:
Collaboration diagram for DATA_buffer:

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...
 
- Public Member Functions inherited from BufferType
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

- Protected Member Functions inherited from BufferType
 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...
 
- Protected Attributes inherited from BufferType
unsigned int bufftype
 
unsigned int buffsize
 
unsigned int buffend
 
unsigned int zero
 
bool debug_mode
 

Detailed Description

Definition at line 240 of file hribf_buffers.h.

Constructor & Destructor Documentation

§ DATA_buffer()

DATA_buffer::DATA_buffer ( )

Default constructor.

Definition at line 591 of file hribf_buffers.cpp.

Here is the call graph for this function:

Member Function Documentation

§ Close()

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.

Here is the caller graph for this function:

§ GetNumChunks()

unsigned int DATA_buffer::GetNumChunks ( )
inline

Return the number of good spill chunks which were read.

Definition at line 286 of file hribf_buffers.h.

§ GetNumMissing()

unsigned int DATA_buffer::GetNumMissing ( )
inline

Return the number of missing or dropped spill chunks.

Definition at line 289 of file hribf_buffers.h.

Here is the call graph for this function:

§ GetRetval()

int DATA_buffer::GetRetval ( )
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.

§ GetSpillSize()

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.

§ open_()

bool DATA_buffer::open_ ( std::ofstream *  file_)
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.

Here is the caller graph for this function:

§ Read()

bool DATA_buffer::Read ( std::ifstream *  file_,
char *  data_,
unsigned int &  nBytes_,
unsigned int  max_bytes_,
bool &  full_spill,
bool &  bad_spill,
bool  dry_run_mode = false 
)
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.

Here is the call graph for this function:

§ read_next_buffer()

bool DATA_buffer::read_next_buffer ( std::ifstream *  f_,
bool  force_ = false 
)
private

Definition at line 541 of file hribf_buffers.cpp.

Here is the caller graph for this function:

§ Reset()

void DATA_buffer::Reset ( void  )
virtual

Set initial values.

Reimplemented from BufferType.

Definition at line 889 of file hribf_buffers.cpp.

Here is the caller graph for this function:

§ Write()

bool DATA_buffer::Write ( std::ofstream *  file_,
char *  data_,
unsigned int  nWords_,
int &  buffs_written 
)
virtual

Write a data spill to file.

Write a ldf data buffer to disk.

Definition at line 616 of file hribf_buffers.cpp.

Here is the call graph for this function:

Field Documentation

§ bcount

unsigned int DATA_buffer::bcount
private

Pointer to the next ldf buffer.

Definition at line 250 of file hribf_buffers.h.

§ buff_head

unsigned int DATA_buffer::buff_head
private

The total number of ldf buffers read from file.

Definition at line 251 of file hribf_buffers.h.

§ buff_pos

unsigned int DATA_buffer::buff_pos
private

Count of the number of missing spill chunks which were dropped.

Definition at line 256 of file hribf_buffers.h.

§ buff_size

unsigned int DATA_buffer::buff_size
private

The ldf buffer header ID.

Definition at line 252 of file hribf_buffers.h.

§ buffer1

unsigned int DATA_buffer::buffer1[ACTUAL_BUFF_SIZE]
private

The error code for the read method.

Definition at line 244 of file hribf_buffers.h.

§ buffer2

unsigned int DATA_buffer::buffer2[ACTUAL_BUFF_SIZE]
private

Container for a ldf buffer.

Definition at line 245 of file hribf_buffers.h.

§ curr_buffer

unsigned int* DATA_buffer::curr_buffer
private

Container for a second ldf buffer.

Definition at line 247 of file hribf_buffers.h.

§ good_chunks

unsigned int DATA_buffer::good_chunks
private

Total size of ldf buffer (in 4 byte words).

Definition at line 253 of file hribf_buffers.h.

§ missing_chunks

unsigned int DATA_buffer::missing_chunks
private

Count of the number of good spill chunks which were read.

Definition at line 254 of file hribf_buffers.h.

§ next_buffer

unsigned int* DATA_buffer::next_buffer
private

Pointer to the current ldf buffer.

Definition at line 248 of file hribf_buffers.h.

§ retval

int DATA_buffer::retval
private

Definition at line 242 of file hribf_buffers.h.


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