22 #ifndef FAWKES_SRC_PLUGINS_ROBOT_MEMORY_COMPUTABLES_COMPUTABLES_MANAGER_H_
23 #define FAWKES_SRC_PLUGINS_ROBOT_MEMORY_COMPUTABLES_COMPUTABLES_MANAGER_H_
25 #include "computable.h"
27 #include <aspect/clock.h>
28 #include <aspect/configurable.h>
29 #include <aspect/logging.h>
31 #include <boost/bind.hpp>
33 #include <mongocxx/client.hpp>
41 #ifdef USE_TIMETRACKER
52 bool check_and_compute(
const bsoncxx::document::view &query, std::string collection);
69 const std::string & collection,
70 std::list<bsoncxx::document::value> (
71 T::*compute_func)(
const bsoncxx::document::view &,
const std::string &),
73 double caching_time = 0.0,
77 query_to_compute, collection, boost::bind(compute_func, obj, _1, _2), caching_time, priority);
79 std::list<Computable *>::iterator pos = computables.begin();
80 while (pos != computables.end() && priority < (*pos)->get_priority())
82 computables.insert(pos, comp);
90 std::string name =
"RobotMemory ComputablesManager";
94 std::list<Computable *> computables;
95 std::string matching_test_collection_;
97 std::map<std::tuple<std::string, std::string>,
long long> cached_querries_;
98 #ifdef USE_TIMETRACKER
100 unsigned int tt_loopcount_;
101 unsigned int ttc_cleanup_;
102 unsigned int ttc_cleanup_inner_loop_;
103 unsigned int ttc_cleanup_remove_query_;