Commit eb744278 authored by Floris Berendsen's avatar Floris Berendsen
Browse files

ENH: renamed ConnectFrom to AcceptConnectionFrom

And added Fixed/Moving image interfaces
parent 4ae7eee3
......@@ -36,8 +36,8 @@ namespace selx
enum interfaceStatus { success, noaccepter, noprovider };
virtual interfaceStatus ConnectFrom(const char *, ComponentBase*) = 0;
virtual int ConnectFrom(ComponentBase*) = 0;
virtual interfaceStatus AcceptConnectionFrom(const char *, ComponentBase*) = 0;
virtual int AcceptConnectionFrom(ComponentBase*) = 0;
/** if there is any failed criterion, return false (like a short - circuit AND) */
bool MeetsCriteria(const CriteriaType &criteria);
......
......@@ -59,6 +59,20 @@ namespace selx
virtual typename itk::ImageSource<itk::Image<TPixel, Dimensionality>>::Pointer GetItkImageSource() = 0;
};
template<int Dimensionality, class TPixel>
class itkImageSourceMovingInterface {
// An interface that exposes that its internal filter which is derived from itkImageSource
public:
virtual typename itk::ImageSource<itk::Image<TPixel, Dimensionality>>::Pointer GetItkImageSourceMoving() = 0;
};
template<int Dimensionality, class TPixel>
class itkImageSourceFixedInterface {
// An interface that exposes that its internal filter which is derived from itkImageSource
public:
virtual typename itk::ImageSource<itk::Image<TPixel, Dimensionality>>::Pointer GetItkImageSourceFixed() = 0;
};
class SourceInterface {
// A special interface: the Overlord checks components for this type of interface.
// By this interface only Source Components can to talk to the Overlord.
......@@ -136,8 +150,8 @@ template<typename AcceptingInterfaces, typename ProvidingInterfaces>
class Implements : public AcceptingInterfaces, public ProvidingInterfaces, public ComponentBase
{
public:
virtual interfaceStatus ConnectFrom(const char *, ComponentBase*);
virtual int ConnectFrom(ComponentBase*);
virtual interfaceStatus AcceptConnectionFrom(const char *, ComponentBase*);
virtual int AcceptConnectionFrom(ComponentBase*);
protected:
virtual bool HasAcceptingInterface(const char *);
virtual bool HasProvidingInterface(const char *);
......
......@@ -20,13 +20,13 @@ int InterfaceAcceptor<InterfaceT>::Connect(ComponentBase* providerComponent){
}
//////////////////////////////////////////////////////////////////////////
template<typename AcceptingInterfaces, typename ProvidingInterfaces>
ComponentBase::interfaceStatus Implements<AcceptingInterfaces, ProvidingInterfaces>::ConnectFrom(const char * interfacename, ComponentBase* other)
ComponentBase::interfaceStatus Implements<AcceptingInterfaces, ProvidingInterfaces>::AcceptConnectionFrom(const char * interfacename, ComponentBase* other)
{
return AcceptingInterfaces::ConnectFromImpl(interfacename, other);
}
template<typename AcceptingInterfaces, typename ProvidingInterfaces>
int Implements<AcceptingInterfaces, ProvidingInterfaces>::ConnectFrom(ComponentBase* other)
int Implements<AcceptingInterfaces, ProvidingInterfaces>::AcceptConnectionFrom(ComponentBase* other)
{
return AcceptingInterfaces::ConnectFromImpl(other);
}
......
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