From f39c856a8150fd8e313034f0d5a4e5f2d3ecdc83 Mon Sep 17 00:00:00 2001 From: William Dieter Date: Tue, 17 Feb 2015 00:34:52 -0500 Subject: [PATCH] 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 --- resource/include/OCRepresentation.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 { -- 2.7.4