32 #ifndef OPAL_POINTER_ARRAY_H
33 #define OPAL_POINTER_ARRAY_H
35 #include "opal_config.h"
90 int initial_allocation,
114 int index,
void *value);
130 if( table->
size <= element_index ) {
134 p = table->
addr[element_index];
200 for(i=0; i<array->
size; i++) {
201 array->
addr[i] = NULL;
int block_size
block size for each allocation
Definition: opal_pointer_array.h:62
dynamic pointer array
Definition: opal_pointer_array.h:45
void ** addr
pointer to array of pointers
Definition: opal_pointer_array.h:64
OPAL_DECLSPEC int opal_pointer_array_set_size(opal_pointer_array_t *array, int size)
Set the size of the pointer array.
Definition: opal_pointer_array.c:295
static int opal_pointer_array_get_size(opal_pointer_array_t *array)
Get the size of the pointer array.
Definition: opal_pointer_array.h:150
Definition: mutex_unix.h:53
static void * opal_pointer_array_get_item(opal_pointer_array_t *table, int element_index)
Get the value of an element in array.
Definition: opal_pointer_array.h:125
OPAL_DECLSPEC int opal_pointer_array_init(opal_pointer_array_t *array, int initial_allocation, int max_size, int block_size)
Initialize the pointer array with an initial size of initial_allocation.
Definition: opal_pointer_array.c:73
int size
size of list, i.e.
Definition: opal_pointer_array.h:58
#define OPAL_THREAD_LOCK(mutex)
Lock a mutex if opal_using_threads() says that multiple threads may be active in the process...
Definition: mutex.h:223
#define OPAL_THREAD_UNLOCK(mutex)
Unlock a mutex if opal_using_threads() says that multiple threads may be active in the process...
Definition: mutex.h:309
OPAL_DECLSPEC int opal_pointer_array_set_item(opal_pointer_array_t *array, int index, void *value)
Set the value of an element in array.
Definition: opal_pointer_array.c:164
OPAL_DECLSPEC bool opal_pointer_array_test_and_set_item(opal_pointer_array_t *table, int index, void *value)
Test whether a certain element is already in use.
Definition: opal_pointer_array.c:233
int number_free
number of free elements in the list
Definition: opal_pointer_array.h:56
OPAL_DECLSPEC int opal_pointer_array_add(opal_pointer_array_t *array, void *ptr)
Add a pointer to the array (Grow the array, if need be)
Definition: opal_pointer_array.c:109
opal_object_t super
base class
Definition: opal_pointer_array.h:47
opal_mutex_t lock
synchronization object
Definition: opal_pointer_array.h:49
Base object.
Definition: opal_object.h:182
static void opal_pointer_array_remove_all(opal_pointer_array_t *array)
Empty the array.
Definition: opal_pointer_array.h:191
int lowest_free
Index of lowest free element.
Definition: opal_pointer_array.h:54
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_pointer_array_t)
Class declaration.
Mutual exclusion functions.
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...
int max_size
maximum size of the array
Definition: opal_pointer_array.h:60