Frz::alignvec< type > Class Template Reference

Memory-aligned resizable buffer. More...

#include <frz_misc.hpp>

Collaboration diagram for Frz::alignvec< type >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 alignvec (int _align=128, int _capacity=0)
 Constructor.
virtual ~alignvec ()
 Destructor.
void setFixedCapacity (int cap)
 Sets the buffer capacity to cap, and makes it non-resizable.
int growup (int count=1)
 Increase the buffer size of count elements.
void clear ()
 Sets the buffer size to zero.
int getSize () const
 Returns the number of elements in the buffer.
int getCapacity () const
 Returns the allocated capacity of the buffer.
type & operator[] (int i)
 Returns element i in the buffer array.
const type & operator[] (int i) const
 Returns element i in the buffer array.

Detailed Description

template<class type>
class Frz::alignvec< type >

Memory-aligned resizable buffer.

Implements a typed buffer with parametrizable alignment in memory, and optional resizable feature.


Constructor & Destructor Documentation

template<class type>
Frz::alignvec< type >::alignvec ( int  _align = 128,
int  _capacity = 0 
) [inline]

Constructor.

Allocates a buffer with specified alignment, and with the choice for fixed size or not.

Parameters:
_align Memory alignment in bytes.
_capacity 
  • If zero, the buffer is resizable and has zero initial capacity.
  • Otherwise, the buffer has a fixed capacity of _capacity.

Member Function Documentation

template<class type>
int Frz::alignvec< type >::growup ( int  count = 1  )  [inline]

Increase the buffer size of count elements.

Parameters:
count Buffer size increment.
Returns:
The previous number of elements in the buffer.

The documentation for this class was generated from the following file:
 All Classes Functions Variables Friends
Generated on Thu Jun 10 17:37:47 2010 for freezer-0.1.0 by  doxygen 1.6.3