38template <>
DLLExport std::string IPropertyManager::getValue<std::string>(
const std::string &
name)
const {
39 return getPropertyValue(
name);
42template <>
DLLExport Property *IPropertyManager::getValue<Property *>(
const std::string &
name)
const {
43 return getPointerToProperty(
name);
48IPropertyManager *IPropertyManager::setProperty<std::string>(
const std::string &
name,
const std::string &
value) {
57bool IPropertyManager::existsProperty(
const std::string &
name)
const {
58 auto const &props = this->getProperties();
59 return std::any_of(props.cbegin(), props.cend(), [&
name](
const auto prop) { return name == prop->name(); });
67void IPropertyManager::updatePropertyValues(
const IPropertyManager &other) {
68 auto props = this->getProperties();
69 for (
auto &prop : props) {
70 const std::string propName = (*prop).name();
71 if (
other.existsProperty(propName)) {
72 (*prop).setValueFromProperty(*
other.getPointerToProperty(propName));
82void IPropertyManager::setPropertySettings(
const std::string &
name, std::unique_ptr<IPropertySettings const> settings) {
83 Property *prop = getPointerToProperty(
name);
85 prop->setSettings(std::move(settings));
92bool IPropertyManager::isPropertyEnabled(
const std::string &
name)
const {
93 Property *prop = getPointerToProperty(
name);
95 return std::all_of(prop->getSettings().begin(), prop->getSettings().end(),
96 [
this](
auto const &ptr) { return ptr->isEnabled(this); });
106bool IPropertyManager::isPropertyVisible(
const std::string &
name)
const {
107 Property *prop = getPointerToProperty(
name);
109 return std::all_of(prop->getSettings().begin(), prop->getSettings().end(),
110 [
this](
auto const &ptr) { return ptr->isVisible(this); });
117std::vector<Property *> IPropertyManager::getPropertiesInGroup(
const std::string &
group)
const {
118 auto props = getProperties();
119 for (
auto prop = props.begin(); prop != props.end();) {
120 if ((**prop).getGroup() ==
group) {
123 prop = props.erase(prop);
131IPropertyManager::TypedValue::operator int16_t() {
return pm.getValue<int16_t>(prop); }
132IPropertyManager::TypedValue::operator uint16_t() {
return pm.getValue<uint16_t>(prop); }
133IPropertyManager::TypedValue::operator int32_t() {
return pm.getValue<int32_t>(prop); }
134IPropertyManager::TypedValue::operator uint32_t() {
return pm.getValue<uint32_t>(prop); }
135IPropertyManager::TypedValue::operator int64_t() {
return pm.getValue<int64_t>(prop); }
136IPropertyManager::TypedValue::operator uint64_t() {
return pm.getValue<uint64_t>(prop); }
137IPropertyManager::TypedValue::operator bool() {
return pm.getValue<
bool>(prop); }
138IPropertyManager::TypedValue::operator double() {
return pm.getValue<
double>(prop); }
139IPropertyManager::TypedValue::operator std::string() {
return pm.getPropertyValue(prop); }
140IPropertyManager::TypedValue::operator OptionalBool() {
return pm.getValue<OptionalBool>(prop); }
141IPropertyManager::TypedValue::operator Property *() {
return pm.getPointerToProperty(prop); }
150IPropertyManager::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.