diff --git a/include/yat4tango/DeviceProxyHelper.h b/include/yat4tango/DeviceProxyHelper.h index ce55f15d0d8d65d18df735f1f3705a628a1c9a9f..880cc6c809b4eb2b4bf445c9fdf430029c351c5c 100644 --- a/include/yat4tango/DeviceProxyHelper.h +++ b/include/yat4tango/DeviceProxyHelper.h @@ -1608,6 +1608,32 @@ public: } } + //--------------------------------------------------------------------------- + // DeviceProxyHelper::get_property + //--------------------------------------------------------------------------- + template <typename C> + C get_property (const std::string& property_name, bool throw_exception_on_error = true) + { + try + { + try + { + Tango::DbData dev_prop; + dev_prop.push_back(Tango::DbDatum(property_name)); + tango_proxy()->get_property(dev_prop); + C prop_val; + dev_prop[0] >> prop_val; + return prop_val; + } + _HANDLE_TANGO_DEVICE_EXCEPTION("get_property", "yat4tango::DeviceProxyHelper::get_property"); + } + catch (...) + { + if ( throw_exception_on_error ) + throw; + } + } + //--------------------------------------------------------------------------- // AttributeHelper::restore_properties_snapshot //---------------------------------------------------------------------------