Skip to content

Commit

Permalink
Rename the non-templated getPtr() to getPtrInternal().
Browse files Browse the repository at this point in the history
  • Loading branch information
poletti-marco committed Feb 28, 2015
1 parent c4fbcb1 commit bfcb7ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/fruit/impl/storage/injector_storage.defn.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ template <typename C>
inline C* InjectorStorage::getPtr(Graph::node_iterator itr) {
assert(bindings.find(getTypeId<C>()) == itr);
assert(!(bindings.end() == itr));
void* p = getPtr(itr);
void* p = getPtrInternal(itr);
return reinterpret_cast<C*>(p);
}

Expand All @@ -178,7 +178,7 @@ inline void* InjectorStorage::unsafeGetPtr(TypeId type) {
if (itr == bindings.end()) {
return nullptr;
}
return getPtr(itr);
return getPtrInternal(itr);
}

template <typename C>
Expand All @@ -192,7 +192,7 @@ inline const std::vector<C*>& InjectorStorage::getMultibindings() {
}
}

inline void* InjectorStorage::getPtr(Graph::node_iterator node_itr) {
inline void* InjectorStorage::getPtrInternal(Graph::node_iterator node_itr) {
NormalizedBindingData& bindingData = node_itr.getNode();
if (!node_itr.isTerminal()) {
bindingData.create(*this, node_itr);
Expand Down
5 changes: 2 additions & 3 deletions include/fruit/impl/storage/injector_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,12 @@ class InjectorStorage {
template <typename C>
Graph::node_iterator lazyGetPtr();

// getPtr() is equivalent to getPtr(lazyGetPtr())
// getPtr(deps, index) is equivalent to getPtr(lazyGetPtr(deps, index))
// getPtr() is equivalent to getPtrInternal(lazyGetPtr())
template <typename C>
C* getPtr(Graph::node_iterator itr);

// Similar to the previous, but takes a node_iterator. Use this when the node_iterator is known, it's faster.
void* getPtr(Graph::node_iterator itr);
void* getPtrInternal(Graph::node_iterator itr);

// getPtr(typeInfo) is equivalent to getPtr(lazyGetPtr(typeInfo)).
Graph::node_iterator lazyGetPtr(TypeId type);
Expand Down

0 comments on commit bfcb7ed

Please sign in to comment.