Commit 9e413ef7 authored by Floris Berendsen's avatar Floris Berendsen
Browse files

ENH: removed NetworkBuilder non-default constructors

parent 7ebb4b4b
...@@ -59,8 +59,6 @@ public: ...@@ -59,8 +59,6 @@ public:
typedef std::map< typedef std::map<
std::string, RegistrationControllerStartInterface * > RegistrationControllerStartInterfaceMapType; std::string, RegistrationControllerStartInterface * > RegistrationControllerStartInterfaceMapType;
NetworkBuilder( std::shared_ptr< Blueprint > blueprint );
NetworkBuilder( Blueprint * blueprint );
NetworkBuilder(); NetworkBuilder();
virtual ~NetworkBuilder() {}; virtual ~NetworkBuilder() {};
......
...@@ -23,15 +23,6 @@ ...@@ -23,15 +23,6 @@
namespace selx namespace selx
{ {
template< typename ComponentList >
NetworkBuilder<ComponentList>::NetworkBuilder(std::shared_ptr< Blueprint > blueprint) : m_Blueprint(blueprint), m_isConfigured(false)
{
}
template< typename ComponentList >
NetworkBuilder<ComponentList>::NetworkBuilder(Blueprint * blueprint) : m_Blueprint(blueprint), m_isConfigured(false)
{
}
template< typename ComponentList > template< typename ComponentList >
NetworkBuilder<ComponentList>::NetworkBuilder() : m_isConfigured(false) NetworkBuilder<ComponentList>::NetworkBuilder() : m_isConfigured(false)
......
...@@ -77,12 +77,13 @@ public: ...@@ -77,12 +77,13 @@ public:
TEST_F( NetworkBuilderTest, Create ) TEST_F( NetworkBuilderTest, Create )
{ {
NetworkBuilderPointer networkBuilderA = NetworkBuilderPointer(new NetworkBuilder<CustomComponentList>()); NetworkBuilderPointer networkBuilderA = NetworkBuilderPointer(new NetworkBuilder<CustomComponentList>());
NetworkBuilderPointer networkBuilderB = NetworkBuilderPointer(new NetworkBuilder<CustomComponentList>(new Blueprint()));
} }
TEST_F( NetworkBuilderTest, Configure ) TEST_F( NetworkBuilderTest, Configure )
{ {
NetworkBuilderPointer networkBuilder = NetworkBuilderPointer(new NetworkBuilder<CustomComponentList>(blueprint)); NetworkBuilderPointer networkBuilder = NetworkBuilderPointer(new NetworkBuilder<CustomComponentList>());
networkBuilder->AddBlueprint(blueprint);
bool allUniqueComponents; bool allUniqueComponents;
EXPECT_NO_THROW( allUniqueComponents = networkBuilder->Configure() ); EXPECT_NO_THROW( allUniqueComponents = networkBuilder->Configure() );
EXPECT_TRUE( allUniqueComponents ); EXPECT_TRUE( allUniqueComponents );
...@@ -90,7 +91,8 @@ TEST_F( NetworkBuilderTest, Configure ) ...@@ -90,7 +91,8 @@ TEST_F( NetworkBuilderTest, Configure )
TEST_F( NetworkBuilderTest, Connect ) TEST_F( NetworkBuilderTest, Connect )
{ {
std::unique_ptr< NetworkBuilderBase > networkBuilder(new NetworkBuilder<CustomComponentList>(blueprint)); NetworkBuilderPointer networkBuilder = NetworkBuilderPointer(new NetworkBuilder<CustomComponentList>());
networkBuilder->AddBlueprint(blueprint);
EXPECT_NO_THROW( bool allUniqueComponents = networkBuilder->Configure() ); EXPECT_NO_THROW( bool allUniqueComponents = networkBuilder->Configure() );
bool success; bool success;
EXPECT_NO_THROW(success = networkBuilder->ConnectComponents()); EXPECT_NO_THROW(success = networkBuilder->ConnectComponents());
...@@ -209,7 +211,8 @@ TEST_F( NetworkBuilderTest, DeduceComponentsFromConnections ) ...@@ -209,7 +211,8 @@ TEST_F( NetworkBuilderTest, DeduceComponentsFromConnections )
blueprint->SetConnection( "ResampleFilter", "Controller", { {} } ); //ReconnectTransformInterface blueprint->SetConnection( "ResampleFilter", "Controller", { {} } ); //ReconnectTransformInterface
blueprint->SetConnection( "TransformDisplacementFilter", "Controller", { {} } ); //ReconnectTransformInterface blueprint->SetConnection( "TransformDisplacementFilter", "Controller", { {} } ); //ReconnectTransformInterface
std::unique_ptr< NetworkBuilderBase > networkBuilder(new NetworkBuilder<RegisterComponents>(blueprint)); std::unique_ptr< NetworkBuilderBase > networkBuilder(new NetworkBuilder<RegisterComponents>());
networkBuilder->AddBlueprint(blueprint);
bool allUniqueComponents; bool allUniqueComponents;
EXPECT_NO_THROW(allUniqueComponents = networkBuilder->Configure()); EXPECT_NO_THROW(allUniqueComponents = networkBuilder->Configure());
EXPECT_TRUE( allUniqueComponents ); EXPECT_TRUE( allUniqueComponents );
......
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