OpenTTD
|
Set containing 'items' items of 'tile and Tdir' No tree structure is used because it would cause slowdowns in most usual cases. More...
Data Structures | |
struct | SSdata |
Element of set. More... | |
Public Member Functions | |
SmallSet (const char *name) | |
Constructor - just set default values and 'name'. | |
void | Reset () |
Reset variables to default values. | |
bool | Overflowed () |
Returns value of 'overflowed'. More... | |
bool | IsEmpty () |
Checks for empty set. More... | |
bool | IsFull () |
Checks for full set. More... | |
uint | Items () |
Reads the number of items. More... | |
bool | Remove (TileIndex tile, Tdir dir) |
Tries to remove first instance of given tile and dir. More... | |
bool | IsIn (TileIndex tile, Tdir dir) |
Tries to find given tile and dir in the set. More... | |
bool | Add (TileIndex tile, Tdir dir) |
Adds tile & dir into the set, checks for full set Sets the 'overflowed' flag if the set was full. More... | |
bool | Get (TileIndex *tile, Tdir *dir) |
Reads the last added element into the set. More... | |
Private Attributes | |
uint | n |
bool | overflowed |
const char * | name |
struct SmallSet::SSdata | data [items] |
Set containing 'items' items of 'tile and Tdir' No tree structure is used because it would cause slowdowns in most usual cases.
Definition at line 54 of file signal.cpp.
|
inline |
Adds tile & dir into the set, checks for full set Sets the 'overflowed' flag if the set was full.
tile | tile |
dir | and dir to add |
Definition at line 154 of file signal.cpp.
References DEBUG, and SmallSet< Tdir, items >::IsFull().
Referenced by MaybeAddToTodoSet().
|
inline |
Reads the last added element into the set.
tile | pointer where tile is written to |
dir | pointer where dir is written to |
Definition at line 175 of file signal.cpp.
References _globset, _tbdset, and _tbuset.
Referenced by UpdateSignalsAroundSegment().
|
inline |
Checks for empty set.
Definition at line 90 of file signal.cpp.
Referenced by UpdateSignalsInBuffer().
|
inline |
Checks for full set.
Definition at line 99 of file signal.cpp.
References lengthof.
Referenced by SmallSet< Tdir, items >::Add().
|
inline |
Tries to find given tile and dir in the set.
tile | tile |
dir | and dir to find |
Definition at line 138 of file signal.cpp.
|
inline |
Reads the number of items.
Definition at line 108 of file signal.cpp.
|
inline |
Returns value of 'overflowed'.
Definition at line 81 of file signal.cpp.
|
inline |
Tries to remove first instance of given tile and dir.
tile | tile |
dir | and dir to remove |
Definition at line 120 of file signal.cpp.
Referenced by CheckAddToTodoSet().