Classes | Namespaces | Typedefs | Functions
DataBox.hpp File Reference

Defines classes and functions used for manipulating DataBox's. More...

#include <algorithm>
#include <cassert>
#include <functional>
#include <pup.h>
#include <string>
#include <type_traits>
#include <unordered_map>
#include "DataStructures/DataBox/DataBoxTag.hpp"
#include "DataStructures/DataBox/Deferred.hpp"
#include "ErrorHandling/Assert.hpp"
#include "ErrorHandling/Error.hpp"
#include "ErrorHandling/StaticAssert.hpp"
#include "Utilities/BoostHelpers.hpp"
#include "Utilities/ForceInline.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/Requires.hpp"
#include "Utilities/TMPL.hpp"
#include "Utilities/TypeTraits.hpp"

Go to the source code of this file.

Classes

struct  db::is_databox< T >
 Determines if a type T is as db::DataBox. More...
 
class  db::DataBox< tmpl::list< Tags... > >
 A DataBox stores objects that can be retrieved by using Tags. More...
 

Namespaces

 db
 Namespace for DataBox related things.
 

Typedefs

template<typename... Tags>
using db::RemoveTags = tmpl::flatten< tmpl::list< Tags... > >
 List of Tags to remove from the DataBox.
 
template<typename... Tags>
using db::AddSimpleTags = tmpl::flatten< tmpl::list< Tags... > >
 List of Tags to add to the DataBox.
 
template<typename... Tags>
using db::AddComputeTags = tmpl::flatten< tmpl::list< Tags... > >
 List of Compute Item Tags to add to the DataBox.
 
template<class TagList >
using db::get_compute_items = tmpl::filter< TagList, db::is_compute_item< tmpl::_1 > >
 Get all the Tags that are compute items from the TagList
 
template<class TagList >
using db::get_items = tmpl::filter< TagList, tmpl::not_< tmpl::bind< db::is_compute_item, tmpl::_1 > >>
 Get all the Tags that are items from the TagList
 
template<class TagList >
using db::compute_databox_type = typename DataBox_detail::compute_dbox_type< get_items< TagList >, get_compute_items< TagList > >::type
 Returns the type of the DataBox that would be constructed from the TagList of tags.
 

Functions

template<typename... MutateTags, typename TagList , typename Invokable , typename... Args>
void db::mutate (const gsl::not_null< DataBox< TagList > *> box, Invokable &&invokable, Args &&... args) noexcept
 Allows changing the state of one or more non-computed elements in the DataBox. More...
 
template<typename Tag , typename TagList >
const auto & db::get (const DataBox< TagList > &box) noexcept
 Retrieve the item with tag Tag from the DataBox. More...
 
template<typename AddSimpleTags , typename AddComputeTags = tmpl::list<>, typename... Args>
constexpr auto db::create (Args &&... args)
 Create a new DataBox. More...
 
template<typename TagsList >
constexpr DataBox< TagsList > db::create_copy (const DataBox< TagsList > &box) noexcept
 Create a non-aliasing copy of the DataBox. That is, the new DataBox will not share items with the old one. More...
 
template<typename Type , typename TagList >
constexpr const Type & db::get_item_from_box (const DataBox< TagList > &box, const std::string &tag_name) noexcept
 Retrieve an item from the DataBox that has a tag with label tag_name and type Type More...
 
template<typename TagsList , typename F , typename BoxTags , typename... Args>
constexpr auto db::apply (F &&f, const DataBox< BoxTags > &box, Args &&... args)
 Apply the function f with argument Tags TagsList from DataBox box More...
 
template<typename MutateTags , typename ArgumentTags , typename F , typename BoxTags , typename... Args>
constexpr auto db::mutate_apply (F f, const gsl::not_null< DataBox< BoxTags > *> box, Args &&... args) noexcept(DataBox_detail::check_mutate_apply_mutate_tags(BoxTags{}, MutateTags{}) and DataBox_detail::check_mutate_apply_argument_tags(BoxTags{}, ArgumentTags{}) and noexcept(DataBox_detail::mutate_apply(f, box, MutateTags{}, ArgumentTags{}, std::forward< Args >(args)...)))
 Apply the function f mutating items MutateTags and taking as additional arguments ArgumentTags and args. More...
 
template<typename RemoveTags , typename AddTags = tmpl::list<>, typename AddComputeTags = tmpl::list<>, typename TagsList , typename... Args>
constexpr auto db::create_from (db::DataBox< TagsList > &&box, Args &&... args) noexcept
 Create a new DataBox from an existing one adding or removing items and compute items. More...
 

Detailed Description

Defines classes and functions used for manipulating DataBox's.