blackboard_local.h
Go to the documentation of this file.
1 #ifndef BLACKBOARD_LOCAL_H
2 #define BLACKBOARD_LOCAL_H
3 
4 #include "blackboard.h"
5 
6 namespace BT
7 {
9 {
10  public:
12  {
13  }
14 
15  virtual const SafeAny::Any* get(const std::string& key) const override
16  {
17  auto it = storage_.find(key);
18  if (it == storage_.end())
19  {
20  return nullptr;
21  }
22  return &(it->second);
23  }
24 
25  virtual void set(const std::string& key, const SafeAny::Any& value) override
26  {
27  storage_[key] = value;
28  }
29 
30  virtual bool contains(const std::string& key) const override
31  {
32  return storage_.find(key) != storage_.end();
33  }
34 
35  private:
36  std::unordered_map<std::string, SafeAny::Any> storage_;
37 };
38 }
39 
40 #endif // BLACKBOARD_LOCAL_H
virtual bool contains(const std::string &key) const override
std::unordered_map< std::string, SafeAny::Any > storage_


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Feb 2 2019 04:01:53