Skip to content

Commit

Permalink
Rename RegisterDataItemInterface to DataItemInterface.
Browse files Browse the repository at this point in the history
Refs #8996
  • Loading branch information
martyngigg committed Feb 17, 2014
1 parent 096a518 commit 52351ae
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 32 deletions.
@@ -1,5 +1,5 @@
#ifndef MANTID_PYTHONINTERFACE_REGISTERDATEITEMINTERFACE_H_
#define MANTID_PYTHONINTERFACE_REGISTERDATEITEMINTERFACE_H_
#ifndef MANTID_PYTHONINTERFACE_DATEITEMINTERFACE_H_
#define MANTID_PYTHONINTERFACE_DATEITEMINTERFACE_H_
/**
Copyright © 2014 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
Expand Down Expand Up @@ -42,12 +42,12 @@ namespace Mantid { namespace PythonInterface
* insert method.
*/
template<typename IType>
struct DLLExport RegisterDataItemInterface
struct DLLExport DataItemInterface
{
typedef boost::shared_ptr<IType> IType_sptr;
typedef boost::weak_ptr<IType> IType_wptr;
/// Constructor
RegisterDataItemInterface()
DataItemInterface()
{
using namespace boost::python;
using namespace Registry;
Expand All @@ -58,7 +58,7 @@ namespace Mantid { namespace PythonInterface
TypeRegistry::subscribe< TypedPropertyValueHandler<IType_sptr> >();
}
/// Register a downcast for this ID
RegisterDataItemInterface & castFromID(const std::string &id)
DataItemInterface & castFromID(const std::string &id)
{
using namespace Registry;
DowncastRegistry::subscribe<IType>(id);
Expand All @@ -69,4 +69,4 @@ namespace Mantid { namespace PythonInterface
}
}}

#endif /* MANTID_PYTHONINTERFACE_REGISTERDATEITEMINTERFACE_H_ */
#endif /* MANTID_PYTHONINTERFACE_DATEITEMINTERFACE_H_ */
@@ -1,12 +1,12 @@
#include "MantidAPI/IEventWorkspace.h"
#include "MantidAPI/IEventList.h"
#include "MantidPythonInterface/kernel/Registry/RegisterDataItemInterface.h"
#include "MantidPythonInterface/kernel/Registry/DataItemInterface.h"

#include <boost/python/class.hpp>
#include <boost/python/object.hpp>

using namespace Mantid::API;
using Mantid::PythonInterface::Registry::RegisterDataItemInterface;
using Mantid::PythonInterface::Registry::DataItemInterface;
using namespace boost::python;

/**
Expand All @@ -26,7 +26,7 @@ void export_IEventWorkspace()
.def("clearMRU", &IEventWorkspace::clearMRU, args("self"), "Clear the most-recently-used lists")
;

RegisterDataItemInterface<IEventWorkspace>()
DataItemInterface<IEventWorkspace>()
// map IDs to this interface
.castFromID("EventWorkspace")
;
Expand Down
@@ -1,11 +1,11 @@
#include "MantidAPI/IMDEventWorkspace.h"

#include "MantidPythonInterface/kernel/Registry/RegisterDataItemInterface.h"
#include "MantidPythonInterface/kernel/Registry/DataItemInterface.h"
#include <boost/python/class.hpp>
#include <boost/python/register_ptr_to_python.hpp>

using namespace Mantid::API;
using Mantid::PythonInterface::Registry::RegisterDataItemInterface;
using Mantid::PythonInterface::Registry::DataItemInterface;
using namespace boost::python;

namespace
Expand All @@ -31,7 +31,7 @@ void export_IMDEventWorkspace()
;

//-----------------------------------------------------------------------------------------------
RegisterDataItemInterface<IMDEventWorkspace> entry;
DataItemInterface<IMDEventWorkspace> entry;
// The IDs for the MDEventWorkpaces are constructed from the event types and number of dimensions
const char *eventTypes[NUM_EVENT_TYPES]= { "MDEvent", "MDLeanEvent" };

Expand Down
@@ -1,14 +1,14 @@
#include "MantidAPI/IMDHistoWorkspace.h"
#include "MantidPythonInterface/kernel/Converters/CArrayToNDArray.h"
#include "MantidPythonInterface/kernel/Registry/RegisterDataItemInterface.h"
#include "MantidPythonInterface/kernel/Registry/DataItemInterface.h"

#include <boost/python/class.hpp>
#include <boost/python/copy_non_const_reference.hpp>
#include <boost/python/numeric.hpp>


using namespace Mantid::API;
using Mantid::PythonInterface::Registry::RegisterDataItemInterface;
using Mantid::PythonInterface::Registry::DataItemInterface;
namespace Converters = Mantid::PythonInterface::Converters;
using namespace boost::python;

Expand Down Expand Up @@ -189,7 +189,7 @@ void export_IMDHistoWorkspace()

//-------------------------------------------------------------------------------------------------

RegisterDataItemInterface<IMDHistoWorkspace>()
DataItemInterface<IMDHistoWorkspace>()
.castFromID("MDHistoWorkspace")
;
}
Expand Down
@@ -1,12 +1,12 @@
#include "MantidAPI/IMDWorkspace.h"
#include "MantidPythonInterface/kernel/Registry/RegisterDataItemInterface.h"
#include "MantidPythonInterface/kernel/Registry/DataItemInterface.h"

#include <boost/python/class.hpp>
#include <boost/python/enum.hpp>
#include <boost/python/self.hpp>

using namespace Mantid::API;
using Mantid::PythonInterface::Registry::RegisterDataItemInterface;
using Mantid::PythonInterface::Registry::DataItemInterface;
using namespace boost::python;

void export_IMDWorkspace()
Expand All @@ -22,6 +22,6 @@ void export_IMDWorkspace()
.def("getNEvents", &IMDWorkspace::getNEvents, args("self"), "Returns the total number of events, contributed to the workspace")
;

RegisterDataItemInterface<IMDWorkspace>();
DataItemInterface<IMDWorkspace>();
}

@@ -1,11 +1,11 @@
#include "MantidAPI/IPeaksWorkspace.h"
#include "MantidAPI/IPeak.h"
#include "MantidPythonInterface/kernel/Registry/RegisterDataItemInterface.h"
#include "MantidPythonInterface/kernel/Registry/DataItemInterface.h"
#include <boost/python/class.hpp>
#include <boost/python/return_internal_reference.hpp>

using namespace Mantid::API;
using Mantid::PythonInterface::Registry::RegisterDataItemInterface;
using Mantid::PythonInterface::Registry::DataItemInterface;
using namespace boost::python;

void export_IPeaksWorkspace()
Expand All @@ -25,7 +25,7 @@ void export_IPeaksWorkspace()

//-------------------------------------------------------------------------------------------------

RegisterDataItemInterface<IPeaksWorkspace>()
DataItemInterface<IPeaksWorkspace>()
.castFromID("PeaksWorkspace")
;
}
Expand Down
Expand Up @@ -5,7 +5,7 @@
#include "MantidPythonInterface/kernel/Converters/NDArrayToVector.h"
#include "MantidPythonInterface/kernel/Converters/PySequenceToVector.h"
#include "MantidPythonInterface/kernel/Converters/CloneToNumpy.h"
#include "MantidPythonInterface/kernel/Registry/RegisterDataItemInterface.h"
#include "MantidPythonInterface/kernel/Registry/DataItemInterface.h"

#include <boost/python/class.hpp>
#include <boost/python/list.hpp>
Expand All @@ -21,7 +21,7 @@
#include <numpy/arrayobject.h>

using namespace Mantid::API;
using Mantid::PythonInterface::Registry::RegisterDataItemInterface;
using Mantid::PythonInterface::Registry::DataItemInterface;
using namespace boost::python;

namespace
Expand Down Expand Up @@ -390,7 +390,7 @@ void export_ITableWorkspace()

//-------------------------------------------------------------------------------------------------

RegisterDataItemInterface<ITableWorkspace>()
DataItemInterface<ITableWorkspace>()
.castFromID("TableWorkspace")
;
}
Expand Down
Expand Up @@ -5,7 +5,7 @@
#include "MantidPythonInterface/kernel/Converters/WrapWithNumpy.h"
#include "MantidPythonInterface/kernel/Policies/RemoveConst.h"
#include "MantidPythonInterface/kernel/Policies/VectorToNumpy.h"
#include "MantidPythonInterface/kernel/Registry/RegisterDataItemInterface.h"
#include "MantidPythonInterface/kernel/Registry/DataItemInterface.h"

#include <boost/python/class.hpp>
#include <boost/python/overloads.hpp>
Expand Down Expand Up @@ -246,7 +246,7 @@ void export_MatrixWorkspace()
"RebinnedOutput", "SpecialWorkspace2D", "Workspace2D", "WorkspaceSingleValue"
};

Registry::RegisterDataItemInterface<MatrixWorkspace> entry;
Registry::DataItemInterface<MatrixWorkspace> entry;
for(int i = 0; i < NUM_IDS; ++i)
{
entry.castFromID(WORKSPACE_IDS[i]);
Expand Down
@@ -1,13 +1,13 @@
#include "MantidAPI/Workspace.h"
#include "MantidPythonInterface/kernel/Registry/RegisterDataItemInterface.h"
#include "MantidPythonInterface/kernel/Registry/DataItemInterface.h"

#include <boost/python/class.hpp>
#include <boost/python/overloads.hpp>
#include <boost/python/copy_const_reference.hpp>

using namespace Mantid::API;
using Mantid::Kernel::DataItem;
using Mantid::PythonInterface::Registry::RegisterDataItemInterface;
using Mantid::PythonInterface::Registry::DataItemInterface;
using namespace boost::python;

namespace
Expand All @@ -33,5 +33,5 @@ void export_Workspace()

//-------------------------------------------------------------------------------------------------

RegisterDataItemInterface<Workspace>();
DataItemInterface<Workspace>();
}
@@ -1,12 +1,12 @@
#include "MantidAPI/WorkspaceGroup.h"
#include "MantidPythonInterface/kernel/Policies/DowncastingPolicies.h"
#include "MantidPythonInterface/kernel/Registry/RegisterDataItemInterface.h"
#include "MantidPythonInterface/kernel/Registry/DataItemInterface.h"

#include <boost/python/class.hpp>
#include <boost/python/return_value_policy.hpp>

using namespace Mantid::API;
using Mantid::PythonInterface::Registry::RegisterDataItemInterface;
using Mantid::PythonInterface::Registry::DataItemInterface;
using namespace boost::python;
namespace Policies = Mantid::PythonInterface::Policies;

Expand All @@ -31,7 +31,7 @@ void export_WorkspaceGroup()

//-----------------------------------------------------------------------------------------------

RegisterDataItemInterface<WorkspaceGroup>()
DataItemInterface<WorkspaceGroup>()
.castFromID("WorkspaceGroup")
;
}
Expand Down

0 comments on commit 52351ae

Please sign in to comment.