#include <smallvec_type.hpp>
Public Member Functions | |
FORCEINLINE void | Clear () |
Remove all items from the list. | |
FORCEINLINE void | Reset () |
Remove all items from the list and free allocated memory. | |
FORCEINLINE void | Compact () |
Compact the list down to the smallest block size boundary. | |
FORCEINLINE T * | Append () |
Append an item and return it. | |
FORCEINLINE const T * | Find (const T &item) const |
Search for the first occurence of an item. | |
FORCEINLINE T * | Find (const T &item) |
Search for the first occurence of an item. | |
FORCEINLINE int | FindIndex (const T &item) |
Search for the first occurence of an item. | |
FORCEINLINE bool | Contains (const T &item) const |
Tests whether a item is present in the vector. | |
FORCEINLINE void | Erase (T *item) |
Removes given item from this vector. | |
FORCEINLINE bool | Include (const T &item) |
Tests whether a item is present in the vector, and appends it to the end if not. | |
FORCEINLINE uint | Length () const |
Get the number of items in the list. | |
FORCEINLINE const T * | Begin () const |
Get the pointer to the first item (const). | |
FORCEINLINE T * | Begin () |
Get the pointer to the first item. | |
FORCEINLINE const T * | End () const |
Get the pointer behind the last valid item (const). | |
FORCEINLINE T * | End () |
Get the pointer behind the last valid item. | |
FORCEINLINE const T * | Get (uint index) const |
Get the pointer to item "number" (const). | |
FORCEINLINE T * | Get (uint index) |
Get the pointer to item "number". | |
FORCEINLINE const T & | operator[] (uint index) const |
Get item "number" (const). | |
FORCEINLINE T & | operator[] (uint index) |
Get item "number". | |
Protected Attributes | |
T * | data |
The pointer to the first item. | |
uint | items |
The number of items stored. | |
uint | capacity |
The avalible space for storing items. |
T | The type of the items stored | |
S | The steps of allocation |
Definition at line 29 of file smallvec_type.hpp.
FORCEINLINE T* SmallVector< T, S >::Append | ( | ) | [inline] |
Append an item and return it.
Definition at line 81 of file smallvec_type.hpp.
Referenced by AddChildSpriteScreen(), FiosFileScanner::AddFile(), AddNearbyStation(), AddSortableSpriteToDraw(), AddTileSpriteToDraw(), BuildDepotVehicleList(), NewGRFAddWindow::BuildGrfList(), IndustryDirectoryWindow::BuildSortIndustriesList(), CompanyStationsWindow::BuildStationsList(), CmdBuildRailStation(), CmdConvertRail(), DrawString(), FindIndustryToDeliver(), FindStationsNearby(), FiosGetFileList(), ReplaceVehicleWindow::GenerateReplaceVehList(), GenerateVehicleSortList(), GetCargoSummaryOfArticulatedVehicle(), GetNewEngine(), SmallVector< RefitOption, 32 >::Include(), ini_load_setting_list(), MakeTrainBackup(), and ShowBuildBridgeWindow().
FORCEINLINE const T* SmallVector< T, S >::Find | ( | const T & | item | ) | const [inline] |
Search for the first occurence of an item.
The '!=' operator of T is used for comparison.
item | Item to search for |
Definition at line 97 of file smallvec_type.hpp.
Referenced by SmallVector< RefitOption, 32 >::Contains(), and GetCargoSummaryOfArticulatedVehicle().
FORCEINLINE T* SmallVector< T, S >::Find | ( | const T & | item | ) | [inline] |
Search for the first occurence of an item.
The '!=' operator of T is used for comparison.
item | Item to search for |
Definition at line 111 of file smallvec_type.hpp.
FORCEINLINE int SmallVector< T, S >::FindIndex | ( | const T & | item | ) | [inline] |
Search for the first occurence of an item.
The '!=' operator of T is used for comparison.
item | Item to search for |
Definition at line 125 of file smallvec_type.hpp.
Referenced by FinalisePriceBaseMultipliers(), and NewGRFAddWindow::UpdateListPosition().
FORCEINLINE bool SmallVector< T, S >::Contains | ( | const T & | item | ) | const [inline] |
Tests whether a item is present in the vector.
The '!=' operator of T is used for comparison.
item | Item to test for |
Definition at line 143 of file smallvec_type.hpp.
Referenced by AddNearbyStation(), FindIndustryToDeliver(), SmallVector< RefitOption, 32 >::Include(), and WhoCanServiceIndustry().
FORCEINLINE void SmallVector< T, S >::Erase | ( | T * | item | ) | [inline] |
Removes given item from this vector.
item | item to remove |
Definition at line 153 of file smallvec_type.hpp.
Referenced by AddNearbyStation().
FORCEINLINE bool SmallVector< T, S >::Include | ( | const T & | item | ) | [inline] |
Tests whether a item is present in the vector, and appends it to the end if not.
The '!=' operator of T is used for comparison.
item | Item to test for |
Definition at line 165 of file smallvec_type.hpp.
Referenced by BuildRefitList(), CheckSubsidised(), DeliverGoodsToIndustry(), FindStationsAroundTiles(), and RemoveFromRailBaseStation().
FORCEINLINE const T* SmallVector< T, S >::Begin | ( | ) | const [inline] |
Get the pointer to the first item (const).
Definition at line 185 of file smallvec_type.hpp.
Referenced by FiosFileScanner::AddFile(), CheckSubsidised(), CmdRemoveFromRailStation(), DrawString(), EngList_Sort(), SmallVector< RefitOption, 32 >::Erase(), FinaliseHouseArray(), FinaliseIndustriesArray(), FinalisePriceBaseMultipliers(), SmallVector< RefitOption, 32 >::Find(), SmallVector< RefitOption, 32 >::FindIndex(), FiosGetFileList(), BaseSet< MusicSet, NUM_SONGS_AVAILABLE, GM_DIR >::GetDescription(), ini_save_setting_list(), LoadUnloadStation(), MoveWaypointsToBaseStations(), RemoveFromRailBaseStation(), RestoreTrainBackup(), UpdateWaypointOrder(), ViewportDrawBoundingBoxes(), ViewportSortParentSprites(), and BaseSet< MusicSet, NUM_SONGS_AVAILABLE, GM_DIR >::~BaseSet().
FORCEINLINE T* SmallVector< T, S >::Begin | ( | ) | [inline] |
Get the pointer to the first item.
Definition at line 195 of file smallvec_type.hpp.
FORCEINLINE const T* SmallVector< T, S >::End | ( | ) | const [inline] |
Get the pointer behind the last valid item (const).
Definition at line 205 of file smallvec_type.hpp.
Referenced by AddCombinedSprite(), FiosFileScanner::AddFile(), CheckSubsidised(), CmdRemoveFromRailStation(), SmallVector< RefitOption, 32 >::Contains(), DrawString(), SmallVector< RefitOption, 32 >::Erase(), FinaliseHouseArray(), FinaliseIndustriesArray(), FinalisePriceBaseMultipliers(), SmallVector< RefitOption, 32 >::Find(), SmallVector< RefitOption, 32 >::FindIndex(), GetCargoSummaryOfArticulatedVehicle(), BaseSet< MusicSet, NUM_SONGS_AVAILABLE, GM_DIR >::GetDescription(), ini_save_setting_list(), LoadUnloadStation(), MoveWaypointsToBaseStations(), RemoveFromRailBaseStation(), RestoreTrainBackup(), UpdateWaypointOrder(), ViewportDrawBoundingBoxes(), ViewportSortParentSprites(), and BaseSet< MusicSet, NUM_SONGS_AVAILABLE, GM_DIR >::~BaseSet().
FORCEINLINE T* SmallVector< T, S >::End | ( | ) | [inline] |
Get the pointer behind the last valid item.
Definition at line 215 of file smallvec_type.hpp.
FORCEINLINE const T* SmallVector< T, S >::Get | ( | uint | index | ) | const [inline] |
Get the pointer to item "number" (const).
index | the position of the item |
Definition at line 226 of file smallvec_type.hpp.
Referenced by AddNearbyStation(), EngList_SortPartial(), FiosGetFileList(), and GetNewEngine().
FORCEINLINE T* SmallVector< T, S >::Get | ( | uint | index | ) | [inline] |
Get the pointer to item "number".
index | the position of the item |
Definition at line 239 of file smallvec_type.hpp.
FORCEINLINE const T& SmallVector< T, S >::operator[] | ( | uint | index | ) | const [inline] |
Get item "number" (const).
index | the positon of the item |
Definition at line 252 of file smallvec_type.hpp.
FORCEINLINE T& SmallVector< T, S >::operator[] | ( | uint | index | ) | [inline] |
Get item "number".
index | the positon of the item |
Definition at line 264 of file smallvec_type.hpp.