|
ai::AutoBuffer< elem, size_type, A > Class Template Reference
An AutoBuffer class object allows you to retrieve string contents into a buffer, or to pass or retrieve any array of data types, without having to manage the buffer's memory.
More...
#include <IAIAutoBuffer.h>
List of all members.
Detailed Description
template<class elem, typename size_type = size_t, class A = SPAlloc>
class ai::AutoBuffer< elem, size_type, A >
An AutoBuffer class object allows you to retrieve string contents into a buffer, or to pass or retrieve any array of data types, without having to manage the buffer's memory.
Member Typedef Documentation
template<class elem, typename size_type = size_t, class A = SPAlloc>
template<class elem, typename size_type = size_t, class A = SPAlloc>
Constructor & Destructor Documentation
template<class elem, typename size_type = size_t, class A = SPAlloc>
Constructor.
- Parameters:
-
| count | Initial number of elements that the buffer should be able to hold |
template<class elem, typename size_type = size_t, class A = SPAlloc>
Copy constructor.
- Parameters:
-
template<class elem, typename size_type = size_t, class A = SPAlloc>
Member Function Documentation
template<class elem, typename size_type = size_t, class A = SPAlloc>
const elem& ai::AutoBuffer< elem, size_type, A >::back |
( |
|
) |
const [inline] |
template<class elem, typename size_type = size_t, class A = SPAlloc>
Retrieves the last element in the buffer.
- Note:
- There is no protection for indexing off the begin or end of the array.
template<class elem, typename size_type = size_t, class A = SPAlloc>
template<class elem, typename size_type = size_t, class A = SPAlloc>
template<class elem, typename size_type = size_t, class A = SPAlloc>
template<class elem, typename size_type = size_t, class A = SPAlloc>
template<class elem, typename size_type = size_t, class A = SPAlloc>
template<class elem, typename size_type = size_t, class A = SPAlloc>
const elem& ai::AutoBuffer< elem, size_type, A >::front |
( |
|
) |
const [inline] |
template<class elem, typename size_type = size_t, class A = SPAlloc>
Retrieves the first element in the buffer.
- Note:
- There is no protection for indexing off the begin or end of the array.
template<class elem, typename size_type = size_t, class A = SPAlloc>
elem* ai::AutoBuffer< elem, size_type, A >::GetBuffer |
( |
|
) |
const [inline] |
template<class elem, typename size_type = size_t, class A = SPAlloc>
size_type ai::AutoBuffer< elem, size_type, A >::GetCount |
( |
|
) |
const [inline] |
Retrieves the current capacity of the buffer.
- Returns:
- The number of elements that can be contained.
template<class elem, typename size_type = size_t, class A = SPAlloc>
Reports whether the buffer object has a handle to a valid buffer.
- Returns:
- True if the buffer pointer is valid.
template<class elem, typename size_type = size_t, class A = SPAlloc>
static size_type ai::AutoBuffer< elem, size_type, A >::lastIndex |
( |
|
) |
[inline, static] |
template<class elem, typename size_type = size_t, class A = SPAlloc>
ai::AutoBuffer< elem, size_type, A >::operator elem * |
( |
|
) |
const [inline, explicit] |
template<class elem, typename size_type = size_t, class A = SPAlloc>
template<class elem, typename size_type = size_t, class A = SPAlloc>
const elem& ai::AutoBuffer< elem, size_type, A >::operator[] |
( |
size_type |
n |
) |
const [inline] |
template<class elem, typename size_type = size_t, class A = SPAlloc>
elem& ai::AutoBuffer< elem, size_type, A >::operator[] |
( |
size_type |
n |
) |
[inline] |
Retrieves an element at a given index position in the buffer.
Use with GetCount() to iterate through elements.
- Parameters:
-
| n | The 0-based position index. |
- Returns:
- A writeable reference to the object.
- Note:
- There is no protection for indexing off the end of the array.
template<class elem, typename size_type = size_t, class A = SPAlloc>
void ai::AutoBuffer< elem, size_type, A >::Resize |
( |
size_type |
newSize |
) |
[inline] |
Resizes the buffer.
If the given size is less than the current capacity, the buffer is shortened and truncated elements are destroyed. If it is greater, the buffer is grown and the new elements are initialized.
- Parameters:
-
| newSize | The new number of elements. |
template<class elem, typename size_type = size_t, class A = SPAlloc>
size_type ai::AutoBuffer< elem, size_type, A >::size |
( |
|
) |
const [inline] |
The documentation for this class was generated from the following file:
|