18 const std::vector<rpc::ActorDefinition> &blueprints) {
20 for (
auto &definition : blueprints) {
27 const std::string &wildcard_pattern)
const {
29 for (
auto &pair : _blueprints) {
30 if (pair.second.MatchTags(wildcard_pattern)) {
39 const std::string &name,
const std::string& value)
const {
42 for (
auto &pair : _blueprints) {
43 if (!pair.second.ContainsAttribute(name))
49 const std::string &AttributeValue = Attribute.
GetValue();
50 if (value == AttributeValue)
55 for (
const std::string &Value : Values)
71 auto it = _blueprints.find(key);
72 return it != _blueprints.
end() ? &it->second :
nullptr;
78 auto it = _blueprints.find(key);
79 if (it == _blueprints.end()) {
80 using namespace std::string_literals;
81 throw_exception(std::out_of_range(
"blueprint '"s + key +
"' not found"));
92 return operator[](pos);
An attribute of an ActorBlueprint.
virtual const std::string & GetValue() const override
const std::vector< std::string > & GetRecommendedValues() const
const_iterator end() const
std::unordered_map< std::string, ActorBlueprint > map_type
const value_type * const_pointer
const value_type & const_reference
BlueprintLibrary(const std::vector< rpc::ActorDefinition > &blueprints)
map_type::size_type size_type
void throw_exception(const std::exception &e)
boost::shared_ptr< T > SharedPtr
使用这个SharedPtr(boost::shared_ptr)以保持与boost::python的兼容性, 但未来如果可能的话,我们希望能为std::shared_ptr制作一个Python适配器。