Mantid
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
IPropertyManager.h File Reference
#include "MantidKernel/DllConfig.h"
#include "MantidKernel/IValidator.h"
#include "MantidKernel/NullValidator.h"
#include "MantidKernel/PropertyWithValue.h"
#include <memory>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <unordered_set>
#include <vector>

Go to the source code of this file.

Classes

class  Mantid::Kernel::IPropertyManager
 Interface to PropertyManager. More...
 
struct  Mantid::Kernel::IPropertyManager::TypedValue
 Utility class that enables the getProperty() method to effectively be templated on the return type. More...
 

Namespaces

namespace  Json
 
namespace  Mantid
 Helper class which provides the Collimation Length for SANS instruments.
 
namespace  Mantid::Kernel
 
namespace  Mantid::Types
 
namespace  Mantid::Types::Core
 

Macros

#define DEFINE_IPROPERTYMANAGER_GETVALUE(type)
 A macro for defining getValue functions for new types. More...
 

Macro Definition Documentation

◆ DEFINE_IPROPERTYMANAGER_GETVALUE

#define DEFINE_IPROPERTYMANAGER_GETVALUE (   type)
Value:
namespace Mantid { \
namespace Kernel { \
template <> DLLExport type IPropertyManager::getValue<type>(const std::string &name) const { \
PropertyWithValue<type> *prop = dynamic_cast<PropertyWithValue<type> *>(getPointerToProperty(name)); \
if (prop) { \
return *prop; \
} else { \
std::string message = "Attempt to assign property " + name + " to incorrect type. Expected type " #type; \
throw std::runtime_error(message); \
} \
} \
} \
}
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition: System.h:53
virtual Property * getPointerToProperty(const std::string &name) const =0
Get a pointer to property by name.
Helper class which provides the Collimation Length for SANS instruments.

A macro for defining getValue functions for new types.

Puts them in the Mantid::Kernel namespace so the macro should be used outside of any namespace scope

Definition at line 523 of file IPropertyManager.h.