SpECTRE  v2021.12.06
db::DataBox< tmpl::list< Tags... > > Class Template Reference

A DataBox stores objects that can be retrieved by using Tags. More...

#include <DataBox.hpp>

Public Types

using tags_list = tmpl::list< Tags... >
 A typelist (tmpl::list) of Tags that the DataBox holds.
 
using immutable_item_tags = tmpl::filter< tags_list, db::is_immutable_item_tag< tmpl::_1 > >
 A list of all the immutable item tags, including their subitems.
 
using immutable_item_creation_tags = tmpl::remove_if< immutable_item_tags, tt::is_a<::Tags::Subitem, tmpl::_1 > >
 A list of all the immutable item tags used to create the DataBox. More...
 
using mutable_item_tags = tmpl::filter< tags_list, db::is_mutable_item_tag< tmpl::_1 > >
 A list of all the mutable item tags, including their subitems.
 
using mutable_subitem_tags = tmpl::flatten< tmpl::transform< mutable_item_tags, db::Subitems< tmpl::_1 > > >
 A list of the expanded simple subitems, not including the main Subitem tags themselves. More...
 
using compute_item_tags = tmpl::filter< immutable_item_tags, db::is_compute_tag< tmpl::_1 > >
 A list of all the compute item tags.
 

Public Member Functions

std::string print_types () const
 Print the expanded type aliases.
 
std::string print_items () const
 Print the items.
 
template<typename Tag >
const auto & get () const
 Retrieve the tag Tag, should be called by the free function db::get.
 
template<typename Tag >
auto & get_mutable_reference ()
 Retrieve a mutable reference to the tag Tag, should be called by the free function db::get_mutable_reference.
 
void pup (PUP::er &p)
 
template<typename Box , typename KeepTagsList , typename... AddMutableItemTags, typename... AddImmutableItemTags, typename... Args>
constexpr DataBox (Box &&old_box, KeepTagsList, tmpl::list< AddMutableItemTags... >, tmpl::list< AddImmutableItemTags... >, Args &&... args)
 
template<typename... AddMutableItemTags, typename AddImmutableItemTagsList , typename... Args>
constexpr DataBox (tmpl::list< AddMutableItemTags... >, AddImmutableItemTagsList, Args &&... args)
 

Friends

template<typename... MutateTags, typename TagList , typename Invokable , typename... Args>
decltype(auto) mutate (gsl::not_null< DataBox< TagList > * > box, Invokable &&invokable, Args &&... args)
 

Detailed Description

template<typename... Tags>
class db::DataBox< tmpl::list< Tags... > >

A DataBox stores objects that can be retrieved by using Tags.

Warning
The order of the tags in DataBoxes returned by db::create and db::create_from depends on implementation-defined behavior, and therefore should not be specified in source files. If explicitly naming a DataBox type is necessary they should be generated using db::compute_databox_type.
See also
db::create db::create_from
Template Parameters
Tagslist of DataBoxTag's

Member Typedef Documentation

◆ immutable_item_creation_tags

template<typename... Tags>
using db::DataBox< tmpl::list< Tags... > >::immutable_item_creation_tags = tmpl::remove_if<immutable_item_tags, tt::is_a<::Tags::Subitem, tmpl::_1> >

A list of all the immutable item tags used to create the DataBox.

Note
This does not include subitems of immutable items

◆ mutable_subitem_tags

template<typename... Tags>
using db::DataBox< tmpl::list< Tags... > >::mutable_subitem_tags = tmpl::flatten< tmpl::transform<mutable_item_tags, db::Subitems<tmpl::_1> >>

A list of the expanded simple subitems, not including the main Subitem tags themselves.

Specifically, if there is a Variables<Tag0, Tag1>, then this list would contain Tag0, Tag1.


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