From: William Dieter Date: Tue, 17 Feb 2015 05:34:52 +0000 (-0500) Subject: Added documentation for OCRepresentation::getValue X-Git-Tag: 1.2.0+RC1~1927 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f39c856a8150fd8e313034f0d5a4e5f2d3ecdc83;p=platform%2Fupstream%2Fiotivity.git Added documentation for OCRepresentation::getValue Change-Id: I832fa198bfc3e3fe633531c3bf67d0c1421b47da Signed-off-by: William Dieter Reviewed-on: https://gerrit.iotivity.org/gerrit/353 Tested-by: jenkins-iotivity Reviewed-by: Erich Keane Reviewed-by: Sudarshan Prasad --- diff --git a/resource/include/OCRepresentation.h b/resource/include/OCRepresentation.h index 98c0914..47c9c47 100644 --- a/resource/include/OCRepresentation.h +++ b/resource/include/OCRepresentation.h @@ -151,6 +151,14 @@ namespace OC m_values[str] = val; } + /** + * Retrieve the attribute value associated with the supplied name + * + * @param str Name of the attribute + * @param val Value of the attribute + * @return The getValue method returns true if the attribute was + * found in the representation. Otherwise it returns false. + */ template bool getValue(const std::string& str, T& val) const { @@ -168,6 +176,14 @@ namespace OC } } + /** + * Return the attribute value associated with the supplied name + * + * @param str Name of the attribute + * @return When the representation contains the attribute, the + * the associated value is returned. Otherwise, getValue + * returns the default contructed value for the type. + */ template T getValue(const std::string& str) const {