Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <type_traits> 7 : 8 : #include "Parallel/Protocols/ElementRegistrar.hpp" 9 : #include "Utilities/TMPL.hpp" 10 : 11 : namespace Parallel::protocols { 12 : /*! 13 : * \brief Conforming types provide compile-time information for registering and 14 : * deregistering array elements with other parallel components 15 : * 16 : * A class conforming to this protocol is placed in the metavariables to provide 17 : * a list of element registrars for each array parallel component. The element 18 : * registrars in the list must conform to the 19 : * `Parallel::protocols::ElementRegistrar` protocol. 20 : * 21 : * The class conforming to this protocol must provide the following type alias: 22 : * 23 : * - `element_registrars`: A `tmpl::map` from parallel components to their list 24 : * of element registrars. The element registrars in the typelist must conform 25 : * to the `Parallel::protocols::ElementRegistrar` protocol. 26 : * 27 : * Here is an example implementation of this protocol: 28 : * 29 : * \snippet Test_InitializeParent.cpp registration_metavariables 30 : * 31 : * \note We may consider retrieving the list of element registrars directly from 32 : * the `Parallel::Phase::Registration` phase of the parallel component instead 33 : * of requiring the metavariables to provide a separate list. 34 : */ 35 1 : struct RegistrationMetavariables { 36 : template <typename ConformingType> 37 0 : struct test { 38 0 : using element_registrars = typename ConformingType::element_registrars; 39 : }; 40 : }; 41 : } // namespace Parallel::protocols