| 1 | /* |
| 2 | * %injeqt copyright begin% |
| 3 | * Copyright 2015 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 | #pragma once |
| 22 | |
| 23 | #include <injeqt/injeqt.h>cxx . . $ `<file>/include/injeqt/injeqt.h`/ |
| 24 | #include <injeqt/type.h>cxx . . $ `<file>/include/injeqt/type.h`/ |
| 25 | |
| 26 | #include "provider-configuration.h"cxx . . $ `<file>/src/internal/provider-configuration.h`/ |
| 27 | |
| 28 | #include "injector-impl.h"cxx . . $ `<file>/src/internal/injector-impl.h`/ |
| 29 | |
| 30 | /** |
| 31 | * @file |
| 32 | * @brief Contains classes and functions for representing configuration of provider that uses different injector. |
| 33 | */ |
| 34 | |
| 35 | namespace injeqtcxx . . $ injeqt/ { namespace internalcxx . . $ injeqt/internal/ { |
| 36 | |
| 37 | /** |
| 38 | * @brief Configuration of provider that uses different injector. |
| 39 | * |
| 40 | * This provider configuration object will return provider implementation that will |
| 41 | * use different (parent) injector to provide objects. |
| 42 | */ |
| 43 | class provider_by_parent_injector_configurationcxx . . $ injeqt/internal/provider_by_parent_injector_configuration# : public provider_configurationcxx . . $ injeqt/internal/provider_configuration# |
| 44 | { |
| 45 | |
| 46 | public: |
| 47 | /** |
| 48 | * @brief Create provider configuration instance. |
| 49 | * @param parent_injector injector used to get object |
| 50 | * @param object_type type to provide |
| 51 | * @pre parent_injector != nullptr |
| 52 | * @pre !object_type.is_empty() |
| 53 | */ |
| 54 | explicit provider_by_parent_injector_configurationcxx . . $ injeqt/internal/provider_by_parent_injector_configuration#provider_by_parent_injector_configuration(224c0e358b759e38).(injector_implcxx . . $ injeqt/internal/injector_impl# *parent_injector, typecxx . . $ injeqt/v1/type# object_type); |
| 55 | virtual ~cxx . . $ injeqt/internal/provider_by_parent_injector_configuration#`~provider_by_parent_injector_configuration`(49f6e7a06ebc5aa8).provider_by_parent_injector_configurationcxx . . $ injeqt/internal/provider_by_parent_injector_configuration#(); |
| 56 | |
| 57 | /** |
| 58 | * @return list consisting of object_type param passed to constructor |
| 59 | */ |
| 60 | virtual stdcxx . . $ std/::vectorcxx . . $ std/vector#<typecxx . . $ injeqt/v1/type#> typescxx . . $ injeqt/internal/provider_by_parent_injector_configuration#types(cf3a392ed5d6b92b).() const override; |
| 61 | |
| 62 | /** |
| 63 | * @param known_types list of all types known to injector, used to check return types of methods |
| 64 | * @return pointer to new @see provider_by_parent_injector_ object |
| 65 | */ |
| 66 | virtual stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<providercxx . . $ injeqt/internal/provider#> create_providercxx . . $ injeqt/internal/provider_by_parent_injector_configuration#create_provider(2c251cf15db9f22d).(const types_by_namecxx . . $ injeqt/internal/types_by_name# &known_types) const override; |
| 67 | |
| 68 | private: |
| 69 | injector_implcxx . . $ injeqt/internal/injector_impl# *_parent_injectorcxx . . $ injeqt/internal/provider_by_parent_injector_configuration#_parent_injector.; |
| 70 | typecxx . . $ injeqt/v1/type# _object_typecxx . . $ injeqt/internal/provider_by_parent_injector_configuration#_object_type.; |
| 71 | |
| 72 | }; |
| 73 | |
| 74 | }} |