Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 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_INJECTOR_STORAGE_H |
| 18 | #define FRUIT_INJECTOR_STORAGE_H |
| 19 | |
Marco Poletti | f289510 | 2016-01-30 13:38:37 +0000 | [diff] [blame] | 20 | #include <fruit/fruit_forward_decls.h> |
| 21 | #include <fruit/impl/binding_data.h> |
| 22 | #include <fruit/impl/data_structures/fixed_size_allocator.h> |
| 23 | #include <fruit/impl/meta/component.h> |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 24 | |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 25 | #include <vector> |
Marco Poletti | 886289c | 2016-05-29 10:31:31 +0100 | [diff] [blame] | 26 | #include <unordered_map> |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 27 | |
| 28 | namespace fruit { |
| 29 | |
| 30 | namespace impl { |
| 31 | |
| 32 | template <typename T> |
| 33 | struct GetHelper; |
| 34 | |
| 35 | /** |
| 36 | * A component where all types have to be explicitly registered, and all checks are at runtime. |
| 37 | * Used to implement Component<>, don't use directly. |
| 38 | * |
| 39 | * This class handles the creation of types of the forms: |
| 40 | * - shared_ptr<C>, [const] C*, [const] C&, C (where C is an atomic type) |
| 41 | * - Injector<T1, ..., Tk> (with T1, ..., Tk of the above forms). |
| 42 | */ |
| 43 | class InjectorStorage { |
Marco Poletti | 4e9594b | 2014-11-09 13:52:46 +0000 | [diff] [blame] | 44 | public: |
| 45 | using BindingVectors = std::pair<std::vector<std::pair<TypeId, BindingData>>, |
| 46 | std::vector<std::pair<TypeId, MultibindingData>>>; |
| 47 | using Graph = SemistaticGraph<TypeId, NormalizedBindingData>; |
| 48 | |
Marco Poletti | 3b95a51 | 2015-07-11 13:43:39 +0100 | [diff] [blame] | 49 | template <typename AnnotatedT> |
| 50 | using RemoveAnnotations = fruit::impl::meta::UnwrapType<fruit::impl::meta::Eval< |
| 51 | fruit::impl::meta::RemoveAnnotations(fruit::impl::meta::Type<AnnotatedT>) |
| 52 | >>; |
| 53 | |
Marco Poletti | 79b01d6 | 2016-03-25 12:25:30 +0000 | [diff] [blame] | 54 | template <typename T> |
| 55 | using NormalizeType = fruit::impl::meta::UnwrapType<fruit::impl::meta::Eval< |
| 56 | fruit::impl::meta::NormalizeType(fruit::impl::meta::Type<T>) |
| 57 | >>; |
| 58 | |
| 59 | template <typename Signature> |
| 60 | using SignatureType = fruit::impl::meta::UnwrapType<fruit::impl::meta::Eval< |
| 61 | fruit::impl::meta::SignatureType(fruit::impl::meta::Type<Signature>) |
| 62 | >>; |
| 63 | |
| 64 | template <typename Signature> |
| 65 | using NormalizedSignatureArgs = fruit::impl::meta::Eval< |
| 66 | fruit::impl::meta::NormalizeTypeVector(fruit::impl::meta::SignatureArgs(fruit::impl::meta::Type<Signature>)) |
| 67 | >; |
Marco Poletti | bb7442f | 2014-12-26 17:49:03 +0100 | [diff] [blame] | 68 | |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 69 | // Prints the specified error and calls exit(1). |
| 70 | static void fatal(const std::string& error); |
| 71 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 72 | // Returns a tuple (getTypeId<AnnotatedI>(), bindingData) |
| 73 | template <typename AnnotatedI, typename AnnotatedC> |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 74 | static std::tuple<TypeId, BindingData> createBindingDataForBind(); |
| 75 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 76 | // Returns a tuple (getTypeId<AnnotatedC>(), bindingData) |
| 77 | template <typename AnnotatedC, typename C> |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 78 | static std::tuple<TypeId, BindingData> createBindingDataForBindInstance(C& instance); |
| 79 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 80 | // Returns a tuple (getTypeId<AnnotatedC>(), bindingData) |
| 81 | template <typename AnnotatedSignature, typename Lambda> |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 82 | static std::tuple<TypeId, BindingData> createBindingDataForProvider(); |
| 83 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 84 | // Returns a tuple (getTypeId<AnnotatedI>(), getTypeId<AnnotatedC>(), bindingData) |
| 85 | template <typename AnnotatedSignature, typename Lambda, typename AnnotatedI> |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 86 | static std::tuple<TypeId, TypeId, BindingData> createBindingDataForCompressedProvider(); |
| 87 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 88 | // Returns a tuple (getTypeId<AnnotatedC>(), bindingData) |
| 89 | template <typename AnnotatedSignature> |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 90 | static std::tuple<TypeId, BindingData> createBindingDataForConstructor(); |
| 91 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 92 | // Returns a tuple (getTypeId<AnnotatedI>(), getTypeId<AnnotatedC>(), bindingData) |
| 93 | template <typename AnnotatedSignature, typename AnnotatedI> |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 94 | static std::tuple<TypeId, TypeId, BindingData> createBindingDataForCompressedConstructor(); |
| 95 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 96 | // Returns a tuple (getTypeId<AnnotatedI>(), bindingData) |
| 97 | template <typename AnnotatedI, typename AnnotatedC> |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 98 | static std::tuple<TypeId, MultibindingData> createMultibindingDataForBinding(); |
| 99 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 100 | // Returns a tuple (getTypeId<AnnotatedC>(), bindingData) |
| 101 | template <typename AnnotatedC, typename C> |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 102 | static std::tuple<TypeId, MultibindingData> createMultibindingDataForInstance(C& instance); |
| 103 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 104 | // Returns a tuple (getTypeId<AnnotatedC>(), multibindingData) |
| 105 | template <typename AnnotatedSignature, typename Lambda> |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 106 | static std::tuple<TypeId, MultibindingData> createMultibindingDataForProvider(); |
| 107 | |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 108 | private: |
Marco Poletti | 5200558 | 2014-11-09 15:13:26 +0000 | [diff] [blame] | 109 | // The NormalizedComponentStorage owned by this object (if any). |
| 110 | // Only used for the 1-argument constructor, otherwise it's nullptr. |
Marco Poletti | 9491d65 | 2014-11-24 15:47:14 +0000 | [diff] [blame] | 111 | std::unique_ptr<NormalizedComponentStorage> normalized_component_storage_ptr; |
Marco Poletti | 5200558 | 2014-11-09 15:13:26 +0000 | [diff] [blame] | 112 | |
Marco Poletti | 5c913af | 2014-11-20 12:55:31 +0000 | [diff] [blame] | 113 | FixedSizeAllocator allocator; |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 114 | |
Marco Poletti | 85aea00 | 2014-11-24 13:15:27 +0000 | [diff] [blame] | 115 | // A graph with injected types as nodes (each node stores the NormalizedBindingData for the type) and dependencies as edges. |
Marco Poletti | 4e9594b | 2014-11-09 13:52:46 +0000 | [diff] [blame] | 116 | // For types that have a constructed object already, the corresponding node is stored as terminal node. |
Marco Poletti | 85aea00 | 2014-11-24 13:15:27 +0000 | [diff] [blame] | 117 | SemistaticGraph<TypeId, NormalizedBindingData> bindings; |
Marco Poletti | 4e9594b | 2014-11-09 13:52:46 +0000 | [diff] [blame] | 118 | |
Marco Poletti | 85aea00 | 2014-11-24 13:15:27 +0000 | [diff] [blame] | 119 | // Maps the type index of a type T to the corresponding NormalizedMultibindingData object (that stores all multibindings). |
Marco Poletti | 886289c | 2016-05-29 10:31:31 +0100 | [diff] [blame] | 120 | std::unordered_map<TypeId, NormalizedMultibindingData> multibindings; |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 121 | |
Marco Poletti | b1d265c | 2014-10-19 21:24:11 -0700 | [diff] [blame] | 122 | private: |
Marco Poletti | fbcb38b | 2014-10-19 23:58:07 -0700 | [diff] [blame] | 123 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 124 | template <typename AnnotatedC> |
Marco Poletti | 6c13003 | 2014-11-24 15:09:05 +0000 | [diff] [blame] | 125 | static std::shared_ptr<char> createMultibindingVector(InjectorStorage& storage); |
Marco Poletti | 224bd9c | 2014-11-24 12:34:51 +0000 | [diff] [blame] | 126 | |
Marco Poletti | c8e80a5 | 2014-08-31 17:18:27 +0100 | [diff] [blame] | 127 | // If not bound, returns nullptr. |
Marco Poletti | 9491d65 | 2014-11-24 15:47:14 +0000 | [diff] [blame] | 128 | NormalizedMultibindingData* getNormalizedMultibindingData(TypeId type); |
Marco Poletti | c8e80a5 | 2014-08-31 17:18:27 +0100 | [diff] [blame] | 129 | |
Marco Poletti | 934689f | 2014-11-16 14:28:16 +0000 | [diff] [blame] | 130 | // Looks up the location where the type is (or will be) stored, but does not construct the class. |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 131 | template <typename AnnotatedC> |
Marco Poletti | 934689f | 2014-11-16 14:28:16 +0000 | [diff] [blame] | 132 | Graph::node_iterator lazyGetPtr(); |
| 133 | |
Marco Poletti | bfcb7ed | 2015-02-28 18:55:16 +0000 | [diff] [blame] | 134 | // getPtr() is equivalent to getPtrInternal(lazyGetPtr()) |
Marco Poletti | e464713 | 2015-05-31 14:35:27 +0100 | [diff] [blame] | 135 | template <typename C> |
| 136 | C* getPtr(Graph::node_iterator itr); |
Marco Poletti | 934689f | 2014-11-16 14:28:16 +0000 | [diff] [blame] | 137 | |
Marco Poletti | b1d265c | 2014-10-19 21:24:11 -0700 | [diff] [blame] | 138 | // Similar to the previous, but takes a node_iterator. Use this when the node_iterator is known, it's faster. |
Marco Poletti | bfcb7ed | 2015-02-28 18:55:16 +0000 | [diff] [blame] | 139 | void* getPtrInternal(Graph::node_iterator itr); |
Marco Poletti | 934689f | 2014-11-16 14:28:16 +0000 | [diff] [blame] | 140 | |
| 141 | // getPtr(typeInfo) is equivalent to getPtr(lazyGetPtr(typeInfo)). |
Marco Poletti | 9491d65 | 2014-11-24 15:47:14 +0000 | [diff] [blame] | 142 | Graph::node_iterator lazyGetPtr(TypeId type); |
Marco Poletti | 934689f | 2014-11-16 14:28:16 +0000 | [diff] [blame] | 143 | |
| 144 | // getPtr(deps, index) is equivalent to getPtr(lazyGetPtr(deps, index)). |
Marco Poletti | 0bfbe05 | 2014-11-24 17:11:27 +0000 | [diff] [blame] | 145 | Graph::node_iterator lazyGetPtr(Graph::edge_iterator deps, std::size_t dep_index); |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 146 | |
Marco Poletti | 1576a73 | 2014-10-18 12:35:17 -0700 | [diff] [blame] | 147 | // Similar to getPtr, but the binding might not exist. Returns nullptr if it doesn't. |
Marco Poletti | 9491d65 | 2014-11-24 15:47:14 +0000 | [diff] [blame] | 148 | void* unsafeGetPtr(TypeId type); |
Marco Poletti | 1576a73 | 2014-10-18 12:35:17 -0700 | [diff] [blame] | 149 | |
Marco Poletti | 9491d65 | 2014-11-24 15:47:14 +0000 | [diff] [blame] | 150 | void* getPtrForMultibinding(TypeId type); |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 151 | |
Marco Poletti | 1fd2649 | 2014-09-28 12:31:13 +0100 | [diff] [blame] | 152 | // Returns a std::vector<T*>*, or nullptr if there are no multibindings. |
Marco Poletti | 9491d65 | 2014-11-24 15:47:14 +0000 | [diff] [blame] | 153 | void* getMultibindings(TypeId type); |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 154 | |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 155 | // Constructs any necessary instances, but NOT the instance set. |
Marco Poletti | 9491d65 | 2014-11-24 15:47:14 +0000 | [diff] [blame] | 156 | void ensureConstructedMultibinding(NormalizedMultibindingData& multibinding_data); |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 157 | |
| 158 | template <typename T> |
Marco Poletti | fdc7990 | 2017-05-21 13:27:57 +0100 | [diff] [blame^] | 159 | friend struct GetFirstStage; |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 160 | |
Marco Poletti | 934689f | 2014-11-16 14:28:16 +0000 | [diff] [blame] | 161 | template <typename T> |
| 162 | friend class fruit::Provider; |
Marco Poletti | d1b46ee | 2017-05-20 13:06:21 +0100 | [diff] [blame] | 163 | |
| 164 | template <typename I, typename C, typename AnnotatedC> |
| 165 | static BindingData::object_t createInjectedObjectForBind(InjectorStorage& injector, InjectorStorage::Graph::node_iterator node_itr); |
Marco Poletti | 934689f | 2014-11-16 14:28:16 +0000 | [diff] [blame] | 166 | |
Marco Poletti | d1b46ee | 2017-05-20 13:06:21 +0100 | [diff] [blame] | 167 | template <typename C, typename T, typename AnnotatedSignature, typename Lambda> |
| 168 | static BindingData::object_t createInjectedObjectForProvider(InjectorStorage& injector, Graph::node_iterator node_itr); |
| 169 | |
| 170 | template <typename I, typename C, typename T, typename AnnotatedSignature, typename Lambda> |
| 171 | static BindingData::object_t createInjectedObjectForCompressedProvider(InjectorStorage& injector, Graph::node_iterator node_itr); |
| 172 | |
| 173 | template <typename C, typename AnnotatedSignature> |
| 174 | static BindingData::object_t createInjectedObjectForConstructor(InjectorStorage& injector, Graph::node_iterator node_itr); |
| 175 | |
| 176 | template <typename I, typename C, typename AnnotatedSignature> |
| 177 | static BindingData::object_t createInjectedObjectForCompressedConstructor(InjectorStorage& injector, Graph::node_iterator node_itr); |
| 178 | |
| 179 | template <typename I, typename C, typename AnnotatedCPtr> |
| 180 | static MultibindingData::object_t createInjectedObjectForMultibinding(InjectorStorage& m); |
| 181 | |
| 182 | template <typename C, typename T, typename AnnotatedSignature, typename Lambda> |
| 183 | static BindingData::object_t createInjectedObjectForMultibindingProvider(InjectorStorage& injector); |
| 184 | |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 185 | public: |
Marco Poletti | 0bfbe05 | 2014-11-24 17:11:27 +0000 | [diff] [blame] | 186 | |
| 187 | // Wraps a std::vector<std::pair<TypeId, BindingData>>::iterator as an iterator on tuples |
| 188 | // (typeId, normalizedBindingData, isTerminal, edgesBegin, edgesEnd) |
| 189 | struct BindingDataNodeIter { |
| 190 | std::vector<std::pair<TypeId, BindingData>>::iterator itr; |
| 191 | |
| 192 | BindingDataNodeIter* operator->(); |
| 193 | |
| 194 | void operator++(); |
| 195 | |
| 196 | bool operator==(const BindingDataNodeIter& other) const; |
| 197 | bool operator!=(const BindingDataNodeIter& other) const; |
| 198 | |
Marco Poletti | e99fdb7 | 2016-05-22 12:26:08 +0100 | [diff] [blame] | 199 | std::ptrdiff_t operator-(BindingDataNodeIter other) const; |
| 200 | |
Marco Poletti | 0bfbe05 | 2014-11-24 17:11:27 +0000 | [diff] [blame] | 201 | TypeId getId(); |
| 202 | NormalizedBindingData getValue(); |
| 203 | bool isTerminal(); |
| 204 | const TypeId* getEdgesBegin(); |
| 205 | const TypeId* getEdgesEnd(); |
| 206 | }; |
| 207 | |
Marco Poletti | 0316a00 | 2016-08-29 16:43:10 +0100 | [diff] [blame] | 208 | InjectorStorage(const ComponentStorage& storage, const std::vector<TypeId>& exposed_types); |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 209 | |
Marco Poletti | 9491d65 | 2014-11-24 15:47:14 +0000 | [diff] [blame] | 210 | InjectorStorage(const NormalizedComponentStorage& normalized_storage, |
Marco Poletti | 0316a00 | 2016-08-29 16:43:10 +0100 | [diff] [blame] | 211 | const ComponentStorage& storage, |
Marco Poletti | 5c354a6 | 2015-01-29 18:40:34 +0100 | [diff] [blame] | 212 | std::vector<TypeId>&& exposed_types); |
Marco Poletti | 4e9594b | 2014-11-09 13:52:46 +0000 | [diff] [blame] | 213 | |
Marco Poletti | 3e576c2 | 2016-06-19 16:34:08 +0100 | [diff] [blame] | 214 | // This is just the default destructor, but we declare it here to avoid including |
| 215 | // normalized_component_storage.h in fruit.h. |
| 216 | ~InjectorStorage(); |
| 217 | |
Marco Poletti | 5200558 | 2014-11-09 15:13:26 +0000 | [diff] [blame] | 218 | InjectorStorage(InjectorStorage&&) = delete; |
| 219 | InjectorStorage& operator=(InjectorStorage&&) = delete; |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 220 | |
| 221 | InjectorStorage(const InjectorStorage& other) = delete; |
| 222 | InjectorStorage& operator=(const InjectorStorage& other) = delete; |
| 223 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 224 | // Usually get<T>() returns a T. |
| 225 | // However, get<Annotated<Annotation1, T>>() returns a T, not an Annotated<Annotation1, T>. |
| 226 | template <typename AnnotatedT> |
Marco Poletti | 3b95a51 | 2015-07-11 13:43:39 +0100 | [diff] [blame] | 227 | RemoveAnnotations<AnnotatedT> get(); |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 228 | |
Marco Poletti | 80c7bb4 | 2015-02-28 16:42:43 +0000 | [diff] [blame] | 229 | // Similar to the above, but specifying the node_iterator of the type. Use this together with lazyGetPtr when the node_iterator is known, it's faster. |
Marco Poletti | 31f638a | 2015-05-10 21:21:25 +0100 | [diff] [blame] | 230 | // Note that T should *not* be annotated. |
| 231 | template <typename T> |
| 232 | T get(InjectorStorage::Graph::node_iterator node_iterator); |
Marco Poletti | 7eab28b | 2014-11-24 15:06:54 +0000 | [diff] [blame] | 233 | |
Marco Poletti | 80c7bb4 | 2015-02-28 16:42:43 +0000 | [diff] [blame] | 234 | // Looks up the location where the type is (or will be) stored, but does not construct the class. |
Marco Poletti | b9c9cef | 2015-05-31 15:31:12 +0100 | [diff] [blame] | 235 | // get<AnnotatedT>() is equivalent to get<AnnotatedT>(lazyGetPtr<Apply<NormalizeType, AnnotatedT>>(deps, dep_index)) |
| 236 | // and also to get<T> (lazyGetPtr<Apply<NormalizeType, AnnotatedT>>(deps, dep_index)) |
Marco Poletti | 80c7bb4 | 2015-02-28 16:42:43 +0000 | [diff] [blame] | 237 | // dep_index is the index of the dep in `deps'. |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 238 | template <typename AnnotatedC> |
Marco Poletti | 80c7bb4 | 2015-02-28 16:42:43 +0000 | [diff] [blame] | 239 | Graph::node_iterator lazyGetPtr(Graph::edge_iterator deps, std::size_t dep_index, Graph::node_iterator bindings_begin); |
| 240 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 241 | // Returns nullptr if AnnotatedC was not bound. |
| 242 | template <typename AnnotatedC> |
Marco Poletti | 3b95a51 | 2015-07-11 13:43:39 +0100 | [diff] [blame] | 243 | RemoveAnnotations<AnnotatedC>* unsafeGet(); |
Marco Poletti | 1576a73 | 2014-10-18 12:35:17 -0700 | [diff] [blame] | 244 | |
Marco Poletti | cc97a16 | 2015-05-10 12:10:12 +0100 | [diff] [blame] | 245 | template <typename AnnotatedC> |
Marco Poletti | 3b95a51 | 2015-07-11 13:43:39 +0100 | [diff] [blame] | 246 | const std::vector<RemoveAnnotations<AnnotatedC>*>& getMultibindings(); |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 247 | |
| 248 | void eagerlyInjectMultibindings(); |
| 249 | }; |
| 250 | |
| 251 | } // namespace impl |
| 252 | } // namespace fruit |
| 253 | |
Marco Poletti | f289510 | 2016-01-30 13:38:37 +0000 | [diff] [blame] | 254 | #include <fruit/impl/storage/injector_storage.defn.h> |
Marco Poletti | fdbfcbe | 2014-08-31 08:57:47 +0100 | [diff] [blame] | 255 | |
| 256 | |
| 257 | #endif // FRUIT_INJECTOR_STORAGE_H |