36template <>
DLLExport std::string IPropertyManager::getValue<std::string>(
const std::string &
name)
const {
37 return getPropertyValue(
name);
40template <>
DLLExport Property *IPropertyManager::getValue<Property *>(
const std::string &
name)
const {
41 return getPointerToProperty(
name);
46IPropertyManager *IPropertyManager::setProperty<std::string>(
const std::string &
name,
const std::string &
value) {
55bool IPropertyManager::existsProperty(
const std::string &
name)
const {
56 auto const &props = this->getProperties();
57 return std::any_of(props.cbegin(), props.cend(), [&
name](
const auto prop) { return name == prop->name(); });
65void IPropertyManager::updatePropertyValues(
const IPropertyManager &other) {
66 auto props = this->getProperties();
67 for (
auto &prop : props) {
68 const std::string propName = (*prop).name();
69 if (
other.existsProperty(propName)) {
70 (*prop).setValueFromProperty(*
other.getPointerToProperty(propName));
80void IPropertyManager::setPropertySettings(
const std::string &
name, std::unique_ptr<IPropertySettings> settings) {
81 Property *prop = getPointerToProperty(
name);
83 prop->setSettings(std::move(settings));
90std::vector<Property *> IPropertyManager::getPropertiesInGroup(
const std::string &
group)
const {
91 auto props = getProperties();
92 for (
auto prop = props.begin(); prop != props.end();) {
93 if ((**prop).getGroup() ==
group) {
96 prop = props.erase(prop);
104IPropertyManager::TypedValue::operator int16_t() {
return pm.getValue<int16_t>(prop); }
105IPropertyManager::TypedValue::operator uint16_t() {
return pm.getValue<uint16_t>(prop); }
106IPropertyManager::TypedValue::operator int32_t() {
return pm.getValue<int32_t>(prop); }
107IPropertyManager::TypedValue::operator uint32_t() {
return pm.getValue<uint32_t>(prop); }
108IPropertyManager::TypedValue::operator int64_t() {
return pm.getValue<int64_t>(prop); }
109IPropertyManager::TypedValue::operator uint64_t() {
return pm.getValue<uint64_t>(prop); }
110IPropertyManager::TypedValue::operator bool() {
return pm.getValue<
bool>(prop); }
111IPropertyManager::TypedValue::operator double() {
return pm.getValue<
double>(prop); }
112IPropertyManager::TypedValue::operator std::string() {
return pm.getPropertyValue(prop); }
113IPropertyManager::TypedValue::operator OptionalBool() {
return pm.getValue<OptionalBool>(prop); }
114IPropertyManager::TypedValue::operator Property *() {
return pm.getPointerToProperty(prop); }
123IPropertyManager::TypedValue::operator
unsigned long() {
return pm.getValue<
unsigned long>(prop); }
double value
The value of the point.
#define DEFINE_IPROPERTYMANAGER_GETVALUE(type)
A macro for defining getValue functions for new types.
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Helper class which provides the Collimation Length for SANS instruments.