18 const std::vector<rpc::ActorDefinition> &blueprints) {
20 for (
auto &definition : blueprints) {
26 const std::string &wildcard_pattern)
const {
28 for (
auto &pair : _blueprints) {
29 if (pair.second.MatchTags(wildcard_pattern)) {
37 const std::string &name,
const std::string& value)
const {
40 for (
auto &pair : _blueprints) {
41 if (!pair.second.ContainsAttribute(name))
47 const std::string &AttributeValue = Attribute.
GetValue();
48 if (value == AttributeValue)
53 for (
const std::string &Value : Values)
68 auto it = _blueprints.find(key);
69 return it != _blueprints.
end() ? &it->second :
nullptr;
73 auto it = _blueprints.find(key);
74 if (it == _blueprints.end()) {
75 using namespace std::string_literals;
76 throw_exception(std::out_of_range(
"blueprint '"s + key +
"' not found"));
85 return operator[](pos);
An attribute of an ActorBlueprint.
virtual const std::string & GetValue() const override
const std::vector< std::string > & GetRecommendedValues() const
Contains all the necessary information for spawning an Actor.
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
This file contains definitions of common data structures used in traffic manager.
void throw_exception(const std::exception &e)
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...