9 #include <rawdata/dataobjects/RawDataBlock.h>
14 RawDataBlock::RawDataBlock()
19 m_use_prealloc_buf = 0;
25 RawDataBlock::~RawDataBlock()
27 if (m_access_dblk != NULL)
delete m_access_dblk;
30 if (!m_use_prealloc_buf && m_buffer != NULL) {
35 void RawDataBlock::SetBuffer(
int* bufin,
int nwords,
int delete_flag,
int num_events,
int num_nodes)
40 sprintf(err_buf,
"[DEBUG] bufin is NULL. Exting...\n");
41 printf(
"%s", err_buf); fflush(stdout);
45 if (!m_use_prealloc_buf && m_buffer != NULL)
delete[] m_buffer;
47 if (delete_flag == 0) {
48 m_use_prealloc_buf =
true;
50 m_use_prealloc_buf =
false;
56 m_num_nodes = num_nodes;
57 m_num_events = num_events;
60 m_access_dblk->SetBuffer(m_buffer, m_nwords, 0, m_num_events, m_num_nodes);
Abstract base class for different kinds of events.