| 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 "provider-by-default-constructor-configuration.h"cxx . . $ `<file>/src/internal/provider-by-default-constructor-configuration.h`/ |
| 22 | |
| 23 | #include <injeqt/exception/default-constructor-not-found.h>cxx . . $ `<file>/include/injeqt/exception/default-constructor-not-found.h`/ |
| 24 | #include <injeqt/exception/qobject-type.h>cxx . . $ `<file>/include/injeqt/exception/qobject-type.h`/ |
| 25 | |
| 26 | #include "default-constructor-method.h"cxx . . $ `<file>/src/internal/default-constructor-method.h`/ |
| 27 | #include "provider-by-default-constructor.h"cxx . . $ `<file>/src/internal/provider-by-default-constructor.h`/ |
| 28 | |
| 29 | #include <cassert> |
| 30 | |
| 31 | namespace injeqtcxx . . $ injeqt/ { namespace internalcxx . . $ injeqt/internal/ { |
| 32 | |
| 33 | provider_by_default_constructor_configurationcxx . . $ injeqt/internal/provider_by_default_constructor_configuration#::provider_by_default_constructor_configurationcxx . . $ injeqt/internal/provider_by_default_constructor_configuration#provider_by_default_constructor_configuration(766db27e681b24a).(typecxx . . $ injeqt/v1/type# object_type) : |
| 34 | _object_typecxx . . $ injeqt/internal/provider_by_default_constructor_configuration#_object_type.{stdcxx . . $ std/::movecxx . . $ std/move(e7c6c0c8363dcc46).(object_type)} |
| 35 | { |
| 36 | assertcxx . . $ `<external>/4398592474888995393/assert.h:102:11`!(!_object_type.is_empty()); |
| 37 | } |
| 38 | |
| 39 | provider_by_default_constructor_configurationcxx . . $ injeqt/internal/provider_by_default_constructor_configuration#::~cxx . . $ injeqt/internal/provider_by_default_constructor_configuration#`~provider_by_default_constructor_configuration`(49f6e7a06ebc5aa8).provider_by_default_constructor_configurationcxx . . $ injeqt/internal/provider_by_default_constructor_configuration#() |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<typecxx . . $ injeqt/v1/type#> provider_by_default_constructor_configurationcxx . . $ injeqt/internal/provider_by_default_constructor_configuration#::typescxx . . $ injeqt/internal/provider_by_default_constructor_configuration#types(cf3a392ed5d6b92b).() const |
| 44 | { |
| 45 | return {cxx . . $ std/vector#vector(9619226211e5a241)._object_typecxx . . $ injeqt/internal/provider_by_default_constructor_configuration#_object_type.}; |
| 46 | } |
| 47 | |
| 48 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<providercxx . . $ injeqt/internal/provider#> provider_by_default_constructor_configurationcxx . . $ injeqt/internal/provider_by_default_constructor_configuration#::create_providercxx . . $ injeqt/internal/provider_by_default_constructor_configuration#create_provider(2c251cf15db9f22d).(const types_by_namecxx . . $ injeqt/internal/types_by_name# &) const |
| 49 | { |
| 50 | if (_object_typecxx . . $ injeqt/internal/provider_by_default_constructor_configuration#_object_type..is_qobjectcxx . . $ injeqt/v1/type#is_qobject(50ce9a9e25b4a850).()) |
| 51 | throw exceptioncxx . . $ injeqt/v1/exception/qobject_type#qobject_type(8d4ab0a187bf9331).::qobject_typecxx . . $ injeqt/v1/exception/qobject_type#(); |
| 52 | |
| 53 | auto c = make_default_constructor_methodcxx . . $ injeqt/internal/make_default_constructor_method(84114e33f83ca37c).(_object_typecxx . . $ injeqt/internal/provider_by_default_constructor_configuration#_object_type.); |
| 54 | if (c.is_emptycxx . . $ injeqt/internal/default_constructor_method#is_empty(50ce9a9e25b4a850).()) |
| 55 | throw exceptioncxx . . $ injeqt/v1/exception/default_constructor_not_found#default_constructor_not_found(8d4ab0a187bf9331).::default_constructor_not_foundcxx . . $ injeqt/v1/exception/default_constructor_not_found#{_object_typecxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f)..namecxx . . $ injeqt/v1/type#name(219584694fe2b248).()}; |
| 56 | |
| 57 | returncxx . . $ std/unique_ptr#unique_ptr(d6762fce684538e4). stdcxx . . $ std/unique_ptr#unique_ptr(9ad45c7d2296bc38).::unique_ptrcxx . . $ std/unique_ptr#<provider_by_default_constructorcxx . . $ injeqt/internal/provider_by_default_constructor#>{new provider_by_default_constructorcxx . . $ injeqt/internal/provider_by_default_constructor#{stdcxx . . $ std/::movecxx . . $ std/move(e7c6c0c8363dcc46).(c)}}; |
| 58 | } |
| 59 | |
| 60 | }} |