Skip to content

Commit

Permalink
Fix factory export declarations. Refs #5397.
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Jul 31, 2012
1 parent 23b5392 commit 91e84bf
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ namespace Mantid
{
std::set<detid_t> group;
group.insert(detids[i]);
m_detGroups.insert(std::make_pair(i+1, group));
m_detGroups.insert(std::make_pair(static_cast<specid_t>(i+1), group));
}
}

Expand All @@ -195,7 +195,7 @@ namespace Mantid
*/
void CreateSimulationWorkspace::loadMappingFromRAW(const std::string & filename)
{
FILE *rawFile = fopen(filename.c_str(), "r");
FILE *rawFile = fopen(filename.c_str(), "rb");
if(!rawFile) throw std::runtime_error("Cannot open RAW file for reading: " + filename);

ISISRAW2 isisRaw;
Expand Down
1 change: 1 addition & 0 deletions Code/Mantid/Framework/MDAlgorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ set ( INC_FILES
inc/MantidMDAlgorithms/ConvertToMDEvents.h
inc/MantidMDAlgorithms/DampedHisenbergFMSW.h
inc/MantidMDAlgorithms/DivideMD.h
inc/MantidMDAlgorithms/DllConfig.h
inc/MantidMDAlgorithms/EqualToMD.h
inc/MantidMDAlgorithms/ExponentialMD.h
inc/MantidMDAlgorithms/GreaterThanMD.h
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef MANTID_MDALGORITHMS_DLLCONFIG_H_
#define MANTID_MDALGORITHMS_DLLCONFIG_H_

/*
This file contains the DLLExport/DLLImport linkage configuration for the
MDAlgorithms library
@author Martyn Gigg, Tessella plc
Copyright &copy; 2012 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
#include "MantidKernel/System.h"

#ifdef IN_MANTID_MDALGORITHMS
#define MANTID_MDALGORITHMS_DLL DLLExport
#else
#define MANTID_MDALGORITHMS_DLL DLLImport
#endif /* IN_MANTID_MDALGORITHMS*/

#endif // MANTID_MDALGORITHMS_DLLCONFIG_H_
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
#include "MantidMDAlgorithms/DllConfig.h"
#include "MantidKernel/DynamicFactory.h"
#include "MantidKernel/SingletonHolder.h"
#include "MantidKernel/ClassMacros.h"
Expand All @@ -42,7 +43,7 @@ namespace Mantid
* A factory class for mapping string names of models to their
* class types. Allows a model to be instantiated from a string.
*/
class DLLExport ForegroundModelFactoryImpl : public Kernel::DynamicFactory<ForegroundModel>
class MANTID_MDALGORITHMS_DLL ForegroundModelFactoryImpl : public Kernel::DynamicFactory<ForegroundModel>
{
private:
/// Base-class type
Expand All @@ -67,10 +68,10 @@ namespace Mantid
///Forward declaration of a specialisation of SingletonHolder for ForegroundModelFactoryImpl (needed for dllexport/dllimport).
#ifdef _WIN32
// this breaks new namespace declaraion rules; need to find a better fix
template class DLLExport Kernel::SingletonHolder<ForegroundModelFactoryImpl>;
template class MANTID_MDALGORITHMS_DLL Kernel::SingletonHolder<ForegroundModelFactoryImpl>;
#endif /* _WIN32 */
/// Typedef singleton instance to ForegroundFactory
typedef Kernel::SingletonHolder<ForegroundModelFactoryImpl> ForegroundModelFactory;
typedef MANTID_MDALGORITHMS_DLL Kernel::SingletonHolder<ForegroundModelFactoryImpl> ForegroundModelFactory;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
#include "MantidMDAlgorithms/DllConfig.h"
#include "MantidKernel/DynamicFactory.h"
#include "MantidKernel/ClassMacros.h"
#include "MantidKernel/SingletonHolder.h"
Expand All @@ -40,7 +41,7 @@ namespace Mantid
/**
* Defines a factory for creating convolution types from a string
*/
class DLLExport MDResolutionConvolutionFactoryImpl
class MANTID_MDALGORITHMS_DLL MDResolutionConvolutionFactoryImpl
: public Kernel::DynamicFactory<MDResolutionConvolution>
{
private:
Expand Down Expand Up @@ -69,10 +70,10 @@ namespace Mantid
///Forward declaration of a specialisation of SingletonHolder for MDResolutionConvolutionFactoryImpl (needed for dllexport/dllimport).
#ifdef _WIN32
// this breaks new namespace declaraion rules; need to find a better fix
template class DLLExport Kernel::SingletonHolder<MDResolutionConvolutionFactoryImpl>;
template class MANTID_MDALGORITHMS_DLL Kernel::SingletonHolder<MDResolutionConvolutionFactoryImpl>;
#endif /* _WIN32 */
/// Typedef singleton instance to MDResolutionConvolutionFactory
typedef Kernel::SingletonHolder<MDResolutionConvolutionFactoryImpl> MDResolutionConvolutionFactory;
typedef MANTID_MDALGORITHMS_DLL Kernel::SingletonHolder<MDResolutionConvolutionFactoryImpl> MDResolutionConvolutionFactory;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ namespace Mantid
static const double small(1e-20);
const double prefactor = std::sqrt(-2.0*std::log(std::max(small,randomNums[nvars])));
const double r2 = randomNums[nvars+1];
const double etaSig = observation.experimentInfo()->run().getLogAsSingleValue("EtaSigma");
const double etaSig = observation.experimentInfo()->run().getLogAsSingleValue("eta_sigma");

m_etaInPlane = etaSig*prefactor*std::cos(2.0*M_PI*r2);
m_etaOutPlane = etaSig*prefactor*std::sin(2.0*M_PI*r2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MDResolutionConvolutionFactoryTest : public CxxTest::TestSuite
MDResolutionConvolutionFactory::Instance().createConvolution("__NOT_VALID", "FakeForeground", fakeFunction), Exception::NotFoundError);
}

void xtest_Factory_Creates_New_Convolution_Object_When_Name_And_ForegroundModel_Are_Valid()
void test_Factory_Creates_New_Convolution_Object_When_Name_And_ForegroundModel_Are_Valid()
{
using Mantid::MDAlgorithms::MDResolutionConvolution;
FakeMDFunction fakeFunction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ResolutionConvolvedCrossSectionTest : public CxxTest::TestSuite
delete crossSecResolution;
}

void xtest_functionMD_Does_Not_Throw_With_Foreground_And_ResolutionModel_Attrs_Set()
void test_functionMD_Does_Not_Throw_With_Foreground_And_ResolutionModel_Attrs_Set()
{
using namespace Mantid::MDAlgorithms;
using namespace Mantid::API;
Expand All @@ -73,7 +73,7 @@ class ResolutionConvolvedCrossSectionTest : public CxxTest::TestSuite
delete crossSecResolution;
}

void xtest_Function_Acquires_ForegroundModelParameters_When_ResolutionModel_Is_Set()
void test_Function_Acquires_ForegroundModelParameters_When_ResolutionModel_Is_Set()
{
using namespace Mantid::MDAlgorithms;
using namespace Mantid::API;
Expand All @@ -90,7 +90,7 @@ class ResolutionConvolvedCrossSectionTest : public CxxTest::TestSuite
delete crossSection;
}

void xtest_Function_Acquires_Attributes_From_ResolutionType_When_Set()
void test_Function_Acquires_Attributes_From_ResolutionType_When_Set()
{
using namespace Mantid::MDAlgorithms;
using namespace Mantid::API;
Expand All @@ -104,7 +104,7 @@ class ResolutionConvolvedCrossSectionTest : public CxxTest::TestSuite
TS_ASSERT_EQUALS(crossSection.nAttributes(), startingNAttrs + 2);
}

void xtest_ResolutionConvolution_Attributes_Are_Passed_On_Correctly()
void test_ResolutionConvolution_Attributes_Are_Passed_On_Correctly()
{
// How this works -> The fake convolution's signal member is
// set up to throw an exception if the attribute still has
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TobyFitResolutionModelTest : public CxxTest::TestSuite
delete conv;
}

void xtest_Construction_With_Valid_Arguments_Creates_Object()
void test_Construction_With_Valid_Arguments_Creates_Object()
{
using namespace Mantid::MDAlgorithms;
ResolutionConvolvedCrossSection * conv = new ResolutionConvolvedCrossSection;
Expand All @@ -50,7 +50,7 @@ class TobyFitResolutionModelTest : public CxxTest::TestSuite
delete conv;
}

void xtest_uninitialized_object_has_no_attributes()
void test_uninitialized_object_has_no_attributes()
{
using namespace Mantid::MDAlgorithms;
TobyFitResolutionModel mdconvolution;
Expand All @@ -59,7 +59,7 @@ class TobyFitResolutionModelTest : public CxxTest::TestSuite

}

void xtest_initialized_object_has_correct_number_of_attributes()
void test_initialized_object_has_correct_number_of_attributes()
{
using namespace Mantid::MDAlgorithms;
TobyFitResolutionModel mdconvolution;
Expand All @@ -68,7 +68,7 @@ class TobyFitResolutionModelTest : public CxxTest::TestSuite
TS_ASSERT_EQUALS(mdconvolution.nAttributes(), 11);
}

void xtest_crossSection_Returns_Expected_Value_For_Specific_Parameters()
void test_crossSection_Returns_Expected_Value_For_Specific_Parameters()
{
using namespace Mantid::MDAlgorithms;
ResolutionConvolvedCrossSection * conv = new ResolutionConvolvedCrossSection;
Expand Down

0 comments on commit 91e84bf

Please sign in to comment.