class Core::Portable::AttributeBufferAllocator

Overview

Pre-allocates a memory buffer that can hold the given number of attributes. More…

#include <coreattributes.h>

class AttributeBufferAllocator: public Core::Portable::AttributeAllocator
{
public:
    // classes

    class BufferAttribute;

    // construction

    AttributeBufferAllocator(int capacity);

    // methods

    virtual Attribute* allocateAttribute(AttrID id, int flags);
    virtual void deallocateAttribute(Attribute* a);
};

Inherited Members

public:
    // methods

    virtual Attribute* allocateAttribute(AttrID id = nullptr, int flags = 0) = 0;
    virtual void deallocateAttribute(Attribute* a) = 0;
    static AttributeAllocator& getDefault();

Detailed Documentation

Pre-allocates a memory buffer that can hold the given number of attributes.

If more than capacity attributes are requested, the remaining ones will be allocated on the heap! Deallocating attributes does not reclaim space in the buffer!