Skip to content

Commit

Permalink
Refs #8590. Merge remote-tracking branch 'origin' into feature/8590_R…
Browse files Browse the repository at this point in the history
…efl_gui_Live_Data_fix
  • Loading branch information
keithnbrown committed Jan 14, 2014
2 parents eaa56fb + 087ebc5 commit 1e9ee52
Show file tree
Hide file tree
Showing 380 changed files with 17,371 additions and 10,900 deletions.
@@ -0,0 +1,105 @@
Name: mantid-developer
Version: 1.3
Release: 3%{?dist}
Summary: Meta Package to install dependencies for Mantid Development

Group: Development/Tools
License: GPL

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Requires: rpmfusion-nonfree-release
Requires: cmake-gui >= 2.8.5
Requires: boost-devel
Requires: gperftools-devel
Requires: gperftools-libs
Requires: gcc-c++
Requires: git-all
Requires: gsl-devel
Requires: hdf-devel
Requires: hdf5-devel
Requires: muParser-devel
Requires: mxml-devel
Requires: nexus >= 4.2
Requires: nexus-devel >= 4.2
Requires: numpy
Requires: OCE-devel
Requires: poco-devel
Requires: PyQt4-devel
Requires: python-devel
Requires: python-sphinx
Requires: qscintilla-devel
Requires: qt-devel >= 4.6
Requires: qwt5-qt4-devel
Requires: qwtplot3d-qt4-devel
Requires: redhat-lsb
Requires: rpmdevtools
Requires: sip-devel
Requires: git
Requires: openssl-devel
Requires: texlive-latex
Requires: dvipng
Requires: qt-devel
Requires: qt-assistant

BuildArch: noarch

%description
A virtual package which requires all the dependencies and tools that are
required for Mantid development.

%prep

%build

%install

%clean

%post
# Remove myself once I have installed all the required packages.
#rpm -e %{name}

%files

%changelog
* Fri Dec 20 2013 Stuart Campbell <campbellsi@ornl.gov>
- Added python-sphinx

* Thu Dec 19 2013 Stuart Campbell <campbellsi@ornl.gov>
- Changed to use OCE rather than OpenCASCADE.

* Tue Aug 20 2013 Peter Peterson <petersonpf@ornl.gov>
- Removed things not necessary for fedora 19.

* Tue May 07 2013 Stuart Campbell <campbellsi@ornl.gov>
- Added dvipng and latex for qt-assistant stuff
- Added software collection dependencies

* Thu Jun 7 2012 Russell Taylor <taylorrj@ornl.gov>
- Remove gmock & gtest now that we include them in our repo
- Remove subversion dependency now that we use git

* Mon Mar 19 2012 Stuart Campbell <campbellsi@ornl.gov>
- Updated for google-perftools -> gperftools package rename.

* Wed Feb 22 2012 Stuart Campbell <campbellsi@ornl.gov>
- Added nexus as it is not required by it's devel package.

* Wed Feb 22 2012 Stuart Campbell <campbellsi@ornl.gov>
- Added git as a dependency
- Added openssl-devel dependency

* Mon Feb 20 2012 Stuart Campbell <campbellsi@ornl.gov>
- Added dependency on NeXus development after nexus rpm split.
- Updated CMake dependency to 2.8.5 following 'the virus'!
- Added Google Mock and GTest.

* Fri Jun 3 2011 Stuart Campbell <campbellsi@ornl.gov>
- Added rpmdevtools and lsb dependencies

* Fri Jun 3 2011 Stuart Campbell <campbellsi@ornl.gov>
- Added versions for some packages

* Fri Jun 3 2011 Stuart Campbell <campbellsi@ornl.gov>
- Initial release
38 changes: 28 additions & 10 deletions Code/Mantid/Framework/API/inc/MantidAPI/FunctionFactory.h
Expand Up @@ -8,9 +8,11 @@
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/DynamicFactory.h"
#include "MantidKernel/SingletonHolder.h"
#include "MantidKernel/MultiThreaded.h"

#include <boost/shared_ptr.hpp>


namespace Mantid
{

Expand Down Expand Up @@ -76,7 +78,13 @@ namespace API

/// Query available functions based on the template type
template<typename FunctionType>
std::vector<std::string> getFunctionNames() const;
const std::vector<std::string>& getFunctionNames() const;

using Kernel::DynamicFactory<IFunction>::subscribe;
void subscribe(const std::string& className, AbstractFactory* pAbstractFactory,
Kernel::DynamicFactory<IFunction>::SubscribeAction replace=ErrorIfExists);

void unsubscribe(const std::string& className);

private:
friend struct Mantid::Kernel::CreateUsingNew<FunctionFactoryImpl>;
Expand Down Expand Up @@ -116,9 +124,11 @@ namespace API
/// Add a tie to the created function
void addTie(boost::shared_ptr<IFunction> fun,const Expression& expr)const;

///static reference to the logger class
/// Reference to the logger class
Kernel::Logger& g_log;

mutable std::map<std::string,std::vector<std::string>> m_cachedFunctionNames;
mutable Kernel::Mutex m_mutex;
};

/**
Expand All @@ -127,13 +137,20 @@ namespace API
* @returns A vector of the names of the functions matching the template type
*/
template<typename FunctionType>
std::vector<std::string> FunctionFactoryImpl::getFunctionNames() const
const std::vector<std::string>& FunctionFactoryImpl::getFunctionNames() const
{
Kernel::Mutex::ScopedLock _lock(m_mutex);

const std::string soughtType(typeid(FunctionType).name());
if ( m_cachedFunctionNames.find( soughtType ) != m_cachedFunctionNames.end() )
{
return m_cachedFunctionNames[soughtType];
}

// Create the entry in the cache and work with it directly
std::vector<std::string>& typeNames = m_cachedFunctionNames[soughtType];
const std::vector<std::string> names = this->getKeys();
std::vector<std::string> typeNames;
typeNames.reserve(names.size());
for( std::vector<std::string>::const_iterator it = names.begin();
it != names.end(); ++it )
for( auto it = names.begin(); it != names.end(); ++it )
{
boost::shared_ptr<IFunction> func = this->createFunction(*it);
if ( func && dynamic_cast<FunctionType*>(func.get()) )
Expand All @@ -143,12 +160,13 @@ namespace API
}
return typeNames;
}
///Forward declaration of a specialisation of SingletonHolder for AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it.

///Forward declaration of a specialisation of SingletonHolder for AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it.
#ifdef _WIN32
// this breaks new namespace declaraion rules; need to find a better fix
template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<FunctionFactoryImpl>;
template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<FunctionFactoryImpl>;
#endif /* _WIN32 */
typedef MANTID_API_DLL Mantid::Kernel::SingletonHolder<FunctionFactoryImpl> FunctionFactory;
typedef MANTID_API_DLL Mantid::Kernel::SingletonHolder<FunctionFactoryImpl> FunctionFactory;

/// Convenient typedef for an UpdateNotification
typedef FunctionFactoryImpl::UpdateNotification FunctionFactoryUpdateNotification;
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/FunctionProperty.h
Expand Up @@ -12,7 +12,6 @@

#include <boost/shared_ptr.hpp>

#include <iostream>
#include <string>

namespace Mantid
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/API/inc/MantidAPI/IMDHistoWorkspace.h
Expand Up @@ -45,9 +45,9 @@ namespace API

/// See the MDHistoWorkspace definition for descriptions of these
virtual coord_t getInverseVolume() const = 0;
virtual signal_t * getSignalArray() = 0;
virtual signal_t * getErrorSquaredArray() = 0;
virtual signal_t * getNumEventsArray() = 0;
virtual signal_t * getSignalArray() const = 0;
virtual signal_t * getErrorSquaredArray() const = 0;
virtual signal_t * getNumEventsArray() const = 0;
virtual void setTo(signal_t signal, signal_t errorSquared, signal_t numEvents) = 0;
virtual Mantid::Kernel::VMD getCenter(size_t linearIndex) const = 0;
virtual void setSignalAt(size_t index, signal_t value) = 0;
Expand Down
1 change: 1 addition & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/IMDNode.h
Expand Up @@ -177,6 +177,7 @@ class IMDNode
* @param length :: length of cylinder below which to integrate
* @param signal [out] :: set to the integrated signal
* @param errorSquared [out] :: set to the integrated squared error.
* @param signal_fit [out] :: array of values for the fit.
*/
virtual void integrateCylinder(Mantid::API::CoordTransform & radiusTransform, const coord_t radius, const coord_t length, signal_t & signal, signal_t & errorSquared, std::vector<signal_t> & signal_fit) const = 0;

Expand Down
3 changes: 3 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/ScopedWorkspace.h
Expand Up @@ -60,6 +60,9 @@ namespace API
/// Retrieve workspace from the ADS
Workspace_sptr retrieve() const;

/// Removes the workspace entry from the ADS
void remove();

/// Operator for conversion to boolean
operator bool() const;

Expand Down
Expand Up @@ -12,7 +12,6 @@
#include "MantidKernel/Exception.h"
#include "MantidAPI/WorkspaceGroup.h"

#include <iostream>
#include <string>

namespace Mantid
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/API/src/FileLoaderRegistry.cpp
Expand Up @@ -23,7 +23,7 @@ namespace Mantid
{
void apply(Kernel::FileDescriptor & descriptor) { descriptor.resetStreamToStart(); }
};
///endcond
/// @endcond

/**
* @param filename A string giving a filename
Expand Down Expand Up @@ -79,7 +79,7 @@ namespace Mantid
/**
* If the name does not exist then it does nothing
* @param name Name of the algorithm to remove from the search list
* @aparam version An optional version to remove. -1 indicates remove all (Default=-1)
* @param version An optional version to remove. -1 indicates remove all (Default=-1)
*/
void FileLoaderRegistryImpl::unsubscribe(const std::string &name, const int version)
{
Expand Down
17 changes: 10 additions & 7 deletions Code/Mantid/Framework/API/src/FileProperty.cpp
Expand Up @@ -42,7 +42,7 @@ FileProperty::FileProperty(const std::string & name, const std::string& default_
/* Create either a FileValidator or a DirectoryValidator, depending on Action */
(action == FileProperty::Directory || action == FileProperty::OptionalDirectory) ?
boost::make_shared<DirectoryValidator>(action == FileProperty::Directory) :
boost::make_shared<FileValidator>(exts, (action == FileProperty::Load) )
boost::make_shared<FileValidator>(exts, (action == FileProperty::Load), (action == FileProperty::Save) )
, direction),
m_action(action),
m_defaultExt(""),
Expand All @@ -69,7 +69,7 @@ FileProperty::FileProperty(const std::string & name, const std::string& default_
/* Create either a FileValidator or a DirectoryValidator, depending on Action */
(action == FileProperty::Directory || action == FileProperty::OptionalDirectory) ?
boost::make_shared<DirectoryValidator>(action == FileProperty::Directory) :
boost::make_shared<FileValidator>(std::vector<std::string>(1,ext), (action == FileProperty::Load) )
boost::make_shared<FileValidator>(std::vector<std::string>(1,ext), (action == FileProperty::Load), (action == FileProperty::Save) )
, direction),
m_action(action),
m_defaultExt(ext),
Expand Down Expand Up @@ -370,27 +370,30 @@ std::string FileProperty::createDirectory(const std::string & path) const
{
stempath.makeParent();
}
std::string error("");

if( !stempath.toString().empty() )
{
Poco::File stem(stempath);
if( !stem.exists() )
{
try
{
stem.createDirectories();
stem.createDirectories();
}
catch(Poco::Exception &e)
{
error = e.what();
std::stringstream msg;
msg << "Failed to create directory \"" << stempath.toString()
<< "\": " << e.what() ;
return msg.str();
}
}
}
else
{
error = "Invalid directory.";
return "Invalid directory.";
}
return error;
return ""; // everything went fine
}

/**
Expand Down
14 changes: 14 additions & 0 deletions Code/Mantid/Framework/API/src/FunctionFactory.cpp
Expand Up @@ -335,6 +335,20 @@ namespace Mantid
}
}

void FunctionFactoryImpl::subscribe(const std::string& className, AbstractFactory* pAbstractFactory,
Kernel::DynamicFactory<IFunction>::SubscribeAction replace)
{
// Clear the cache, then do all the work in the base class method
m_cachedFunctionNames.clear();
Kernel::DynamicFactory<IFunction>::subscribe(className,pAbstractFactory,replace);
}

void FunctionFactoryImpl::unsubscribe(const std::string& className)
{
// Clear the cache, then do all the work in the base class method
m_cachedFunctionNames.clear();
Kernel::DynamicFactory<IFunction>::unsubscribe(className);
}

} // namespace API
} // namespace Mantid

0 comments on commit 1e9ee52

Please sign in to comment.