Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ac9c9b9

Browse files
minor changes
1 parent 927c913 commit ac9c9b9

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ elseif(BUILD_UNIT_TESTS)
105105
find_package(GTest)
106106

107107
if(NOT GTEST_FOUND)
108-
message(WARNING " GTest missing!")
109-
endif(NOT GTEST_FOUND)
108+
message(WARNING " GTest missing! You may want to follow these instructions:")
109+
message(WARNING " https://gist.github.com/Cartexius/4c437c084d6e388288201aadf9c8cdd5")
110+
endif()
110111

111112
endif()
112113

include/behaviortree_cpp_v3/blackboard.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,12 @@ class Blackboard
183183

184184
const PortInfo *portInfo(const std::string& key);
185185

186-
void addSubtreeRemapping(std::string internal, std::string external);
186+
void addSubtreeRemapping(StringView internal, StringView external);
187187

188188
void debugMessage() const;
189189

190+
std::vector<StringView> getKeys() const;
191+
190192
private:
191193

192194
struct Entry{

src/blackboard.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ const PortInfo* Blackboard::portInfo(const std::string &key)
4242
return &(it->second.port_info);
4343
}
4444

45-
void Blackboard::addSubtreeRemapping(std::string internal, std::string external)
45+
void Blackboard::addSubtreeRemapping(StringView internal, StringView external)
4646
{
47-
internal_to_external_.insert( {std::move(internal), std::move(external)} );
47+
internal_to_external_.insert( {internal.to_string(), external.to_string()} );
4848
}
4949

5050
void Blackboard::debugMessage() const
@@ -72,4 +72,15 @@ void Blackboard::debugMessage() const
7272
}
7373
}
7474

75+
std::vector<StringView> Blackboard::getKeys() const
76+
{
77+
std::vector<StringView> out;
78+
out.reserve( storage_.size() );
79+
for(const auto& entry_it: storage_)
80+
{
81+
out.push_back( entry_it.first );
82+
}
83+
return out;
84+
}
85+
7586
}

0 commit comments

Comments
 (0)