From fe8870a5f06852d81e260deac6e7bd6e740e85b3 Mon Sep 17 00:00:00 2001 From: Manohar Paluri Date: Fri, 28 Aug 2009 15:38:27 +0000 Subject: [PATCH] changed functions begin, end and get_names to const --- cpp/FGConfig.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cpp/FGConfig.h b/cpp/FGConfig.h index 4e70209b2..221f76309 100644 --- a/cpp/FGConfig.h +++ b/cpp/FGConfig.h @@ -28,14 +28,14 @@ namespace gtsam { typedef std::map::const_iterator const_iterator; FGConfig() {}; - FGConfig(const FGConfig& cfg_in) : values(cfg_in.values){}; + FGConfig(const FGConfig& cfg_in) : values(cfg_in.values){}; virtual ~FGConfig() {}; /** return all the nodes in the graph **/ - std::vector get_names() { + std::vector get_names() const { std::vector names; - for(iterator it=values.begin(); it!=values.end(); it++) + for(const_iterator it=values.begin(); it!=values.end(); it++) names.push_back(it->first); return names; } @@ -52,8 +52,8 @@ namespace gtsam { virtual void operator+=(const FGConfig & delta); virtual FGConfig operator+(const FGConfig & delta) const; - iterator begin() {return values.begin();} - iterator end() {return values.end();} + const_iterator begin() {return values.begin();} + const_iterator end() {return values.end();} /** get a vector in the configuration by name */ Vector get(const std::string& name) const;