OpenTTD Source 20250708-master-g6d86c760c6
|
Flat set implementation that uses a sorted vector for storage. More...
#include <flatset_type.hpp>
Public Types | |
using | const_iterator = std::vector< Tkey >::const_iterator |
Public Member Functions | |
std::pair< const_iterator, bool > | insert (const Tkey &key) |
Insert a key into the set, if it does not already exist. | |
size_t | erase (const Tkey &key) |
Erase a key from the set. | |
bool | contains (const Tkey &key) |
Test if a key exists in the set. | |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
size_t | size () const |
bool | empty () const |
void | clear () |
auto | operator<=> (const FlatSet< Tkey, Tcompare > &) const =default |
Private Attributes | |
std::vector< Tkey > | data |
Sorted vector. of values. | |
Flat set implementation that uses a sorted vector for storage.
This is subset of functionality implemented by std::flat_set in c++23.
Tkey | key type. |
Tcompare | key comparator. |
Definition at line 20 of file flatset_type.hpp.
using FlatSet< Tkey, Tcompare >::const_iterator = std::vector<Tkey>::const_iterator |
Definition at line 23 of file flatset_type.hpp.
|
inline |
Definition at line 62 of file flatset_type.hpp.
|
inline |
Definition at line 65 of file flatset_type.hpp.
|
inline |
Definition at line 66 of file flatset_type.hpp.
|
inline |
Definition at line 71 of file flatset_type.hpp.
|
inline |
Test if a key exists in the set.
key | Key to test. |
Definition at line 57 of file flatset_type.hpp.
Referenced by FlowRiver().
|
inline |
Definition at line 69 of file flatset_type.hpp.
|
inline |
Definition at line 63 of file flatset_type.hpp.
|
inline |
Erase a key from the set.
key | Key to erase. |
Definition at line 43 of file flatset_type.hpp.
|
inline |
Insert a key into the set, if it does not already exist.
key | Key to insert. |
Definition at line 31 of file flatset_type.hpp.
Referenced by FlowRiver(), ForAllStationsAroundTiles(), ReplaceVehicleWindow::GenerateReplaceVehList(), GetProductionAroundTiles(), GfxBlitter(), and Station::RemoveFromAllNearbyLists().
|
inline |
Definition at line 68 of file flatset_type.hpp.
|
private |
Sorted vector. of values.
Definition at line 21 of file flatset_type.hpp.