Multi-ApplicationOnlineProfiling  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Internals

Not to be used directly. More...

Data Structures

struct  chained_list
 Basic buffered chained list. More...
 
struct  chained_list_view
 This struct is used to improve performance when sequentially walking through. More...
 

Functions

struct chained_listchained_list_init (uint32_t size_of_trunk, size_t size_of_payload)
 Ininitalizes a buffered chained list. More...
 
void chained_list_release (struct chained_list **list)
 Release a buffered chained list. More...
 
struct chained_listchained_list_alloc_next_chunk (struct chained_list *current_chunk)
 Alocate a new chunk pointing to current_chunk (Recopy MODE ) More...
 
struct chained_listchained_list_alloc_chunk (uint32_t size_of_trunk, size_t size_of_payload)
 Alocate a new chunk ( first chunk ) More...
 
int chained_list_count (struct chained_list *list)
 Count elements in the chained list. More...
 
void * chained_list_push (struct chained_list **list, void *p_payload)
 Push an element in the chained list. More...
 
void cond_chained_list_merge (struct chained_list **dest, struct chained_list *source, int(*condition)(void *))
 Push all element of source satisfying condition in dest. More...
 
void chained_list_walkthrough (struct chained_list *list, void(*action)(void *))
 Call a function uppon each element of the chained list. More...
 
void chained_list_walkthrough_arg (struct chained_list *list, void(*action)(void *, void *), void *arg)
 Call a function uppon each element of the chained list. More...
 
static void chained_list_view_init (struct chained_list_view *clv)
 Initializes a chained_list_view. More...
 
void * chained_list_get_elem (struct chained_list *list, int(*test_func)(void *, void *), void *value)
 Get a pointer to the first element which matches a value. More...
 
static void * chained_list_get_nth (struct chained_list *list, uint64_t n)
 Get a reference to the nth element of the chained list. More...
 
static void * chained_list_get_nth_seq (struct chained_list *list, struct chained_list_view *view, uint64_t n)
 Get a reference to the nth element of the chained list (optimised for sequential) More...
 

Detailed Description

Not to be used directly.

These structure and functions are not meant to be used directly. These are internals of Chained List and related functions.

Function Documentation

struct chained_list* chained_list_alloc_chunk ( uint32_t  size_of_trunk,
size_t  size_of_payload 
)

Alocate a new chunk ( first chunk )

Parameters
size_of_trunkin number of elems
size_of_payloadelem eg sizeof( TYPE )
Returns
newly allocated chunk

Definition at line 38 of file Chained_List.c.

Here is the caller graph for this function:

struct chained_list* chained_list_alloc_next_chunk ( struct chained_list current_chunk)

Alocate a new chunk pointing to current_chunk (Recopy MODE )

Parameters
current_chunkpointer to current_chunk
Returns
newly allocated chunk

Definition at line 26 of file Chained_List.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int chained_list_count ( struct chained_list list)

Count elements in the chained list.

Parameters
listpointer to an initialized chained list
Returns
number of elements in the list

Definition at line 151 of file Chained_List.c.

void* chained_list_get_elem ( struct chained_list list,
int(*)(void *, void *)  test_func,
void *  value 
)

Get a pointer to the first element which matches a value.

Parameters
listpointer to a chained list list
test_funccomparison function
valuethe wanted value
Returns
the found element (NULL if not found)

Definition at line 185 of file Chained_List.c.

Here is the caller graph for this function:

static void* chained_list_get_nth ( struct chained_list list,
uint64_t  n 
)
inlinestatic

Get a reference to the nth element of the chained list.

Parameters
listpointer to a chained list
nelement index

Definition at line 165 of file Chained_List.h.

Here is the caller graph for this function:

static void* chained_list_get_nth_seq ( struct chained_list list,
struct chained_list_view view,
uint64_t  n 
)
inlinestatic

Get a reference to the nth element of the chained list (optimised for sequential)

Parameters
listpointer to a chained list list
viewenhance sequential walking of the list by storing last chunk
nelement index

This function must be used in case the elements are get sequentially.

The chunk of the last found item is stored int view and the search starts from it, so the next call found next element much faster (especially when the list is hugh).

Definition at line 207 of file Chained_List.h.

Here is the caller graph for this function:

struct chained_list* chained_list_init ( uint32_t  size_of_trunk,
size_t  size_of_payload 
)

Ininitalizes a buffered chained list.

Parameters
size_of_trunksize of the trunk in number of elems
size_of_payloadsize of a payload elem eg sizeof( TYPE )
Returns
pointer to an allocated chained_list

Definition at line 21 of file Chained_List.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void* chained_list_push ( struct chained_list **  list,
void *  p_payload 
)

Push an element in the chained list.

Parameters
listdouble Pointer to an initialized chained list ( may be modified uppon push )
p_payloadpointer to the elem
Returns
pointer to the pushed elem

Definition at line 62 of file Chained_List.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void chained_list_release ( struct chained_list **  list)

Release a buffered chained list.

Parameters
listdouble pointer on a chained_list (set to NULL uppon release )

Definition at line 167 of file Chained_List.c.

Here is the caller graph for this function:

static void chained_list_view_init ( struct chained_list_view clv)
inlinestatic

Initializes a chained_list_view.

Parameters
clvthe list view to initialize

Definition at line 142 of file Chained_List.h.

Here is the caller graph for this function:

void chained_list_walkthrough ( struct chained_list list,
void(*)(void *)  action 
)

Call a function uppon each element of the chained list.

Parameters
listpointer to a chained list list
actionfunction (takes element in param as void *)

Definition at line 116 of file Chained_List.c.

Here is the caller graph for this function:

void chained_list_walkthrough_arg ( struct chained_list list,
void(*)(void *, void *)  action,
void *  arg 
)

Call a function uppon each element of the chained list.

Parameters
listpointer to a chained list list
actionfunction (takes element in param as void *)
argarguments to give to action (second void*)

Definition at line 134 of file Chained_List.c.

Here is the caller graph for this function:

void cond_chained_list_merge ( struct chained_list **  dest,
struct chained_list source,
int(*)(void *)  condition 
)

Push all element of source satisfying condition in dest.

Parameters
destpointer to destination list
sourcepointer to source list
conditiontest function (takes a source elem as param) returns 1 for mergin

Definition at line 91 of file Chained_List.c.

Here is the call graph for this function:

Here is the caller graph for this function: