Adobe.com
Contents Suites Classes Class Index Member Index

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.

Public Types

typedef elem * iterator
typedef const elem * const_iterator

Public Member Functions

 AutoBuffer (size_type count=0)
 Constructor.
 AutoBuffer (const AutoBuffer &b)
 Copy constructor.
 ~AutoBuffer ()
 Destructor.
bool IsValid () const
 Reports whether the buffer object has a handle to a valid buffer.
elem * GetBuffer () const
 Retrieves the buffer.
 operator elem * () const
elem & operator[] (size_type n)
 Retrieves an element at a given index position in the buffer.
const elem & operator[] (size_type n) const
elem & front ()
 Retrieves the first element in the buffer.
const elem & front () const
elem & back ()
 Retrieves the last element in the buffer.
const elem & back () const
size_type GetCount () const AINOEXCEPT
 Retrieves the current capacity of the buffer.
size_type size () const AINOEXCEPT
bool empty () const AINOEXCEPT
void Resize (size_type newSize)
 Resizes the buffer.
AutoBufferoperator= (const AutoBuffer &rhs)
iterator begin () AINOEXCEPT
iterator end () AINOEXCEPT
const_iterator begin () const AINOEXCEPT
const_iterator end () const AINOEXCEPT

Static Public Member Functions

static size_type lastIndex ()

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>
typedef const elem* ai::AutoBuffer< elem, size_type, A >::const_iterator
template<class elem, typename size_type = size_t, class A = SPAlloc>
typedef elem* ai::AutoBuffer< elem, size_type, A >::iterator

Constructor & Destructor Documentation

template<class elem, typename size_type = size_t, class A = SPAlloc>
ai::AutoBuffer< elem, size_type, A >::AutoBuffer ( size_type  count = 0  )  [inline, explicit]

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>
ai::AutoBuffer< elem, size_type, A >::AutoBuffer ( const AutoBuffer< elem, size_type, A > &  b  )  [inline]

Copy constructor.

Parameters:
b buffer to be copied.
template<class elem, typename size_type = size_t, class A = SPAlloc>
ai::AutoBuffer< elem, size_type, A >::~AutoBuffer (  )  [inline]

Destructor.


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>
elem& ai::AutoBuffer< elem, size_type, A >::back (  )  [inline]

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>
const_iterator ai::AutoBuffer< elem, size_type, A >::begin (  )  const [inline]
template<class elem, typename size_type = size_t, class A = SPAlloc>
iterator ai::AutoBuffer< elem, size_type, A >::begin (  )  [inline]
template<class elem, typename size_type = size_t, class A = SPAlloc>
bool ai::AutoBuffer< elem, size_type, A >::empty (  )  const [inline]
template<class elem, typename size_type = size_t, class A = SPAlloc>
const_iterator ai::AutoBuffer< elem, size_type, A >::end (  )  const [inline]
template<class elem, typename size_type = size_t, class A = SPAlloc>
iterator ai::AutoBuffer< elem, size_type, A >::end (  )  [inline]
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>
elem& ai::AutoBuffer< elem, size_type, A >::front (  )  [inline]

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]

Retrieves the buffer.

Returns:
A writeable pointer to the buffer.
Note:
The returned pointer can be invalidated by calls to Resize().

Referenced by ai::AutoBuffer< uuid >::operator uuid *().

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>
bool ai::AutoBuffer< elem, size_type, A >::IsValid (  )  const [inline]

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>
AutoBuffer& ai::AutoBuffer< elem, size_type, A >::operator= ( const AutoBuffer< elem, size_type, A > &  rhs  )  [inline]
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:


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks