ATLAS Offline Software
list.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2005-2008, Simon Howard
4 
5 Permission to use, copy, modify, and/or distribute this software
6 for any purpose with or without fee is hereby granted, provided
7 that the above copyright notice and this permission notice appear
8 in all copies.
9 
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
14 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
16 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
17 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 
19  */
20 
53 #ifndef ALGORITHM_LIST_H
54 #define ALGORITHM_LIST_H
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
67 typedef struct _ListEntry ListEntry;
68 
73 typedef struct _ListIterator ListIterator;
74 
79 typedef void *ListValue;
80 
85 struct _ListIterator {
88 };
89 
94 #define LIST_NULL ((void *) 0)
95 
106 typedef int (*ListCompareFunc)(ListValue value1, ListValue value2);
107 
118 typedef int (*ListEqualFunc)(ListValue value1, ListValue value2);
119 
127 
138 
149 
159 
169 
178 
188 
199 
208 
220 
231 
243 
251 void list_sort(ListEntry **list, ListCompareFunc compare_func);
252 
266  ListValue data);
267 
276 
287 
297 
306 
307 #ifdef __cplusplus
308 }
309 #endif
310 
311 #endif /* #ifndef ALGORITHM_LIST_H */
312 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
list_prev
ListEntry * list_prev(ListEntry *listentry)
Retrieve the previous entry in a list.
list_next
ListEntry * list_next(ListEntry *listentry)
Retrieve the next entry in a list.
list_nth_data
ListValue list_nth_data(ListEntry *list, int n)
Retrieve the value at a specified index in the list.
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ListEntry
struct _ListEntry ListEntry
Represents an entry in a doubly-linked list.
Definition: list.h:67
runLayerRecalibration.callback
callback
Definition: runLayerRecalibration.py:64
ListEqualFunc
int(* ListEqualFunc)(ListValue value1, ListValue value2)
Callback function used to determine of two values in a list are equal.
Definition: list.h:118
list_to_array
ListValue * list_to_array(ListEntry *list)
Create a C array containing the contents of a list.
list_free
void list_free(ListEntry *list)
Free an entire list.
list_remove_entry
int list_remove_entry(ListEntry **list, ListEntry *entry)
Remove an entry from a list.
list_sort
void list_sort(ListEntry **list, ListCompareFunc compare_func)
Sort a list.
list_iterate
void list_iterate(ListEntry **list, ListIterator *iter)
Initialise a ListIterator structure to iterate over a list.
list_append
ListEntry * list_append(ListEntry **list, ListValue data)
Append a value to the end of a list.
list_prepend
ListEntry * list_prepend(ListEntry **list, ListValue data)
Prepend a value to the start of a list.
list_data
ListValue list_data(ListEntry *listentry)
Retrieve the value at a list entry.
beamspotman.n
n
Definition: beamspotman.py:731
ListValue
void * ListValue
A value stored in a list.
Definition: list.h:79
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
list_iter_next
ListValue list_iter_next(ListIterator *iterator)
Using a list iterator, retrieve the next value from the list.
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
ListCompareFunc
int(* ListCompareFunc)(ListValue value1, ListValue value2)
Callback function used to compare values in a list when sorting.
Definition: list.h:106
_ListIterator
Definition of a ListIterator.
Definition: list.h:85
list_length
int list_length(ListEntry *list)
Find the length of a list.
list_iter_remove
void list_iter_remove(ListIterator *iterator)
Delete the current entry in the list (the value last returned from list_iter_next)
list_nth_entry
ListEntry * list_nth_entry(ListEntry *list, int n)
Retrieve the entry at a specified index in a list.
list_remove_data
int list_remove_data(ListEntry **list, ListEqualFunc callback, ListValue data)
Remove all occurrences of a particular value from a list.
_ListIterator::current
ListEntry * current
Definition: list.h:87
list_find_data
ListEntry * list_find_data(ListEntry *list, ListEqualFunc callback, ListValue data)
Find the entry for a particular value in a list.
_ListIterator::prev_next
ListEntry ** prev_next
Definition: list.h:86
list_iter_has_more
int list_iter_has_more(ListIterator *iterator)
Determine if there are more values in the list to iterate over.