Commit 53e9415e authored by Floris Berendsen's avatar Floris Berendsen
Browse files

BUG: replaced CanProvideConnectionTo by reversed CanAcceptConnectionFrom

parent 14d67c57
......@@ -88,7 +88,6 @@ class Providing<>
{
public:
static unsigned int CountMeetsCriteria(const ComponentBase::InterfaceCriteriaType) { return 0; }
InterfaceStatus CanProvideConnectionTo(ComponentBase* other, const ComponentBase::InterfaceCriteriaType interfaceCriteria) { return InterfaceStatus::noprovider; };
protected:
bool HasInterface( const char * ) { return false; }
......@@ -99,7 +98,6 @@ class Providing< FirstInterface, RestInterfaces ... > : public FirstInterface, p
{
public:
static unsigned int CountMeetsCriteria(const ComponentBase::InterfaceCriteriaType);
InterfaceStatus CanProvideConnectionTo(ComponentBase* other, const ComponentBase::InterfaceCriteriaType interfaceCriteria);
protected:
bool HasInterface( const char * );
......
......@@ -87,13 +87,6 @@ SuperElastixComponent< AcceptingInterfaces, ProvidingInterfaces >
return AcceptingInterfaces::CanAcceptConnectionFrom(other, interfaceCriteria);
}
template< typename AcceptingInterfaces, typename ProvidingInterfaces >
InterfaceStatus
SuperElastixComponent< AcceptingInterfaces, ProvidingInterfaces >
::CanProvideConnectionTo(ComponentBase* other, const InterfaceCriteriaType interfaceCriteria)
{
return ProvidingInterfaces::CanProvideConnectionTo(other, interfaceCriteria);
}
//////////////////////////////////////////////////////////////////////////
template< typename FirstInterface, typename ... RestInterfaces >
InterfaceStatus
......@@ -188,11 +181,6 @@ Accepting< FirstInterface, RestInterfaces ... >::CanAcceptConnectionFrom(Compone
return InterfaceStatus::noaccepter;
}
template< typename FirstInterface, typename ... RestInterfaces >
bool
Providing< FirstInterface, RestInterfaces ... >::HasInterface( const char * interfacename )
......
......@@ -80,7 +80,7 @@ unsigned int ComponentSelector::RequireAcceptingInterfaceFrom(ComponentBasePoint
}
unsigned int ComponentSelector::RequireProvidingInterfaceTo(ComponentBasePointer other, const InterfaceCriteriaType & interfaceCriteria)
{
this->m_PossibleComponents.remove_if([&](ComponentBasePointer component){auto status = component->CanProvideConnectionTo(other, interfaceCriteria);
this->m_PossibleComponents.remove_if([&](ComponentBasePointer component){auto status = other->CanAcceptConnectionFrom(component, interfaceCriteria);
return status == InterfaceStatus::noaccepter || status == InterfaceStatus::noprovider;
});
return 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment