blackboard_local.h
Go to the documentation of this file.
00001 #ifndef BLACKBOARD_LOCAL_H
00002 #define BLACKBOARD_LOCAL_H
00003 
00004 #include "blackboard.h"
00005 
00006 namespace BT
00007 {
00008 class BlackboardLocal : public BlackboardImpl
00009 {
00010   public:
00011     BlackboardLocal()
00012     {
00013     }
00014 
00015     virtual const SafeAny::Any* get(const std::string& key) const override
00016     {
00017         auto it = storage_.find(key);
00018         if (it == storage_.end())
00019         {
00020             return nullptr;
00021         }
00022         return &(it->second);
00023     }
00024 
00025     virtual void set(const std::string& key, const SafeAny::Any& value) override
00026     {
00027         storage_[key] = value;
00028     }
00029 
00030     virtual bool contains(const std::string& key) const override
00031     {
00032         return storage_.find(key) != storage_.end();
00033     }
00034 
00035   private:
00036     std::unordered_map<std::string, SafeAny::Any> storage_;
00037 };
00038 }
00039 
00040 #endif   // BLACKBOARD_LOCAL_H


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Feb 2 2019 03:50:09