Indexing routines


Detailed Description

Indexing routines allow objects to be organized in ranks.


Typedefs

typedef struct s_index INDEX
 the index structure

Functions

INDEXindex_create (int first_ordinal, int last_ordinal)
 Create an index.
STATUS index_insert (INDEX *index, void *data, int ordinal)
 Insert an item into an index.
void index_shuffle (INDEX *index)
 Shuffle an index to avoid excessive lock contention in models where topologically adjacent objects are loaded sequentially.


Function Documentation

INDEX * index_create ( int  first_ordinal,
int  last_ordinal 
)

Create an index.

Returns:
a pointer to the index structure
Parameters:
first_ordinal  the first ordinal
last_ordinal  the last ordinal

Definition at line 23 of file index.c.

References output_verbose().

STATUS index_insert ( INDEX index,
void *  data,
int  ordinal 
)

Insert an item into an index.

Returns:
STATUS on SUCCESS, FAILED otherwise
Parameters:
index  the index to which the item is added
data  a pointer to the item to be added
ordinal  the ordinal to which the item belongs

Definition at line 65 of file index.c.

References list_append(), list_create(), output_fatal(), and output_verbose().

void index_shuffle ( INDEX index  ) 

Shuffle an index to avoid excessive lock contention in models where topologically adjacent objects are loaded sequentially.

Parameters:
index  the index to shuffle

Definition at line 130 of file index.c.

References list_shuffle(), and output_verbose().


GridLAB-DTM Version 2.0
An open-source project initiated by the US Department of Energy