ArrayList Struct Reference
[ArrayList API functions]


Detailed Description

Collection of elements.

Data Fields

ESR_ReturnCode(* add )(struct ArrayList_t *self, void *element)
ESR_ReturnCode(* insertAt )(struct ArrayList_t *self, size_t index, void *element)
ESR_ReturnCode(* remove )(struct ArrayList_t *self, const void *element)
ESR_ReturnCode(* removeAtIndex )(struct ArrayList_t *self, size_t index)
ESR_ReturnCode(* removeAll )(struct ArrayList_t *self)
ESR_ReturnCode(* contains )(struct ArrayList_t *self, const void *element, ESR_BOOL *exists)
ESR_ReturnCode(* getSize )(struct ArrayList_t *self, size_t *size)
ESR_ReturnCode(* get )(struct ArrayList_t *self, size_t index, void **element)
ESR_ReturnCode(* set )(struct ArrayList_t *self, size_t index, void *element)
ESR_ReturnCode(* toStaticArray )(struct ArrayList_t *self, void **newArray)
ESR_ReturnCode(* clone )(struct ArrayList_t *self, struct ArrayList_t *clone)
ESR_ReturnCode(* destroy )(struct ArrayList_t *self)

Field Documentation

ESR_ReturnCode(* ArrayList::add)(struct ArrayList_t *self, void *element)

Adds element to list.

Parameters:
self ArrayList handle
element Element to be added
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY is system is out of memory

ESR_ReturnCode(* ArrayList::insertAt)(struct ArrayList_t *self, size_t index, void *element)

Inserts an element in the the list at the specified location. This causes all elements above or at the specified location to be shifted by one.

Parameters:
self ArrayList handle
index The index where to insert the element.
element The element to insert.
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_SUCCESS if success or anaother value indicating the nature of the error. In particular, it returns ESR_ARGUMENT_OUT_OF_BOUNDS if index is less than 0 or greater than the array's size.

ESR_ReturnCode(* ArrayList::remove)(struct ArrayList_t *self, const void *element)

Removes element from list.

Parameters:
self ArrayList handle
element Element to be removed
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY is system is out of memory

ESR_ReturnCode(* ArrayList::removeAtIndex)(struct ArrayList_t *self, size_t index)

Removes element from list at specified index.

Parameters:
self ArrayList handle
index Index of element to be removed
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY is system is out of memory; ESR_ARGUMENT_OUT_OF_BOUNDS if index is out of bounds

ESR_ReturnCode(* ArrayList::removeAll)(struct ArrayList_t *self)

Removes all elements from list.

Parameters:
self ArrayList handle
Returns:
ESR_INVALID_ARGUMENT if self is null

ESR_ReturnCode(* ArrayList::contains)(struct ArrayList_t *self, const void *element, ESR_BOOL *exists)

Indicates if element is contained within the list.

Parameters:
self ArrayList handle
element Element to check for
exists True if element was found
Returns:
ESR_INVALID_ARGUMENT if self is null

ESR_ReturnCode(* ArrayList::getSize)(struct ArrayList_t *self, size_t *size)

Returns array size.

Parameters:
self ArrayList handle
size Returned size
Returns:
ESR_INVALID_ARGUMENT if self is null

ESR_ReturnCode(* ArrayList::get)(struct ArrayList_t *self, size_t index, void **element)

Returns the element at the specified index.

Parameters:
self ArrayList handle
index Element index
element Element being returned
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_ARGUMENT_OUT_OF_BOUNDS if index is out of bounds

ESR_ReturnCode(* ArrayList::set)(struct ArrayList_t *self, size_t index, void *element)

Sets the element at the specified index.

NOTE: Does *not* deallocate the element being overwritten.

Parameters:
self ArrayList handle
index Element index
element Element's new value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_ARGUMENT_OUT_OF_BOUNDS if index is out of bounds

ESR_ReturnCode(* ArrayList::toStaticArray)(struct ArrayList_t *self, void **newArray)

Converts the ArrayList to a static array. The use of the ArrayList handle is undefined past this point.

Parameters:
self ArrayList handle
newArray Pointer to resulting array
Returns:
ESR_INVALID_ARGUMENT if self is null

ESR_ReturnCode(* ArrayList::clone)(struct ArrayList_t *self, struct ArrayList_t *clone)

Returns a clone of the ArrayList.

Parameters:
self ArrayList handle
clone [out] Clone of the ArrayList (created externally, populated internally)
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_ARGUMENT_OUT_OF_BOUNDS if index (used internally) is out of bounds ESR_OUT_OF_MEMORY is system is out of memory

ESR_ReturnCode(* ArrayList::destroy)(struct ArrayList_t *self)

Destroys the ArrayList.

Parameters:
self ArrayList handle
Returns:
ESR_INVALID_ARGUMENT if self is null


Generated on Thu May 1 15:37:27 2008 for SREC by  doxygen 1.5.3