dbArray Class Template Reference

#include <array.h>

Inheritance diagram for dbArray:

dbAnyArray

List of all members.


Detailed Description

template<class T>
class dbArray< T >

Template for arrays.

Public Member Functions

dbFieldDescriptordbDescribeComponents (dbFieldDescriptor *fd)
 dbArray ()
 Default constructor.
 dbArray (size_t size)
 Construct array with specified length.
 dbArray (T const *ptr, size_t size, size_t allocate=0)
 Construct array with specified content.
 dbArray (dbArray const &arr)
 Copy constructor.
 ~dbArray ()
 Destructor.
dbArrayoperator= (dbArray const &arr)
 Assignment operator.
T const & last ()
 Get last element of the array.
void assign (T const *ptr, size_t size, bool copy=true)
 Assign content to the array.
T const & operator[] (size_t index) const
 Get array element with specified index.
void putat (size_t index, T const &value)
 Store element at the specified position.
T const & getat (size_t index) const
 Get array element with specified index.
void clear ()
 Make array empty.
void resize (size_t size)
 Resize array.
void append (T const &value)
 Append value to the array.
void insert (T const &value, size_t index=0)
 Insert element in the array at specified position.
void remove (size_t index)
 Remove element a specified position.
T const * get () const
 Get pointer to array elements.
T * update ()
 Get pointer to array elements to perform update.

Protected Member Functions

void memcpy (T *dst, T const *src, size_t len)
void memmove (T *dst, T const *src, size_t len)

Static Protected Member Functions

static void arrayAllocator (dbAnyArray *aArray, void *data, size_t length)

Protected Attributes

T * data
size_t allocated

Friends

class dbTableDescriptor

Constructor & Destructor Documentation

dbArray (  )  [inline]

Default constructor.

dbArray ( size_t  size  )  [inline]

Construct array with specified length.

Parameters:
size array length

dbArray ( T const *  ptr,
size_t  size,
size_t  allocate = 0 
) [inline]

Construct array with specified content.

Parameters:
ptr pointer to the elements
size size of array
allocate if 0, then array will just points to specified location of elements, otherwise elements will be copied to the created buffer

dbArray ( dbArray< T > const &  arr  )  [inline]

Copy constructor.

Parameters:
arr source array

~dbArray (  )  [inline]

Destructor.


Member Function Documentation

static void arrayAllocator ( dbAnyArray aArray,
void *  data,
size_t  length 
) [inline, static, protected]

Reimplemented from dbAnyArray.

void memcpy ( T *  dst,
T const *  src,
size_t  len 
) [inline, protected]

void memmove ( T *  dst,
T const *  src,
size_t  len 
) [inline, protected]

dbFieldDescriptor* dbDescribeComponents ( dbFieldDescriptor fd  )  [inline]

dbArray& operator= ( dbArray< T > const &  arr  )  [inline]

Assignment operator.

Returns:
this

T const& last (  )  [inline]

Get last element of the array.

Returns:
last element of the array

void assign ( T const *  ptr,
size_t  size,
bool  copy = true 
) [inline]

Assign content to the array.

Parameters:
ptr pointer to the assigned elements
size number of elements
copy if 0, then array will just points to specified location of elements, otherwise elements will be copied to the created buffer

T const& operator[] ( size_t  index  )  const [inline]

Get array element with specified index.

Parameters:
index element index
Returns:
element with specified index

void putat ( size_t  index,
T const &  value 
) [inline]

Store element at the specified position.

Parameters:
index element index
value stored element value

T const& getat ( size_t  index  )  const [inline]

Get array element with specified index.

Parameters:
index element index
Returns:
element with specified index

void clear (  )  [inline]

Make array empty.

void resize ( size_t  size  )  [inline]

Resize array.

Parameters:
size new array size

void append ( T const &  value  )  [inline]

Append value to the array.

Parameters:
value appended element

void insert ( T const &  value,
size_t  index = 0 
) [inline]

Insert element in the array at specified position.

Parameters:
value inserted value
index insert position

void remove ( size_t  index  )  [inline]

Remove element a specified position.

Parameters:
index position of the deleted element

T const* get (  )  const [inline]

Get pointer to array elements.

You should not directly change them.

Returns:
array elements

T* update (  )  [inline]

Get pointer to array elements to perform update.

Returns:
array elements


Friends And Related Function Documentation

friend class dbTableDescriptor [friend]

Reimplemented from dbAnyArray.


Member Data Documentation

T* data [protected]

size_t allocated [protected]


Online Library Docs

sipXecs home page

Version 4.2.1-018930 2010-07-31T01:13:23 build16 abuild