diff options
-rw-r--r-- | include/fruit/fruit.h | 2 | ||||
-rw-r--r-- | include/fruit/fruit_forward_decls.h | 116 | ||||
-rw-r--r-- | include/fruit/impl/fruit_internal_forward_decls.h | 140 | ||||
-rw-r--r-- | include/fruit/impl/metaprogramming/metaprogramming.h | 1 | ||||
-rw-r--r-- | include/fruit/impl/storage/normalized_component_storage.h | 2 |
5 files changed, 144 insertions, 117 deletions
diff --git a/include/fruit/fruit.h b/include/fruit/fruit.h index f05d43e..7d3b362 100644 --- a/include/fruit/fruit.h +++ b/include/fruit/fruit.h @@ -22,7 +22,9 @@ #include "fruit_forward_decls.h" #include "component.h" +#include "normalized_component.h" #include "macro.h" #include "injector.h" +#include "provider.h" #endif // FRUIT_FRUIT_H diff --git a/include/fruit/fruit_forward_decls.h b/include/fruit/fruit_forward_decls.h index d42d14f..1f83b32 100644 --- a/include/fruit/fruit_forward_decls.h +++ b/include/fruit/fruit_forward_decls.h @@ -47,122 +47,6 @@ class Provider; template <typename... P> class Injector; -namespace impl { - -template <typename Comp, typename I, typename C> -struct Bind; - -template <typename Comp, typename Signature> -struct RegisterConstructor; - -template <typename Comp, typename C> -struct RegisterInstance; - -template <typename Comp, typename I, typename C> -struct AddMultibinding; - -template <typename Comp, typename Function> -struct RegisterProvider; - -template <typename Comp, typename C> -struct AddInstanceMultibinding; - -template <typename Comp, typename Function> -struct RegisterMultibindingProvider; - -template <typename Comp, typename AnnotatedSignature, typename Function> -struct RegisterFactory; - -template <typename Comp, typename OtherComp> -struct InstallComponent; - -template <typename Comp, typename... OtherCompParams> -struct InstallComponentHelper; - -class ComponentStorage; -class NormalizedComponentStorage; -class InjectorStorage; - -template <typename T> -struct NoBindingFoundError; - -template <typename... Ts> -struct CheckNoRepeatedTypes; - -template <bool has_no_self_loop, typename T, typename... Requirements> -struct CheckHasNoSelfLoop; - -template <bool has_no_self_loop, typename T, typename Requirements> -struct CheckHasNoSelfLoopHelper; - -template <typename T, typename C> -struct CheckClassType; - -template <bool b, typename C> -struct CheckTypeAlreadyBound; - -template <typename RequiredSignature, typename SignatureInInjectTypedef> -struct CheckSameSignatureInInjectionTypedef; - -template <typename DuplicatedTypes> -struct DuplicatedTypesInComponentError; - -template <typename... Requirements> -struct CheckNoRequirementsInProvider; - -template <typename Rs> -struct CheckNoRequirementsInProviderHelper; - -template <typename C, typename CandidateSignature> -struct InjectTypedefNotASignature; - -template <typename C, typename SignatureReturnType> -struct InjectTypedefForWrongClass; - -template <typename CandidateSignature> -struct ParameterIsNotASignature; - -template <typename Signature> -struct ConstructorDoesNotExist; // Not used. - -template <typename I, typename C> -struct NotABaseClassOf; - -template <typename Signature, typename ProviderType> -struct FunctorUsedAsProvider; - -template <typename... ComponentRequirements> -struct ComponentWithRequirementsInInjectorError; - -template <typename ComponentRequirements> -struct ComponentWithRequirementsInInjectorErrorHelper; - -template <typename... UnsatisfiedRequirements> -struct UnsatisfiedRequirementsInNormalizedComponent; - -template <typename UnsatisfiedRequirements> -struct UnsatisfiedRequirementsInNormalizedComponentHelper; - -template <typename... TypesNotProvided> -struct TypesInInjectorNotProvided; - -template <typename TypesNotProvided> -struct TypesInInjectorNotProvidedHelper; - -template <typename T, bool is_provided> -struct TypeNotProvidedError; - -template <typename C, typename InjectSignature> -struct NoConstructorMatchingInjectSignature; - -template <typename ExpectedSignature, typename FunctorSignature> -struct FunctorSignatureDoesNotMatch; - -template <bool returns_pointer, typename Signature> -struct FactoryReturningPointer; - -} // namespace impl - } // namespace fruit #endif // FRUIT_FRUIT_FORWARD_DECLS_H diff --git a/include/fruit/impl/fruit_internal_forward_decls.h b/include/fruit/impl/fruit_internal_forward_decls.h new file mode 100644 index 0000000..681e69c --- /dev/null +++ b/include/fruit/impl/fruit_internal_forward_decls.h @@ -0,0 +1,140 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FRUIT_FRUIT_INTERNAL_FORWARD_DECLS_H +#define FRUIT_FRUIT_INTERNAL_FORWARD_DECLS_H + +namespace fruit { + +namespace impl { + +template <typename Comp, typename I, typename C> +struct Bind; + +template <typename Comp, typename Signature> +struct RegisterConstructor; + +template <typename Comp, typename C> +struct RegisterInstance; + +template <typename Comp, typename I, typename C> +struct AddMultibinding; + +template <typename Comp, typename Function> +struct RegisterProvider; + +template <typename Comp, typename C> +struct AddInstanceMultibinding; + +template <typename Comp, typename Function> +struct RegisterMultibindingProvider; + +template <typename Comp, typename AnnotatedSignature, typename Function> +struct RegisterFactory; + +template <typename Comp, typename OtherComp> +struct InstallComponent; + +template <typename Comp, typename... OtherCompParams> +struct InstallComponentHelper; + +class ComponentStorage; +class NormalizedComponentStorage; +class InjectorStorage; + +template <typename T> +struct NoBindingFoundError; + +template <typename... Ts> +struct CheckNoRepeatedTypes; + +template <bool has_no_self_loop, typename T, typename... Requirements> +struct CheckHasNoSelfLoop; + +template <bool has_no_self_loop, typename T, typename Requirements> +struct CheckHasNoSelfLoopHelper; + +template <typename T, typename C> +struct CheckClassType; + +template <bool b, typename C> +struct CheckTypeAlreadyBound; + +template <typename RequiredSignature, typename SignatureInInjectTypedef> +struct CheckSameSignatureInInjectionTypedef; + +template <typename DuplicatedTypes> +struct DuplicatedTypesInComponentError; + +template <typename... Requirements> +struct CheckNoRequirementsInProvider; + +template <typename Rs> +struct CheckNoRequirementsInProviderHelper; + +template <typename C, typename CandidateSignature> +struct InjectTypedefNotASignature; + +template <typename C, typename SignatureReturnType> +struct InjectTypedefForWrongClass; + +template <typename CandidateSignature> +struct ParameterIsNotASignature; + +template <typename Signature> +struct ConstructorDoesNotExist; // Not used. + +template <typename I, typename C> +struct NotABaseClassOf; + +template <typename Signature, typename ProviderType> +struct FunctorUsedAsProvider; + +template <typename... ComponentRequirements> +struct ComponentWithRequirementsInInjectorError; + +template <typename ComponentRequirements> +struct ComponentWithRequirementsInInjectorErrorHelper; + +template <typename... UnsatisfiedRequirements> +struct UnsatisfiedRequirementsInNormalizedComponent; + +template <typename UnsatisfiedRequirements> +struct UnsatisfiedRequirementsInNormalizedComponentHelper; + +template <typename... TypesNotProvided> +struct TypesInInjectorNotProvided; + +template <typename TypesNotProvided> +struct TypesInInjectorNotProvidedHelper; + +template <typename T, bool is_provided> +struct TypeNotProvidedError; + +template <typename C, typename InjectSignature> +struct NoConstructorMatchingInjectSignature; + +template <typename ExpectedSignature, typename FunctorSignature> +struct FunctorSignatureDoesNotMatch; + +template <bool returns_pointer, typename Signature> +struct FactoryReturningPointer; + +} // namespace impl + +} // namespace fruit + +#endif // FRUIT_FRUIT_INTERNAL_FORWARD_DECLS_H diff --git a/include/fruit/impl/metaprogramming/metaprogramming.h b/include/fruit/impl/metaprogramming/metaprogramming.h index 8a53861..6443494 100644 --- a/include/fruit/impl/metaprogramming/metaprogramming.h +++ b/include/fruit/impl/metaprogramming/metaprogramming.h @@ -21,6 +21,7 @@ #include "list.h" #include "../fruit_assert.h" +#include "../fruit_internal_forward_decls.h" namespace fruit { namespace impl { diff --git a/include/fruit/impl/storage/normalized_component_storage.h b/include/fruit/impl/storage/normalized_component_storage.h index 038e88b..ae71ede 100644 --- a/include/fruit/impl/storage/normalized_component_storage.h +++ b/include/fruit/impl/storage/normalized_component_storage.h @@ -21,7 +21,7 @@ #include "../binding_data.h" #include "../data_structures/semistatic_map.h" #include "../data_structures/semistatic_graph.h" -#include "../../fruit_forward_decls.h" +#include "../fruit_internal_forward_decls.h" #include <memory> #include <unordered_map> |