ronelib
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs
neighborListOps.h
Go to the documentation of this file.
1 
9 #ifndef NEIGHBORLISTOPS_H_
10 #define NEIGHBORLISTOPS_H_
11 
12 
19 void nbrListCreate(NbrList* nbrListPtr);
20 
21 
22 //TODO: implement or delete?
23 void groupList(NbrList* partialList, int group);
24 void groupTestList(NbrList* partialList, int group, NbrList* full);
25 
26 //TODO: Functions from neighbors.c - move or not?
33 void nbrListClear(NbrList* nbrListPtr);
34 
35 
36 /*
37  * @brief Gets the size of the input neighbor list
38  *
39  * @param nbrListPtr pointer for the neighbor list
40  * @returns size of neighbor list
41  */
42 uint8 nbrListGetSize(NbrList* nbrListPtr);
43 
44 
45 /*
46  * @brief Gets the neighbor at a given index in neighbor list
47  *
48  * @param nbrListPtr pointer for the neighbor list
49  * @param idx index
50  * @returns pointer to the neighbor at the input index
51  */
52 Nbr* nbrListGetNbr(NbrList* nbrListPtr, uint8 idx);
53 
54 
55 /*
56  * @brief Prints the IDs of all robots in the neighbor list.
57  *
58  * Formated as follows:
59  * {name, ID, ID, ID, ...}
60  * @param nbrListPtr pointer for the neighbor list
61  * @param name for the list name
62  * @returns void
63  */
64 void nbrListPrint(NbrList* nbrListPtr, char* name);
65 
66 
76 void nbrListPrintDebug(NbrList* nbrListPtr, char* name);
77 //TODO: End neighbors.c functions
78 
89 void nbrListAddNbr(NbrList* nbrListPtr, Nbr* nbrPtr);
90 
91 
103 void nbrListRemoveNbr(NbrList* nbrListPtr, Nbr* nbrPtr);
104 
105 
113 void nbrListCopy(NbrList* nbrListDstPtr, NbrList* nbrListSrcPtr);
114 
115 
122 int16 nbrListAverageBearing(NbrList* nbrListPtr);
123 
124 
131 Nbr* nbrListGetFirst(NbrList* nbrListPtr);
132 
133 
140 Nbr* nbrListGetSecond(NbrList* nbrListPtr);
141 
142 
150 Nbr* nbrListGetNbrWithID(NbrList* nbrListPtr, uint8 ID);
151 
152 
160 Nbr* nbrListGetSmallestAngleDeviation2(NbrList* nbrListPtr, Nbr* nbrPtr);
161 
162 
170 Nbr* nbrListGetClosestNbrToBearing(NbrList* nbrListPtr, int16 bearing);
171 
172 
181 NbrList* nbrListUnion(NbrList* nbrListOutPtr, NbrList* nbrList1Ptr, NbrList* nbrList2Ptr);
182 
183 
193 NbrList* nbrListFindNbrsWithDataEqual(NbrList* nbrListOutPtr, NbrList* nbrListInPtr, NbrData* nbrDataPtr, uint8 val);
194 
195 
206 NbrList* nbrListFindNbrsWithDataEqual2(NbrList* nbrListOutPtr, NbrList* nbrListInPtr, NbrData* nbrDataPtr, uint8 val1, uint8 val2);
207 
208 
215 Nbr* nbrListGetNbrMinBearing(NbrList* nbrListInPtr);
216 
217 
225 NbrList* nbrListSortByBearing(NbrList* nbrListOutPtr, NbrList* nbrListInPtr);
226 
227 
238 NbrList* nbrListIncludeSectorInclusive(NbrList* nbrListOutPtr, NbrList* nbrListInPtr, int16 angleStart, int16 angleEnd);
239 
240 
251 NbrList* nbrListIncludeSectorExclusive(NbrList* nbrListOutPtr, NbrList* nbrListInPtr, int16 angleStart, int16 angleEnd);
252 
253 
261 NbrList* nbrListGetRobots(NbrList* nbrListOutPtr, NbrList* nbrListInPtr);
262 
263 
264 void nbrListMakeCloneExcept(NbrList* nbrListOutPtr, uint8 nbrID);
265 
266 #endif /* NEIGHBORLISTOPS_H_ */