SetFromInputData.hxx 1.61 KB
Newer Older
GILLES Sebastien's avatar
GILLES Sebastien committed
1 2 3 4 5 6 7 8 9 10 11 12 13
/*!
//
// \file
//
//
// Created by Sebastien Gilles <sebastien.gilles@inria.fr> on the Tue, 22 Dec 2015 11:34:42 +0100
// Copyright (c) Inria. All rights reserved.
//
// \ingroup CoreGroup
// \addtogroup CoreGroup
// \{
*/

14

15 16
#ifndef MOREFEM_x_CORE_x_INPUT_DATA_x_ADVANCED_x_SET_FROM_INPUT_DATA_HXX_
# define MOREFEM_x_CORE_x_INPUT_DATA_x_ADVANCED_x_SET_FROM_INPUT_DATA_HXX_
17 18


19
namespace MoReFEM
20
{
21 22 23


    namespace Advanced
24
    {
25 26 27 28 29


        template
        <
            class ManagerT,
30
            class InputDataT,
31 32
            typename... Args
        >
33
        void SetFromInputData(const InputDataT& input_data,
34 35
                                       ManagerT& manager,
                                       Args&&... args)
36 37 38 39 40
        {
            auto create = [&manager, &args...](const auto& section) ->void
            {
                manager.Create(section, std::forward<Args>(args)...);
            };
41

42
            namespace ipl =  Internal::InputDataNS;
43

44
            using input_data_tuple_iteration =
45 46
                ipl::TupleIteration
                    <
47
                        typename InputDataT::Tuple,
48
                        0,
49
                        std::tuple_size<typename InputDataT::Tuple>::value
50
                    >;
51

52 53
            input_data_tuple_iteration
            ::template ActIfSection<typename ManagerT::input_data_type>(input_data.GetTuple(),
54 55
                                                                             create);
        }
56 57 58 59 60


    } // namespace Advanced


61
} // namespace MoReFEM
62 63


64 65 66
/// @} // addtogroup CoreGroup


67
#endif // MOREFEM_x_CORE_x_INPUT_DATA_x_ADVANCED_x_SET_FROM_INPUT_DATA_HXX_