# BaseStorageArray Struct Reference

Base class for all NewGRF storage arrays. More...

`#include <newgrf_storage.h>`

Inheritance diagram for BaseStorageArray:

## Public Member Functions
virtual | ~BaseStorageArray ()
| The needed destructor.
virtual void | ClearChanges (bool keep_changes)=0
| Clear the changes made since the last ClearChanges.
virtual void | Store (uint pos, uint32 value)=0
| Stores some value at a given position.

## Detailed Description

Base class for all NewGRF storage arrays.

Nothing fancy, only here so we have a generalised class to use.

Definition at line 21 of file newgrf_storage.h.

## Member Function Documentation

virtual void BaseStorageArray::ClearChanges | ( | bool | keep_changes | ) | `[pure virtual]`

Clear the changes made since the last ClearChanges.

This can be done in two ways:

- saving the changes permanently
- reverting to the previous version
  Parameters:

    | keep_changes | do we save or revert the changes since the last ClearChanges?

Implemented in PersistentStorageArray< TYPE, SIZE >, TemporaryStorageArray< TYPE, SIZE >, and PersistentStorageArray< uint32, 16 >.

virtual void BaseStorageArray::Store | ( | uint | pos,
|  | uint32 | value |
| ) |  |  | `[pure virtual]`

Stores some value at a given position.

Parameters:

  | pos | the position to write at
  | value | the value to write

Implemented in PersistentStorageArray< TYPE, SIZE >, TemporaryStorageArray< TYPE, SIZE >, and PersistentStorageArray< uint32, 16 >.

The documentation for this struct was generated from the following file:

- src/newgrf_storage.h