ATLAS Offline Software
arraylist.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 
39 #ifndef ALGORITHM_ARRAYLIST_H
40 #define ALGORITHM_ARRAYLIST_H
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
50 typedef void *ArrayListValue;
51 
59 typedef struct _ArrayList ArrayList;
60 
65 struct _ArrayList {
66 
70 
73  int length;
74 
77  int _alloced;
78 };
79 
87 
101  ArrayListValue value2);
102 
114 
121 void arraylist_free(ArrayList *arraylist);
122 
134 
146 
154 void arraylist_remove(ArrayList *arraylist, int index);
155 
164 void arraylist_remove_range(ArrayList *arraylist, int index, int length);
165 
180 
195 
202 void arraylist_clear(ArrayList *arraylist);
203 
211 void arraylist_sort(ArrayList *arraylist, ArrayListCompareFunc compare_func);
212 
213 #ifdef __cplusplus
214 }
215 #endif
216 
217 #endif /* #ifndef ALGORITHM_ARRAYLIST_H */
218 
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ArrayListEqualFunc
int(* ArrayListEqualFunc)(ArrayListValue value1, ArrayListValue value2)
Compare two values in an arraylist to determine if they are equal.
Definition: arraylist.h:86
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
arraylist_remove_range
void arraylist_remove_range(ArrayList *arraylist, int index, int length)
Remove a range of entries at the specified location in an ArrayList.
index
Definition: index.py:1
_ArrayList::_alloced
int _alloced
Private data and should not be accessed.
Definition: arraylist.h:77
runLayerRecalibration.callback
callback
Definition: runLayerRecalibration.py:64
_ArrayList::data
ArrayListValue * data
Entries in the array.
Definition: arraylist.h:69
_ArrayList::length
int length
Length of the array.
Definition: arraylist.h:73
arraylist_sort
void arraylist_sort(ArrayList *arraylist, ArrayListCompareFunc compare_func)
Sort the values in an ArrayList.
arraylist_clear
void arraylist_clear(ArrayList *arraylist)
Remove all entries from an ArrayList.
ArrayListValue
void * ArrayListValue
A value to be stored in an ArrayList.
Definition: arraylist.h:50
arraylist_new
ArrayList * arraylist_new(int length)
Allocate a new ArrayList for use.
arraylist_prepend
int arraylist_prepend(ArrayList *arraylist, ArrayListValue data)
Prepend a value to the beginning of an ArrayList.
arraylist_insert
int arraylist_insert(ArrayList *arraylist, int index, ArrayListValue data)
Insert a value at the specified index in an ArrayList.
_ArrayList
Definition of an ArrayList.
Definition: arraylist.h:65
ArrayListCompareFunc
int(* ArrayListCompareFunc)(ArrayListValue value1, ArrayListValue value2)
Compare two values in an arraylist.
Definition: arraylist.h:100
arraylist_index_of
int arraylist_index_of(ArrayList *arraylist, ArrayListEqualFunc callback, ArrayListValue data)
Find the index of a particular value in an ArrayList.
arraylist_free
void arraylist_free(ArrayList *arraylist)
Destroy an ArrayList and free back the memory it uses.
arraylist_append
int arraylist_append(ArrayList *arraylist, ArrayListValue data)
Append a value to the end of an ArrayList.
arraylist_remove
void arraylist_remove(ArrayList *arraylist, int index)
Remove the entry at the specified location in an ArrayList.
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26