| 
									
										
										
										
											2009-12-11 07:45:38 +08:00
										 |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-10 03:55:25 +08:00
										 |  |  | #include <map>
 | 
					
						
							|  |  |  | #include "Pose2.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace gtsam { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Pose2Config: public std::map<std::string, Pose2> { | 
					
						
							| 
									
										
										
										
											2009-12-10 12:12:41 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-10 03:55:25 +08:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2009-12-10 12:12:41 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	Pose2Config() {} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-10 03:55:25 +08:00
										 |  |  | 	Pose2 get(std::string key) const { | 
					
						
							|  |  |  | 		std::map<std::string, Pose2>::const_iterator it = find(key); | 
					
						
							|  |  |  | 		if (it == end()) | 
					
						
							|  |  |  | 			throw std::invalid_argument("invalid key"); | 
					
						
							|  |  |  | 		return it->second; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2009-12-11 07:45:38 +08:00
										 |  |  | 	void insert(const std::string& name, const Pose2& val){ | 
					
						
							|  |  |  | 		std::map<std::string, Pose2>::insert(make_pair(name, val)); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2009-12-10 03:55:25 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | } // namespace
 |