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) {
47 this->setPropertyValue(name,
value);
55bool IPropertyManager::existsProperty(
const std::string &name)
const {
56 auto props = this->getProperties();
57 for (std::vector<Property *>::const_iterator prop = props.begin(); prop != props.end(); ++prop) {
58 if (name == (*prop)->name())
69void IPropertyManager::updatePropertyValues(
const IPropertyManager &other) {
70 auto props = this->getProperties();
71 for (
auto &prop : props) {
72 const std::string propName = (*prop).name();
73 if (
other.existsProperty(propName)) {
74 (*prop).setValueFromProperty(*
other.getPointerToProperty(propName));
84void IPropertyManager::setPropertySettings(
const std::string &name, std::unique_ptr<IPropertySettings> settings) {
85 Property *prop = getPointerToProperty(name);
87 prop->setSettings(std::move(settings));
94std::vector<Property *> IPropertyManager::getPropertiesInGroup(
const std::string &group)
const {
95 auto props = getProperties();
96 for (
auto prop = props.begin(); prop != props.end();) {
97 if ((**prop).getGroup() == group) {
100 prop = props.erase(prop);
108IPropertyManager::TypedValue::operator int16_t() {
return pm.getValue<int16_t>(prop); }
109IPropertyManager::TypedValue::operator uint16_t() {
return pm.getValue<uint16_t>(prop); }
110IPropertyManager::TypedValue::operator int32_t() {
return pm.getValue<int32_t>(prop); }
111IPropertyManager::TypedValue::operator uint32_t() {
return pm.getValue<uint32_t>(prop); }
112IPropertyManager::TypedValue::operator int64_t() {
return pm.getValue<int64_t>(prop); }
113IPropertyManager::TypedValue::operator uint64_t() {
return pm.getValue<uint64_t>(prop); }
114IPropertyManager::TypedValue::operator bool() {
return pm.getValue<
bool>(prop); }
115IPropertyManager::TypedValue::operator double() {
return pm.getValue<
double>(prop); }
116IPropertyManager::TypedValue::operator std::string() {
return pm.getPropertyValue(prop); }
117IPropertyManager::TypedValue::operator OptionalBool() {
return pm.getValue<OptionalBool>(prop); }
118IPropertyManager::TypedValue::operator Property *() {
return pm.getPointerToProperty(prop); }
127IPropertyManager::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.