# cargopacket.h File Reference

Base class for cargo packets. More...

`#include "oldpool.h"`
`#include "economy_type.h"`
`#include "tile_type.h"`
`#include "station_type.h"`
`#include <list>`

Go to the source code of this file.

## Data Structures
struct | CargoPacket
| We want to use a pool. More...
class | CargoList
| Simple collection class for a list of cargo packets. More...
## Defines
#define | FOR_ALL_CARGOPACKETS_FROM(cp, start) for (cp = GetCargoPacket(start); cp != NULL; cp = (cp->index + 1U < GetCargoPacketPoolSize()) ? GetCargoPacket(cp->index + 1U) : NULL) if (cp->IsValid())
| Iterate over all _valid_ cargo packets from the given start.
#define | FOR_ALL_CARGOPACKETS(cp) FOR_ALL_CARGOPACKETS_FROM(cp, 0)
| Iterate over all _valid_ cargo packets from the begin of the pool.
## Typedefs
typedef uint32 | CargoPacketID
## Functions
void | SaveLoad_STNS (Station *st)

## Detailed Description

Base class for cargo packets.

Definition in file cargopacket.h.

## Define Documentation

#define FOR_ALL_CARGOPACKETS | ( | cp |  | ) | FOR_ALL_CARGOPACKETS_FROM(cp, 0)

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

Parameters:

  | cp | the variable used as "iterator"

Definition at line 71 of file cargopacket.h.

#define FOR_ALL_CARGOPACKETS_FROM | ( | cp,
|  | start |  | ) | for (cp = GetCargoPacket(start); cp != NULL; cp = (cp->index + 1U < GetCargoPacketPoolSize()) ? GetCargoPacket(cp->index + 1U) : NULL) if (cp->IsValid())

Iterate over all _valid_ cargo packets from the given start.

Parameters:

  | cp | the variable used as "iterator"
  | start | the cargo packet ID of the first packet to iterate over

Definition at line 65 of file cargopacket.h.