Skip to content

Commit

Permalink
Changed AddInternalTraits constructor to be templeted on base type
Browse files Browse the repository at this point in the history
  • Loading branch information
gtremper committed Aug 4, 2014
1 parent fba7a70 commit b64f1a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions autowiring/CoreContext.h
Expand Up @@ -304,10 +304,10 @@ class CoreContext:
/// </summary>
struct AddInternalTraits {
template<class T>
AddInternalTraits(const AutoFilterDescriptor& subscriber, const std::shared_ptr<T>& value) :
AddInternalTraits(const std::shared_ptr<typename SelectTypeUnifier<T>::type>& value, T* dummy) :
type(typeid(T)),
value(value),
subscriber(subscriber),
subscriber(AutoFilterDescriptorSelect<T>(value)),
pObject(autowiring::fast_pointer_cast<Object>(value)),
pContextMember(autowiring::fast_pointer_cast<ContextMember>(value)),
pCoreRunnable(autowiring::fast_pointer_cast<CoreRunnable>(value)),
Expand Down Expand Up @@ -534,7 +534,7 @@ class CoreContext:

try {
// Pass control to the insertion routine, which will handle injection from this point:
AddInternal(AddInternalTraits(AutoFilterDescriptorSelect<T>(retVal), retVal));
AddInternal(AddInternalTraits(retVal, (T*)nullptr));
}
catch(autowiring_error&) {
// We know why this exception occurred. It's because, while we were constructing our
Expand Down Expand Up @@ -786,7 +786,7 @@ class CoreContext:
/// </remarks>
template<class T>
void Snoop(const std::shared_ptr<T>& pSnooper) {
const AddInternalTraits traits(AutoFilterDescriptorSelect<T>(pSnooper), pSnooper);
const AddInternalTraits traits(pSnooper, (T*)nullptr);

// Add to collections of snoopers
InsertSnooper(pSnooper);
Expand All @@ -808,7 +808,7 @@ class CoreContext:
/// </remarks>
template<class T>
void Unsnoop(const std::shared_ptr<T>& pSnooper) {
const AddInternalTraits traits(AutoFilterDescriptorSelect<T>(pSnooper), pSnooper);
const AddInternalTraits traits(pSnooper, (T*)nullptr);

RemoveSnooper(pSnooper);

Expand Down

0 comments on commit b64f1a8

Please sign in to comment.