OpenTTD Source: ContentCallback Struct Reference

OpenTTD Source 14.0-RC3

Public Member Functions
ContentCallback Struct Reference

Callbacks for notifying others about incoming data. More...

`#include <network_content.h>`

Inheritance diagram for ContentCallback:

## Public Member Functions
virtual void | OnConnect ([[maybe_unused]] bool success)
| Callback for when the connection has finished. More...
virtual void | OnDisconnect ()
| Callback for when the connection got disconnected.
virtual void | OnReceiveContentInfo ([[maybe_unused]] const ContentInfo *ci)
| We received a content info. More...
virtual void | OnDownloadProgress ([[maybe_unused]] const ContentInfo *ci, [[maybe_unused]] int bytes)
| We have progress in the download of a file. More...
virtual void | OnDownloadComplete ([[maybe_unused]] ContentID cid)
| We have finished downloading a file. More...
virtual | ~ContentCallback ()=default
| Silentium.

## Detailed Description

Callbacks for notifying others about incoming data.

Definition at line 29 of file network_content.h.

## Member Function Documentation

## ◆ OnConnect()

virtual void ContentCallback::OnConnect | ( | [[maybe_unused] ] bool | success | ) |
| inlinevirtual

Callback for when the connection has finished.

Parameters

  success | whether the connection was made or that we failed to make it

Definition at line 34 of file network_content.h.

## ◆ OnDownloadComplete()

virtual void ContentCallback::OnDownloadComplete | ( | [[maybe_unused] ] ContentID | cid | ) |
| inlinevirtual

We have finished downloading a file.

Parameters

  cid | the ContentID of the downloaded file

Definition at line 58 of file network_content.h.

## ◆ OnDownloadProgress()

virtual void ContentCallback::OnDownloadProgress | ( | [[maybe_unused] ] const ContentInfo * | ci,
|  | [[maybe_unused] ] int | bytes
| ) |  |
| inlinevirtual

We have progress in the download of a file.

Parameters

  ci | the content info of the file
  bytes | the number of bytes downloaded since the previous call

Definition at line 52 of file network_content.h.

## ◆ OnReceiveContentInfo()

virtual void ContentCallback::OnReceiveContentInfo | ( | [[maybe_unused] ] const ContentInfo * | ci | ) |
| inlinevirtual

We received a content info.

Parameters

  ci | the content info

Definition at line 45 of file network_content.h.

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

- src/network/network_content.h