SpECTRE  v2024.04.12
db::PrefixTag Struct Reference

Mark a struct as a prefix tag by inheriting from this. More...

#include <Tag.hpp>

Detailed Description

Mark a struct as a prefix tag by inheriting from this.

Details

A prefix tag is used to create a new simple tag from another simple tag, and therefore should also be marked as a simple tag by inheriting from db::SimpleTag.

The primary reason to mark a simple tag as a prefix tag is that the name generated by db::tag_name will be constructed from the names of the prefix tag and the wrapped simple tag.

Derived Class Requires:

  • type alias tag of the wrapped simple tag
  • type alias type of the type of the item corresponding to the prefix tag

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

Warning
A prefix tag should only be derived from db::PrefixTag and db::SimpleTag.
A prefix tag should only wrap a single tag. This is assumed by all metafunctions that make use of the tag type alias of a prefix tag.

Example

A PrefixTag tag has the structure:

template <typename Tag>
struct TagPrefix : db::PrefixTag, db::SimpleTag {
using type = typename Tag::type;
using tag = Tag;
static std::string name() { return "TagPrefix(" + db::tag_name<Tag>() + ")"; }
};
std::string name()
Return the result of the name() member of a class. If a class doesn't have a name() member,...
Definition: PrettyType.hpp:733
Mark a struct as a prefix tag by inheriting from this.
Definition: Tag.hpp:103
Mark a struct as a simple tag by inheriting from this.
Definition: Tag.hpp:36
See also
SimpleTag

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