| 1 | /* |
| 2 | * %injeqt copyright begin% |
| 3 | * Copyright 2014 Rafał Malinowski ([email protected]) |
| 4 | * %injeqt copyright end% |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Lesser General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2.1 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public |
| 17 | * License along with this library; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #include "resolve-dependencies.h"cxx . . $ `<file>/src/internal/resolve-dependencies.h`/ |
| 22 | |
| 23 | #include "dependency.h"cxx . . $ `<file>/src/internal/dependency.h`/ |
| 24 | #include "implementations.h"cxx . . $ `<file>/src/internal/implementations.h`/ |
| 25 | #include "resolved-dependency.h"cxx . . $ `<file>/src/internal/resolved-dependency.h`/ |
| 26 | |
| 27 | namespace injeqtcxx . . $ injeqt/ { namespace internalcxx . . $ injeqt/internal/ { |
| 28 | |
| 29 | resolve_dependencies_resultcxx . . $ injeqt/internal/resolve_dependencies_result# resolve_dependenciescxx . . $ injeqt/internal/resolve_dependencies(2fc3aec96b5b3950).(const dependenciescxx . . $ injeqt/internal/dependencies# &to_resolve, const implementationscxx . . $ injeqt/internal/implementations# &resolve_with) |
| 30 | { |
| 31 | auto match_result = matchcxx . . $ injeqt/internal/match(cfcd46084eda7e49).(to_resolve, resolve_with, type_from_dependencycxx . . $ injeqt/internal/type_from_dependency(991734e551dfabae)., type_from_implementationcxx . . $ injeqt/internal/type_from_implementation(c014356d8d6961f3)., match_increment_modecxx . . $ injeqt/internal/match_increment_mode#::leftcxx . . $ injeqt/internal/match_increment_mode#left.); |
| 32 | auto resolved = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<resolved_dependencycxx . . $ injeqt/internal/resolved_dependency#>{}; |
| 33 | |
| 34 | for (auto &&match : match_result.matchedcxx . . $ injeqt/internal/match_result#matched.) |
| 35 | resolved.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(match.secondcxx . . $ std/pair#second., match.firstcxx . . $ std/pair#first..settercxx . . $ injeqt/internal/dependency#setter(145040bc589ff50).()); |
| 36 | |
| 37 | return {dependenciescxx . . $ injeqt/internal/dependencies#{match_result.unmatched_1cxx . . $ injeqt/internal/match_result#unmatched_1.}, resolved}; |
| 38 | } |
| 39 | |
| 40 | }} |