File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
include/behaviortree_cpp/blackboard Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class BlackboardImpl
2525
2626 virtual const SafeAny::Any* get (const std::string& key) const = 0;
2727 virtual void set (const std::string& key, const SafeAny::Any& value) = 0;
28+ virtual bool contains (const std::string& key) const = 0;
2829};
2930
3031// This is the "frontend" to be used by the developer.
@@ -107,6 +108,11 @@ class Blackboard
107108 }
108109 }
109110
111+ bool contains (const std::string& key) const
112+ {
113+ return (impl_ && impl_->contains (key));
114+ }
115+
110116 private:
111117 std::unique_ptr<BlackboardImpl> impl_;
112118};
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ class BlackboardLocal : public BlackboardImpl
2727 storage_[key] = value;
2828 }
2929
30+ virtual bool contains (const std::string& key) const override
31+ {
32+ return storage_.find (key) != storage_.end ();
33+ }
34+
3035 private:
3136 std::unordered_map<std::string, SafeAny::Any> storage_;
3237};
You can’t perform that action at this time.
0 commit comments