OpenTTD Source 20250312-master-gcdcc6b491d
cargopacket.h File Reference

Base class for cargo packets. More...

#include "core/pool_type.hpp"
#include "economy_type.h"
#include "station_type.h"
#include "order_type.h"
#include "cargo_type.h"
#include "source_type.h"
#include "vehicle_type.h"
#include "core/multimap.hpp"
#include "saveload/saveload.h"

Go to the source code of this file.

Data Structures

struct  CargoPacket
 Container for cargo from the same location and time. More...
 
struct  CargoPacket::Vector
 
class  CargoList< Tinst, Tcont >
 Simple collection class for a list of cargo packets. More...
 
class  VehicleCargoList
 CargoList that is used for vehicles. More...
 
class  StationCargoList
 CargoList that is used for stations. More...
 

Typedefs

using CargoPacketID = PoolID< uint32_t, struct CargoPacketIDTag, 0xFFF000, 0xFFFFFF >
 Unique identifier for a single cargo packet.
 
using CargoPacketPool = Pool< CargoPacket, CargoPacketID, 1024, PoolType::Normal, true >
 Type of the pool for cargo packets for a little over 16 million packets.
 
typedef std::list< CargoPacket * > CargoPacketList
 
typedef MultiMap< StationID, CargoPacket * > StationCargoPacketMap
 
typedef std::map< StationID, uint > StationCargoAmountMap
 

Functions

SaveLoadTable GetCargoPacketDesc ()
 Wrapper function to get the CargoPacket's internal structure while some of the variables itself are private.
 

Variables

CargoPacketPool _cargopacket_pool
 The actual pool with cargo packets.
 

Detailed Description

Base class for cargo packets.

Definition in file cargopacket.h.

Typedef Documentation

◆ CargoPacketID

using CargoPacketID = PoolID<uint32_t, struct CargoPacketIDTag, 0xFFF000, 0xFFFFFF>

Unique identifier for a single cargo packet.

Definition at line 24 of file cargopacket.h.

◆ CargoPacketList

typedef std::list<CargoPacket *> CargoPacketList

Definition at line 337 of file cargopacket.h.

◆ CargoPacketPool

Type of the pool for cargo packets for a little over 16 million packets.

Definition at line 28 of file cargopacket.h.

◆ StationCargoAmountMap

typedef std::map<StationID, uint> StationCargoAmountMap

Definition at line 514 of file cargopacket.h.

◆ StationCargoPacketMap

Definition at line 513 of file cargopacket.h.

Function Documentation

◆ GetCargoPacketDesc()

SaveLoadTable GetCargoPacketDesc ( )
extern

Wrapper function to get the CargoPacket's internal structure while some of the variables itself are private.

We want this to be saved, right?

Returns
the saveload description for CargoPackets.

Definition at line 125 of file cargopacket_sl.cpp.

Referenced by CAPAChunkHandler::Load(), and CAPAChunkHandler::Save().