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

WIP: end of the day, TODO: does not compile

parent 40e0018c
......@@ -29,6 +29,7 @@
#include <map>
#include <vector>
#include <memory>
#include "selxLogger.h"
namespace selx
{
......@@ -70,6 +71,7 @@ public:
// SuperElastixComponent provides a default implementation which may be overridden by the component developer
virtual bool ConnectionsSatisfied() = 0 ;
const std::string m_Name;
LoggerInterface* m_Logger;
};
} // end namespace selx
......
......@@ -50,7 +50,7 @@ public:
typedef ComponentListType::size_type NumberOfComponentsType;
/** set selection criteria for possibleComponents*/
ComponentSelector( const std::string & name );
ComponentSelector( const std::string & name);
/** Narrow selection criteria*/
void AddCriterion( const CriterionType & criterion );
......
......@@ -26,7 +26,7 @@ namespace selx
template< >
struct ContructComponentsFromTypeList< TypeList< >>
{
static std::list< ComponentBase::Pointer > fill( std::list< ComponentBase::Pointer > & components, const std::string & name )
static std::list< ComponentBase::Pointer > fill(std::list< ComponentBase::Pointer > & components, const std::string & name )
{
return components;
}
......@@ -37,16 +37,16 @@ struct ContructComponentsFromTypeList< TypeList< ComponentType, Rest ... >>
{
static std::list< ComponentBase::Pointer > fill( std::list< ComponentBase::Pointer > & components, const std::string & name )
{
components.push_back( std::make_shared< ComponentType >( name ) );
return ContructComponentsFromTypeList< TypeList< Rest ... >>::fill( components, name );
components.push_back( std::make_shared< ComponentType >( name) );
return ContructComponentsFromTypeList< TypeList< Rest ... >>::fill(components, name);
}
};
template< class ComponentList >
ComponentSelector< ComponentList >::ComponentSelector( const std::string & name )
ComponentSelector< ComponentList >::ComponentSelector(const std::string & name)
{
m_PossibleComponents = std::list< ComponentBase::Pointer >();
m_PossibleComponents = ContructComponentsFromTypeList< ComponentList >::fill( m_PossibleComponents, name );
m_PossibleComponents = ContructComponentsFromTypeList< ComponentList >::fill(m_PossibleComponents, name);
}
......
......@@ -37,6 +37,8 @@
#include "selxInterfaces.h"
#include "selxInterfaceTraits.h"
#include "selxLogger.h"
namespace selx
{
template< class ComponentList >
......@@ -117,7 +119,7 @@ protected:
// A selector for each node, that each can hold multiple instantiated components. Ultimately is should be 1 component each.
ComponentSelectorContainerType m_ComponentSelectorContainer;
bool m_isConfigured;
Logger m_Logger;
private:
};
} // end namespace selx
......
......@@ -159,7 +159,7 @@ NetworkBuilder< ComponentList >::ApplyComponentConfiguration()
for( auto const & name : componentNames )
{
std::cout << " Blueprint Node: " << name << std::endl;
ComponentSelectorPointer currentComponentSelector = std::make_shared< ComponentSelectorType >( name );
ComponentSelectorPointer currentComponentSelector = std::make_shared< ComponentSelectorType >( name , this->m_Logger );
Blueprint::ParameterMapType currentProperty = this->m_Blueprint->GetComponent( name );
for( auto const & criterion : currentProperty )
......
......@@ -25,6 +25,7 @@
namespace selx
{
enum SeverityType {
TRACE,
DEBUG,
......@@ -34,18 +35,21 @@ enum SeverityType {
FATAL
};
class Logger
class LoggerInterface
{
public:
typedef const std::string SourceNameType;
typedef const std::string ChannelType;
typedef const std::string MessageType;
typedef const std::string FormatType;
typedef const std::string FileNameType;
typedef const int RotationSizeType;
virtual void Log(SeverityType severity, MessageType message) = 0;
};
class Logger : public LoggerInterface
{
public:
typedef const std::string ChannelType;
typedef const std::string FormatType;
using LoggerInterface::MessageType;
Logger();
~Logger();
......@@ -57,7 +61,7 @@ public:
// Logger::ChannelType channel = "SuperElastix",
// FormatType format = "[%LineID% %TimeStamp% %ComponentName% %Channel% %SeverityLevel%]: %Message%" );
void Log( SeverityType severity, MessageType message );
virtual void Log(SeverityType severity, MessageType message);
// void Log( ChannelType channel, SeverityType severity, MessageType message );
private:
......
Markdown is supported
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