SpECTRE  v2021.11.01
db::BaseTag Struct Reference

Mark a (usually) empty struct as a base tag by inheriting from this. More...

#include <Tag.hpp>

Detailed Description

Mark a (usually) empty struct as a base tag by inheriting from this.

Details

A base tag may be the base class of a simple tag. In such a case, the base tag can be used to fetch the item corresponding to the simple tag (or a compute tag derived from that simple tag) from a DataBox.

Base tags are empty structs and therefore do not contain information about the type of the object to which they refer. Base tags are designed so that retrieving items from the DataBox or setting argument tags in compute items can be done without any knowledge of the type of the item.

Base tags should be used rarely, only in cases where it is difficult to propagate the type information to the call site. Please consult a core developer before introducing a new base tag.

By convention, the name of a base tag should either be the name of the simple tag that derives from it appended by Base. Alternatively, if the simple tag is templated with a type used to determine its type type alias, the base tag can have the same name as the simple tag template with an empty template parameter list.

A base tag may optionally specify a static std::string name() method to override the default name produced by db::tag_name.

Warning
Do not derive a base tag from anything besides db::BaseTag.
See also
DataBox SimpleTag

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