Contains all the necessary information for spawning an Actor. More...
#include <ActorBlueprint.h>
Public Member Functions | |
Constructor | |
ActorBlueprint (rpc::ActorDefinition actor_definition) | |
Id | |
const std::string & | GetId () const |
Tags | |
bool | ContainsTag (const std::string &tag) const |
bool | MatchTags (const std::string &wildcard_pattern) const |
Test if any of the flags matches wildcard_pattern. More... | |
std::vector< std::string > | GetTags () const |
Attributes | |
bool | ContainsAttribute (const std::string &id) const |
const ActorAttribute & | GetAttribute (const std::string &id) const |
void | SetAttribute (const std::string &id, std::string value) |
Set the value of the attribute given by id. More... | |
size_t | size () const |
auto | begin () const |
auto | end () const |
ActorDescription | |
rpc::ActorDescription | MakeActorDescription () const |
Private Attributes | |
std::unordered_map< std::string, ActorAttribute > | _attributes |
std::string | _id |
std::unordered_set< std::string > | _tags |
uint32_t | _uid = 0u |
Contains all the necessary information for spawning an Actor.
Definition at line 23 of file ActorBlueprint.h.
|
explicit |
Definition at line 26 of file ActorBlueprint.cpp.
References _attributes, _tags, carla::rpc::ActorDefinition::attributes, carla::client::FillMap(), carla::StringUtil::Split(), and carla::rpc::ActorDefinition::tags.
|
inline |
Definition at line 92 of file ActorBlueprint.h.
References _attributes, and carla::iterator::make_map_values_const_iterator().
|
inline |
Definition at line 74 of file ActorBlueprint.h.
References _attributes, GetAttribute(), and SetAttribute().
|
inline |
Definition at line 53 of file ActorBlueprint.h.
References _tags, and MatchTags().
|
inline |
Definition at line 96 of file ActorBlueprint.h.
References _attributes, carla::iterator::make_map_values_const_iterator(), and MakeActorDescription().
const ActorAttribute & carla::client::ActorBlueprint::GetAttribute | ( | const std::string & | id | ) | const |
std::out_of_range | if no such element exists. |
Definition at line 41 of file ActorBlueprint.cpp.
References _attributes, and carla::throw_exception().
Referenced by ContainsAttribute(), and SetAttribute().
|
inline |
Definition at line 41 of file ActorBlueprint.h.
References _id.
|
inline |
Definition at line 62 of file ActorBlueprint.h.
References _tags.
rpc::ActorDescription carla::client::ActorBlueprint::MakeActorDescription | ( | ) | const |
Definition at line 54 of file ActorBlueprint.cpp.
References _attributes, _id, _uid, carla::rpc::ActorDescription::attributes, carla::rpc::ActorDescription::id, and carla::rpc::ActorDescription::uid.
Referenced by end(), and carla::client::detail::Simulator::SpawnActor().
bool carla::client::ActorBlueprint::MatchTags | ( | const std::string & | wildcard_pattern | ) | const |
Test if any of the flags matches wildcard_pattern.
wildcard_pattern follows Unix shell-style wildcards.
Definition at line 33 of file ActorBlueprint.cpp.
References _id, _tags, and carla::StringUtil::Match().
Referenced by ContainsTag().
void carla::client::ActorBlueprint::SetAttribute | ( | const std::string & | id, |
std::string | value | ||
) |
Set the value of the attribute given by id.
std::out_of_range | if no such element exists. |
InvalidAttributeValue | if attribute is not modifiable. |
InvalidAttributeValue | if format does not match the attribute type. |
Definition at line 50 of file ActorBlueprint.cpp.
References GetAttribute().
Referenced by ContainsAttribute().
|
inline |
Definition at line 88 of file ActorBlueprint.h.
References _attributes.
|
private |
Definition at line 120 of file ActorBlueprint.h.
Referenced by ActorBlueprint(), begin(), ContainsAttribute(), end(), GetAttribute(), MakeActorDescription(), and size().
|
private |
Definition at line 116 of file ActorBlueprint.h.
Referenced by GetId(), MakeActorDescription(), and MatchTags().
|
private |
Definition at line 118 of file ActorBlueprint.h.
Referenced by ActorBlueprint(), ContainsTag(), GetTags(), and MatchTags().
|
private |
Definition at line 114 of file ActorBlueprint.h.
Referenced by MakeActorDescription().