Alert

abstract class Alert

The base class that every specific notification is derived from, ported from libtorrent::alert (include/libtorrent/alert.hpp).

In libtorrent, alerts are produced by the session and retrieved with session::pop_alerts(). Each concrete alert exposes a stable integer type (its alert_type constant), a short literal what, a human-readable message, and the category bitmask it belongs to.

libtorrent's C++ alerts are non-copyable, short-lived objects tied to a stack allocator. The KiteTorrent ports are plain immutable data classes instead, so you may copy and retain them freely.

See also

for the category bit values.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract val category: Int

The bitmask of AlertCategory flags this alert belongs to. Mirrors alert::category(), which returns the concrete alert's static_category.

Link copied to clipboard
abstract val type: Int

An integer unique to this alert type, matching the C++ alert_type static constant. It can be compared against a concrete alert's ALERT_TYPE to determine the runtime type. Mirrors alert::type().

Link copied to clipboard
abstract val what: String

A short string literal naming the alert type (e.g. "torrent_finished"). It carries no bundled information. Mirrors alert::what(), which in libtorrent returns alert_name(alert_type).

Functions

Link copied to clipboard
abstract fun message(): String

A string describing the alert and the information bundled with it. Intended for debugging/development, not localization. Mirrors alert::message().