module_param_cache.h
Go to the documentation of this file.
00001 /*
00002  * module_param_cache.h
00003  *
00004  *  Created on: 19 Jul 2012
00005  *      Author: andreas
00006  */
00007 
00008 #ifndef MODULE_PARAM_CACHE_H_
00009 #define MODULE_PARAM_CACHE_H_
00010 
00011 #include <string>
00012 #include <map>
00013 #include <ros/ros.h>
00014 #include <geometry_msgs/Pose.h>
00015 
00019 
00023 template <class ValueType>
00024 class ModuleParamCache
00025 {
00026 public:
00027     ModuleParamCache();
00028     ~ModuleParamCache();
00029 
00031     void clearAll();
00032 
00034     void initialize(const std::string& moduleNamespace, ros::NodeHandle* node);
00035 
00037 
00045     void set(const std::string& key, ValueType value, bool allowCacheAsParam);
00046 
00048 
00053     bool get(const std::string& key, ValueType& value);
00054 
00055 private:
00056     static std::string baseNamespace;
00057 
00059     ros::NodeHandle* node;
00060     std::string keyPrefix;
00061 
00062     std::map<std::string, ValueType> _localCache;  
00063 };
00064 
00066 std::string createPoseParamString(const geometry_msgs::Pose & ps, double precPose = 0.0001, double precQuat = 0.0001);
00067 
00068 #include "module_param_cache.hpp"
00069 
00070 typedef ModuleParamCache<double> ModuleParamCacheDouble;
00071 typedef ModuleParamCache<std::string> ModuleParamCacheString;
00072 
00073 #endif /* MODULE_PARAM_CACHE_H_ */
00074 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


planner_modules_pr2
Author(s): Christian Dornhege, Andreas Hertle
autogenerated on Wed Dec 26 2012 15:49:38