8#include "daq/slc/system/Buffer.h"
14Buffer::Buffer() : m_memory(NULL), m_size(0), m_allocated(false) {}
16Buffer::Buffer(
unsigned int size,
unsigned char* memory)
17 : m_memory(memory), m_size(size), m_allocated(false)
19 if (memory == NULL && size > 0) {
20 m_memory =
new unsigned char[size];
21 ::memset(m_memory, 0, size);
26Buffer::Buffer(
const Buffer& buf)
27 : m_memory(NULL), m_size(buf.m_size),
28 m_allocated(buf.m_allocated)
31 m_memory =
new unsigned char [buf.m_size];
32 ::memset(m_memory, 0, buf.m_size);
33 ::memcpy(m_memory, buf.m_memory, buf.m_size);
35 m_memory = buf.m_memory;
42 if (m_allocated && m_memory != NULL) {
54 m_allocated = buf.m_allocated;
56 m_memory =
new unsigned char [buf.m_size];
57 ::memset(m_memory, 0, buf.m_size);
58 ::memcpy(m_memory, buf.m_memory, buf.m_size);
60 m_memory = buf.m_memory;
Abstract base class for different kinds of events.