Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cstddef> 7 : #include <string> 8 : 9 : #include "DataStructures/DataBox/Tag.hpp" 10 : #include "DataStructures/DataBox/TagName.hpp" 11 : #include "DataStructures/Variables.hpp" 12 : #include "Utilities/TMPL.hpp" 13 : #include "Utilities/TypeTraits.hpp" 14 : 15 : namespace Tags { 16 : template <typename TagsList> 17 0 : struct Variables : db::SimpleTag { 18 : static_assert(tt::is_a<tmpl::list, TagsList>::value, 19 : "The TagsList passed to Tags::Variables is not a typelist"); 20 0 : using tags_list = TagsList; 21 0 : using type = ::Variables<TagsList>; 22 0 : static std::string name() { 23 : std::string tag_name{"Variables("}; 24 : size_t iter = 0; 25 : tmpl::for_each<TagsList>([&tag_name, &iter](auto tag) { 26 : tag_name += db::tag_name<tmpl::type_from<decltype(tag)>>(); 27 : if (iter + 1 != tmpl::size<TagsList>::value) { 28 : tag_name += ","; 29 : } 30 : iter++; 31 : }); 32 : return tag_name + ")"; 33 : } 34 : }; 35 : } // namespace Tags