Commit da75a76d authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[CHANGE] dataHandler does not depend on kernel anymore. I introduced

boost::enable_shared_from_this to get the this pointer as boost::shared_ptr
parent 7fac872d
......@@ -6,7 +6,7 @@ FILE( GLOB DATAHANDLER_EXCEPTIONS_SRC "exceptions/*.cpp" )
FILE( GLOB DATAHANDLER_LOADERS_SRC "io/WLoader*.cpp" )
ADD_LIBRARY( dataHandler SHARED ${DATAHANDLER_SRC} ${DATAHANDLER_EXCEPTIONS_SRC} ${DATAHANDLER_LOADERS_SRC} )
TARGET_LINK_LIBRARIES( dataHandler kernel common math ${Boost_LIBRARIES} niftiio biosig)
TARGET_LINK_LIBRARIES( dataHandler common math ${Boost_LIBRARIES} niftiio biosig)
# Unit tests
IF( CXXTEST_FOUND )
......
......@@ -28,7 +28,6 @@
#include "WSubject.h"
#include "exceptions/WNoSuchDataSetException.h"
#include "WLoaderManager.h"
#include "../kernel/WKernel.h"
WDataHandler::WDataHandler()
{
......@@ -61,6 +60,6 @@ void WDataHandler::loadDataSets( std::vector< std::string > fileNames )
for ( size_t i = 0 ; i < fileNames.size() ; ++i)
{
// TODO( wiebel ): need to associate the dataset to its subject
lm.load( fileNames[i], WKernel::getRunningKernel()->getDataHandler() );
lm.load( fileNames[i], shared_from_this() );
}
}
......@@ -28,6 +28,7 @@
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
class WSubject;
......@@ -37,7 +38,7 @@ class WSubject;
* to our data.
* \ingroup dataHandler
*/
class WDataHandler
class WDataHandler : public boost::enable_shared_from_this< WDataHandler >
{
/**
* Only UnitTests may be friends.
......
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