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 'oveflowed'. | |
| bool | IsEmpty () |
| Checks for empty set. | |
| bool | IsFull () |
| Checks for full set. | |
| uint | Items () |
| Reads the number of items. | |
| bool | Remove (TileIndex tile, Tdir dir) |
| Tries to remove first instance of given tile and dir. | |
| bool | IsIn (TileIndex tile, Tdir dir) |
| Tries to find given tile and dir in the set. | |
| 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. | |
| bool | Get (TileIndex *tile, Tdir *dir) |
| Reads the last added element into the set. | |
Private Attributes | |
| uint | n |
| bool | overflowed |
| const char * | name |
| struct SmallSet::SSdata | data [items] |
| Element of set. | |
Data Structures | |
| struct | SSdata |
| Element of set. More... | |
Definition at line 47 of file signal.cpp.
| bool SmallSet< Tdir, items >::Overflowed | ( | ) | [inline] |
Returns value of 'oveflowed'.
Definition at line 74 of file signal.cpp.
| bool SmallSet< Tdir, items >::IsEmpty | ( | ) | [inline] |
| bool SmallSet< Tdir, items >::IsFull | ( | ) | [inline] |
Checks for full set.
Definition at line 92 of file signal.cpp.
References SmallSet< Tdir, items >::data, and lengthof.
Referenced by SmallSet< Tdir, items >::Add().
| uint SmallSet< Tdir, items >::Items | ( | ) | [inline] |
Reads the number of items.
Definition at line 101 of file signal.cpp.
| bool SmallSet< Tdir, items >::Remove | ( | TileIndex | tile, | |
| Tdir | dir | |||
| ) | [inline] |
Tries to remove first instance of given tile and dir.
| tile | tile | |
| dir | and dir to remove |
Definition at line 113 of file signal.cpp.
References SmallSet< Tdir, items >::data.
| bool SmallSet< Tdir, items >::IsIn | ( | TileIndex | tile, | |
| Tdir | dir | |||
| ) | [inline] |
Tries to find given tile and dir in the set.
| tile | tile | |
| dir | and dir to find |
Definition at line 131 of file signal.cpp.
References SmallSet< Tdir, items >::data.
| bool SmallSet< Tdir, items >::Add | ( | TileIndex | tile, | |
| Tdir | dir | |||
| ) | [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 147 of file signal.cpp.
References SmallSet< Tdir, items >::data, SmallSet< Tdir, items >::SSdata::dir, SmallSet< Tdir, items >::IsFull(), and SmallSet< Tdir, items >::SSdata::tile.
| bool SmallSet< Tdir, items >::Get | ( | TileIndex * | tile, | |
| Tdir * | dir | |||
| ) | [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 168 of file signal.cpp.
References SmallSet< Tdir, items >::data, SmallSet< Tdir, items >::SSdata::dir, and SmallSet< Tdir, items >::SSdata::tile.
1.5.6