OpenTTD
Data Structures | Macros | Typedefs | Variables
order_backup.h File Reference

Functions related to order backups. More...

#include "core/pool_type.hpp"
#include "group_type.h"
#include "tile_type.h"
#include "vehicle_type.h"
#include "base_consist.h"

Go to the source code of this file.

Data Structures

struct  OrderBackup
 Data for backing up an order of a vehicle so it can be restored after a vehicle is rebuilt in the same depot. More...
 

Macros

#define FOR_ALL_ORDER_BACKUPS_FROM(var, start)   FOR_ALL_ITEMS_FROM(OrderBackup, order_backup_index, var, start)
 Iterator over all order backups from a given ID. More...
 
#define FOR_ALL_ORDER_BACKUPS(var)   FOR_ALL_ORDER_BACKUPS_FROM(var, 0)
 Iterator over all order backups. More...
 

Typedefs

typedef uint8 OrderBackupID
 Unique identifier for an order backup. More...
 
typedef Pool< OrderBackup, OrderBackupID, 1, 256 > OrderBackupPool
 The pool type for order backups. More...
 

Variables

OrderBackupPool _order_backup_pool
 The pool with order backups. More...
 
static const uint32 MAKE_ORDER_BACKUP_FLAG = 1U << 31
 Flag to pass to the vehicle construction command when an order should be preserved. More...
 

Detailed Description

Functions related to order backups.

Definition in file order_backup.h.

Macro Definition Documentation

◆ FOR_ALL_ORDER_BACKUPS

#define FOR_ALL_ORDER_BACKUPS (   var)    FOR_ALL_ORDER_BACKUPS_FROM(var, 0)

Iterator over all order backups.

Parameters
varThe variable to iterate with.

Definition at line 80 of file order_backup.h.

Referenced by OrderBackup::Backup(), OrderBackup::ClearGroup(), OrderBackup::RemoveOrder(), OrderBackup::Reset(), OrderBackup::ResetOfUser(), and OrderBackup::Restore().

◆ FOR_ALL_ORDER_BACKUPS_FROM

#define FOR_ALL_ORDER_BACKUPS_FROM (   var,
  start 
)    FOR_ALL_ITEMS_FROM(OrderBackup, order_backup_index, var, start)

Iterator over all order backups from a given ID.

Parameters
varThe variable to iterate with.
startThe start of the iteration.

Definition at line 74 of file order_backup.h.

Typedef Documentation

◆ OrderBackupID

typedef uint8 OrderBackupID

Unique identifier for an order backup.

Definition at line 22 of file order_backup.h.

◆ OrderBackupPool

The pool type for order backups.

Definition at line 23 of file order_backup.h.

Variable Documentation

◆ _order_backup_pool

OrderBackupPool _order_backup_pool

The pool with order backups.

◆ MAKE_ORDER_BACKUP_FLAG

const uint32 MAKE_ORDER_BACKUP_FLAG = 1U << 31
static

Flag to pass to the vehicle construction command when an order should be preserved.

Definition at line 31 of file order_backup.h.

Referenced by CmdSellRailWagon(), and CmdSellVehicle().