//! \brief Request a handle to a property using an xml attribute //! containing the properties name. //! //! See getProperty(const std::string& name) for usage info. inline Value getProperty(const magnet::xml::Attribute& name, const Property::Units& units) { try { return getPropertyBase(name.getValue(), units); } catch (boost::bad_lexical_cast&) { M_throw() << "Could not find the property named by " << name.getPath(); } }
/*! \brief Request a handle to a property using a string containing the properties name. If the name is a string representation of a numeric type, the look-up in the property store will fail but a one-time NumericProperty is created. You may then have lines in the configuration file like so For a fixed value <Interaction Elasticity="0.9" ... or for a lookup in the property store <Interaction Elasticity="e" ... For a lookup of the particle property "e" \param name An Attribute containing either the name or the value of a property. \return A reference to the property requested or an instance of NumericProperty. */ inline Value getProperty(const std::string& name, const Property::Units& units) { try { return getPropertyBase(name, units); } catch (boost::bad_lexical_cast&) { M_throw() << "Could not find the property named by " << name; } }
/*! \brief Request a handle to a property using an xml attribute containing the properties name. See getProperty(const std::string& name) for usage info. */ inline Value getProperty(const magnet::xml::Attribute& name, const Property::Units& units) { return getPropertyBase(name.getValue(), units); }
/*! \brief Request a handle to a property using a string containing the properties name. If the name is a string representation of a numeric type, the look-up in the property store will fail but a one-time NumericProperty is created. You may then have lines in the configuration file like so For a fixed value <Interaction Elasticity="0.9" ... or for a lookup in the property store <Interaction Elasticity="e" ... For a lookup of the particle property "e" \param name An Attribute containing either the name or the value of a property. \return A reference to the property requested or an instance of NumericProperty. */ inline Value getProperty(const std::string& name, const Property::Units& units) { return getPropertyBase(name, units); }