[ismrmrd] 278/281: add const on some MetaContainer functions

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag ismrmrd0.5
in repository ismrmrd.

commit 80819d9518019cc4e19e12ef8ef830518ada5295
Author: Hui Xue <hui.xue at nih.gov>
Date:   Thu Sep 4 10:21:09 2014 -0400

    add const on some MetaContainer functions
---
 xml/CMakeLists.txt |  2 +-
 xml/ismrmrd_meta.h | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xml/CMakeLists.txt b/xml/CMakeLists.txt
index 40c9c0c..8ef9350 100644
--- a/xml/CMakeLists.txt
+++ b/xml/CMakeLists.txt
@@ -21,7 +21,7 @@ target_link_libraries(test_ismrmrd_xml
 target_link_libraries(test_meta
   ismrmrd_xml)
 
-install (FILES ismrmrd_xml.h ismrmrd_xml_export.h
+install (FILES ismrmrd_xml.h ismrmrd_xml_export.h ismrmrd_meta.h 
   DESTINATION ${ISMRMRD_INSTALL_INCLUDE_DIR})
 
 install (TARGETS ismrmrd_xml DESTINATION ${ISMRMRD_INSTALL_LIB_DIR})
diff --git a/xml/ismrmrd_meta.h b/xml/ismrmrd_meta.h
index 0a6c4de..5db377e 100644
--- a/xml/ismrmrd_meta.h
+++ b/xml/ismrmrd_meta.h
@@ -192,9 +192,9 @@ namespace ISMRMRD
     }
 
     ///Return number of values of a particular parameter
-    size_t length(const char* name)
+    size_t length(const char* name) const
     {
-      map_t::iterator it = map_.find(std::string(name));
+      map_t::const_iterator it = map_.find(std::string(name));
       if (it != map_.end()) {
 	return it->second.size();
       }
@@ -202,26 +202,26 @@ namespace ISMRMRD
     }
 
     ///Return value number @index of the parameter @name as long
-    long as_long(const char* name, size_t index = 0)
+    long as_long(const char* name, size_t index = 0) const
     {
       return value(name,index).as_long();
     }
 
     ///Return value number @index of the parameter @name as double
-    double as_double(const char* name, size_t index = 0)
+    double as_double(const char* name, size_t index = 0) const
     {
       return value(name,index).as_double();
     }
     
     ///Return value number @index of the parameter @name as string
-    const char* as_str(const char* name, size_t index = 0)
+    const char* as_str(const char* name, size_t index = 0) const
     {
       return value(name,index).as_str();
     }
 
-    const MetaValue& value(const char* name, size_t index = 0)
+    const MetaValue& value(const char* name, size_t index = 0) const
     {
-      map_t::iterator it = map_.find(std::string(name));
+      map_t::const_iterator it = map_.find(std::string(name));
       if (it == map_.end()) {
 	throw std::runtime_error("Attempting to access unkown parameter");
       }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ismrmrd.git



More information about the debian-science-commits mailing list