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 "cargotype.h"
#include "vehicle_type.h"
#include "core/multimap.hpp"
#include <list>

Go to the source code of this file.

Data Structures

struct  CargoPacket
 Container for cargo from the same location and time. More...
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...

Defines

#define FOR_ALL_CARGOPACKETS_FROM(var, start)   FOR_ALL_ITEMS_FROM(CargoPacket, cargopacket_index, var, start)
 Iterate over all _valid_ cargo packets from the given start.
#define FOR_ALL_CARGOPACKETS(var)   FOR_ALL_CARGOPACKETS_FROM(var, 0)
 Iterate over all _valid_ cargo packets from the begin of the pool.

Typedefs

typedef uint32 CargoPacketID
 Unique identifier for a single cargo packet.
typedef Pool< CargoPacket,
CargoPacketID, 1024, 0xFFF000, PT_NORMAL, true, false > 
CargoPacketPool
 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

Enumerations

enum  UnloadType { UL_KEEP = 0, UL_DELIVER = 1 << 0, UL_TRANSFER = 1 << 1, UL_ACCEPTED = 1 << 2 }
 

Kind of actions that could be done with packets on unloading.

More...

Functions

struct SaveLoadGetCargoPacketDesc ()
 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.


Define Documentation

#define FOR_ALL_CARGOPACKETS ( var   )     FOR_ALL_CARGOPACKETS_FROM(var, 0)

Iterate over all _valid_ cargo packets from the begin of the pool.

Parameters:
var Variable used as "iterator".

Definition at line 164 of file cargopacket.h.

Referenced by CargoPacket::AfterLoad(), CargoPacket::InvalidateAllFrom(), and Save_CAPA().

#define FOR_ALL_CARGOPACKETS_FROM ( var,
start   )     FOR_ALL_ITEMS_FROM(CargoPacket, cargopacket_index, var, start)

Iterate over all _valid_ cargo packets from the given start.

Parameters:
var Variable used as "iterator".
start Cargo packet ID of the first packet to iterate over.

Definition at line 158 of file cargopacket.h.


Typedef Documentation

typedef uint32 CargoPacketID

Unique identifier for a single cargo packet.

Definition at line 26 of file cargopacket.h.

typedef Pool<CargoPacket, CargoPacketID, 1024, 0xFFF000, PT_NORMAL, true, false> CargoPacketPool

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

Definition at line 27 of file cargopacket.h.


Enumeration Type Documentation

enum UnloadType

Kind of actions that could be done with packets on unloading.

Enumerator:
UL_KEEP 

keep cargo on vehicle

UL_DELIVER 

deliver cargo

UL_TRANSFER 

transfer cargo

UL_ACCEPTED 

cargo is accepted

Definition at line 167 of file cargopacket.h.


Function Documentation

struct SaveLoad* GetCargoPacketDesc (  )  [read]

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 87 of file cargopacket_sl.cpp.

References SL_MAX_VERSION, SLE_CONDNULL, SLE_CONDVAR, SLE_END, and SLE_VAR.

Referenced by Load_CAPA(), and Save_CAPA().


Variable Documentation

The actual pool with cargo packets.


Generated on Fri May 27 04:19:53 2011 for OpenTTD by  doxygen 1.6.1