Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
SuperElastix
Commits
43f742f9
Commit
43f742f9
authored
Feb 21, 2017
by
Floris Berendsen
Browse files
ENH: added the base class method ConnectionsSatisfied with a default
implementation. SuperElastix/SuperElastix#32
parent
3948e358
Changes
7
Hide whitespace changes
Inline
Side-by-side
Modules/ComponentInterface/include/selxAccepting.hxx
View file @
43f742f9
...
...
@@ -114,7 +114,7 @@ bool
Accepting
<
FirstInterface
,
RestInterfaces
...
>::
AreAllAccepted
()
{
InterfaceAcceptor
<
FirstInterface
>
*
acceptIF
=
(
this
);
if
(
acceptIF
->
isSet
==
false
)
if
(
acceptIF
->
isSet
()
==
false
)
{
return
false
;
}
...
...
Modules/ComponentInterface/include/selxComponentBase.h
View file @
43f742f9
...
...
@@ -66,6 +66,9 @@ public:
//virtual const std::map< std::string, std::string > TemplateProperties(); //TODO should be overridden
// Each component is checked if its required connections are made after all handshakes.
// SuperElastixComponent provides a default implementation which may be overridden by the component developer
virtual
bool
ConnectionsSatisfied
()
=
0
;
const
std
::
string
m_Name
;
};
}
// end namespace selx
...
...
Modules/ComponentInterface/include/selxInterfaceAcceptor.h
View file @
43f742f9
...
...
@@ -43,9 +43,12 @@ public:
bool
CanAcceptConnectionFrom
(
ComponentBase
::
ConstPointer
);
bool
isSet
()
{
return
m_isSet
;
};
private:
bool
isSet
;
bool
m_isSet
;
};
}
//end namespace selx
...
...
Modules/ComponentInterface/include/selxInterfaceAcceptor.hxx
View file @
43f742f9
...
...
@@ -35,7 +35,7 @@ InterfaceAcceptor< InterfaceT >::Connect( ComponentBase::Pointer providerCompone
}
// connect value interfaces
this
->
Set
(
providerInterface
);
// due to the input argument being uniquely defined in the multiple inheritance tree, all versions of Set() are accessible at component level
this
->
isSet
=
true
;
this
->
m_
isSet
=
true
;
return
1
;
}
...
...
Modules/ComponentInterface/include/selxSuperElastixComponent.h
View file @
43f742f9
...
...
@@ -45,6 +45,8 @@ public:
virtual
int
AcceptConnectionFrom
(
ComponentBase
::
Pointer
);
virtual
bool
ConnectionsSatisfied
()
override
;
protected:
virtual
InterfaceStatus
CanAcceptConnectionFrom
(
ComponentBase
::
ConstPointer
,
const
InterfaceCriteriaType
interfaceCriteria
)
override
;
...
...
Modules/ComponentInterface/include/selxSuperElastixComponent.hxx
View file @
43f742f9
...
...
@@ -47,6 +47,16 @@ SuperElastixComponent< AcceptingInterfaces, ProvidingInterfaces >
{
return
AcceptingInterfaces
::
CanAcceptConnectionFrom
(
other
,
interfaceCriteria
);
}
template
<
typename
AcceptingInterfaces
,
typename
ProvidingInterfaces
>
bool
SuperElastixComponent
<
AcceptingInterfaces
,
ProvidingInterfaces
>
::
ConnectionsSatisfied
()
{
// Default implementation. Components that allow unused connections should override this function.
return
AcceptingInterfaces
::
AreAllAccepted
();
}
}
// end namespace selx
#endif // #define selxSuperElastixComponent_hxx
Modules/ComponentInterface/src/selxComponentBase.cxx
View file @
43f742f9
...
...
@@ -31,7 +31,7 @@ ComponentBase::ComponentBase( const std::string & name ) : m_Name( name )
{
}
//const std::map< std::string, std::string > ComponentBase::TemplateProperties()
// { return{}; }
}
// end namespace selx
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment