Home | History | Annotate | Download | only in impl
      1 /*
      2  * Copyright 2014 Google Inc. All rights reserved.
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *     http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef FRUIT_INJECTION_DEBUG_ERRORS_H
     18 #define FRUIT_INJECTION_DEBUG_ERRORS_H
     19 
     20 #include <fruit/impl/injection_errors.h>
     21 
     22 namespace fruit {
     23 namespace impl {
     24 namespace meta {
     25 
     26 template <typename... MissingProvides>
     27 struct ComponentDoesNotEntailDueToProvidesError {
     28   static_assert(AlwaysFalse<MissingProvides...>::value, "");
     29 };
     30 
     31 struct ComponentDoesNotEntailDueToProvidesErrorTag {
     32   template <typename... MissingProvides>
     33   using apply = ComponentDoesNotEntailDueToProvidesError<MissingProvides...>;
     34 };
     35 
     36 template <typename... MissingInterfaceBindings>
     37 struct ComponentDoesNotEntailDueToInterfaceBindingsError {
     38   static_assert(AlwaysFalse<MissingInterfaceBindings...>::value, "");
     39 };
     40 
     41 struct ComponentDoesNotEntailDueToInterfaceBindingsErrorTag {
     42   template <typename... MissingInterfaceBindings>
     43   using apply = ComponentDoesNotEntailDueToInterfaceBindingsError<MissingInterfaceBindings...>;
     44 };
     45 
     46 template <typename... AdditionalRequirements>
     47 struct ComponentDoesNotEntailDueToRequirementsError {
     48   static_assert(AlwaysFalse<AdditionalRequirements...>::value, "");
     49 };
     50 
     51 struct ComponentDoesNotEntailDueToRequirementsErrorTag {
     52   template <typename... AdditionalRequirements>
     53   using apply = ComponentDoesNotEntailDueToProvidesError<AdditionalRequirements...>;
     54 };
     55 
     56 template <typename Deps, typename CandidateEntailedDeps>
     57 struct ComponentDoesNotEntailDueToIncompatibleDepsError {
     58   static_assert(AlwaysFalse<Deps>::value, "");
     59 };
     60 
     61 struct ComponentDoesNotEntailDueToIncompatibleDepsErrorTag {
     62   template <typename Deps, typename CandidateEntailedDeps>
     63   using apply = ComponentDoesNotEntailDueToIncompatibleDepsError<Deps, CandidateEntailedDeps>;
     64 };
     65 
     66 template <typename... RequirementsWithConstMismatch>
     67 struct ComponentDoesNotEntailDueToDifferentConstnessOfRequirementsError {
     68   static_assert(AlwaysFalse<RequirementsWithConstMismatch...>::value, "");
     69 };
     70 
     71 struct ComponentDoesNotEntailDueToDifferentConstnessOfRequirementsErrorTag {
     72   template <typename... RequirementsWithConstMismatch>
     73   using apply = ComponentDoesNotEntailDueToDifferentConstnessOfRequirementsError<RequirementsWithConstMismatch...>;
     74 };
     75 
     76 template <typename... ProvidesWithConstMismatch>
     77 struct ComponentDoesNotEntailDueToDifferentConstnessOfProvidesError {
     78   static_assert(AlwaysFalse<ProvidesWithConstMismatch...>::value, "");
     79 };
     80 
     81 struct ComponentDoesNotEntailDueToDifferentConstnessOfProvidesErrorTag {
     82   template <typename... ProvidesWithConstMismatch>
     83   using apply = ComponentDoesNotEntailDueToDifferentConstnessOfProvidesError<ProvidesWithConstMismatch...>;
     84 };
     85 
     86 template <typename ProofTh, typename ForestThs>
     87 struct ProofNotEntailedByForestBecauseThNotFoundError {
     88   static_assert(AlwaysFalse<ProofTh>::value, "");
     89 };
     90 
     91 struct ProofNotEntailedByForestBecauseThNotFoundErrorTag {
     92   template <typename ProofTh, typename ForestThs>
     93   using apply = ProofNotEntailedByForestBecauseThNotFoundError<ProofTh, ForestThs>;
     94 };
     95 
     96 template <typename ForestHps, typename ProofHps, typename Difference>
     97 struct ProofNotEntailedByForestBecauseHpsNotASubsetError {
     98   static_assert(AlwaysFalse<ForestHps>::value, "");
     99 };
    100 
    101 struct ProofNotEntailedByForestBecauseHpsNotASubsetErrorTag {
    102   template <typename ForestHps, typename ProofHps, typename Difference>
    103   using apply = ProofNotEntailedByForestBecauseHpsNotASubsetError<ForestHps, ProofHps, Difference>;
    104 };
    105 
    106 } // namespace meta
    107 } // namespace impl
    108 } // namespace fruit
    109 
    110 #endif // FRUIT_INJECTION_DEBUG_ERRORS_H
    111