#include <libsswf.h>
Public Member Functions | |
void | AttachBuffer (Buffer *buffer) |
Attaches the specified buffer to this memory buffer. | |
Buffer * | GetBuffer (void) const |
Retrieve the Buffer of this MemBuffer. | |
MemBuffer (void) | |
Initializes a memory buffer. | |
virtual | ~MemBuffer () |
Cleans up a memory buffer. | |
Private Attributes | |
Buffer * | f_buffer |
The idea is to derive new classes from MemBuffer. These classes can then be managed by an sswf::MemoryManager. This is necessary for items put in vectors, the vectors themselves and a few othe objects which would otherwise not be managed.
A good examples are the actions. All the actions put in a vector are managed by that vector. In effect, when you destroy that vector, it automatically deletes all the actions.
MemBuffer::MemBuffer | ( | void | ) |
The constructor initializes the memory buffer with a null (i.e. no buffer).
References f_buffer.
MemBuffer::~MemBuffer | ( | ) | [virtual] |
The destructor ensures that any buffer still allocated gets deleted.
References f_buffer.
void MemBuffer::AttachBuffer | ( | Buffer * | buffer | ) |
This function is used when you attach a MemBuffer to a Buffer. The Buffer saves itself in the MemBuffer. In effect the item derived from this MemBuffer class becomes part of a MemoryManager.
It is an error to get attached to multiple buffers without first clearing the MemBuffer once. This should not be necessary since once an item is in a MemoryManager it does not need to be moved.
buffer | The buffer to attach to this MemBuffer |
References sswf::assert(), f_buffer, and sswf::Buffer::Info().
Referenced by sswf::Buffer::Buffer().
Buffer * MemBuffer::GetBuffer | ( | void | ) | const |
Buffer* sswf::MemBuffer::f_buffer [private] |
Referenced by AttachBuffer(), GetBuffer(), MemBuffer(), and ~MemBuffer().