wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
annotations.hpp File Reference

The column annotation vocabulary generated client-database record structs declare their schema roles with. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wowlib::db::detail::IdSpec
 Stored form of id: the member is the table's primary key ($id$). More...
struct  wowlib::db::detail::NoninlineSpec
 Stored form of noninline: the member holds no bytes inside the record image — its values come from a satellite block (the WDC id list for ids, the relationship block for relations). More...
struct  wowlib::db::detail::RelationSpec
 Stored form of relation: the member is a relationship key referencing the parent table's id ($relation$). More...

Namespaces

namespace  wowlib
namespace  wowlib::db
namespace  wowlib::db::detail

Variables

constexpr detail::IdSpec wowlib::db::Id {}
 Mark the table's primary-key column ($id$ in WoWDBDefs).
constexpr detail::NoninlineSpec wowlib::db::Noninline {}
 Mark a column stored outside the record image ($noninline$ in WoWDBDefs): ids delivered by the WDC id list, relations delivered by the relationship block.
constexpr detail::RelationSpec wowlib::db::Relation {}
 Mark a relationship-key column ($relation$ in WoWDBDefs): its value references the id of the table's parent (e.g.

Detailed Description

The column annotation vocabulary generated client-database record structs declare their schema roles with.

Follows the formats convention: structural *_spec payloads in detail, inline constants as the user-facing spelling.

Usage (a dbdgen-generated record):

struct MapRecord
{
static constexpr ClientVersion version = versions::wotlk;
static constexpr std::string_view TableName = "Map";
[[=db::id]]
std::uint32_t id = 0;
std::string directory;
[[=db::relation]]
std::uint32_t area_table_id = 0;
};

The annotations carry what a member's C++ type cannot: which column is the primary key, whether it lives outside the record image (WDC id lists / relationship blocks), and which column is a relationship key. Everything else — integer width and signedness, arrays, strings, localized strings — the schema reflection reads off the member type itself (schema.hpp).

Definition in file annotations.hpp.