CARLA
Private Attributes | List of all members
carla::client::ActorBlueprint Class Reference

Contains all the necessary information for spawning an Actor. More...

#include <ActorBlueprint.h>

+ Collaboration diagram for carla::client::ActorBlueprint:

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 ActorAttributeGetAttribute (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
 

Detailed Description

Contains all the necessary information for spawning an Actor.

Definition at line 23 of file ActorBlueprint.h.

Constructor & Destructor Documentation

◆ ActorBlueprint()

carla::client::ActorBlueprint::ActorBlueprint ( rpc::ActorDefinition  actor_definition)
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.

+ Here is the call graph for this function:

Member Function Documentation

◆ begin()

auto carla::client::ActorBlueprint::begin ( ) const
inline

Definition at line 92 of file ActorBlueprint.h.

References _attributes, and carla::iterator::make_map_values_const_iterator().

+ Here is the call graph for this function:

◆ ContainsAttribute()

bool carla::client::ActorBlueprint::ContainsAttribute ( const std::string &  id) const
inline

Definition at line 74 of file ActorBlueprint.h.

References _attributes, GetAttribute(), and SetAttribute().

+ Here is the call graph for this function:

◆ ContainsTag()

bool carla::client::ActorBlueprint::ContainsTag ( const std::string &  tag) const
inline

Definition at line 53 of file ActorBlueprint.h.

References _tags, and MatchTags().

+ Here is the call graph for this function:

◆ end()

auto carla::client::ActorBlueprint::end ( ) const
inline

Definition at line 96 of file ActorBlueprint.h.

References _attributes, carla::iterator::make_map_values_const_iterator(), and MakeActorDescription().

+ Here is the call graph for this function:

◆ GetAttribute()

const ActorAttribute & carla::client::ActorBlueprint::GetAttribute ( const std::string &  id) const
Exceptions
std::out_of_rangeif no such element exists.

Definition at line 41 of file ActorBlueprint.cpp.

References _attributes, and carla::throw_exception().

Referenced by ContainsAttribute(), and SetAttribute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetId()

const std::string& carla::client::ActorBlueprint::GetId ( ) const
inline

Definition at line 41 of file ActorBlueprint.h.

References _id.

◆ GetTags()

std::vector<std::string> carla::client::ActorBlueprint::GetTags ( ) const
inline

Definition at line 62 of file ActorBlueprint.h.

References _tags.

◆ MakeActorDescription()

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().

+ Here is the caller graph for this function:

◆ MatchTags()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetAttribute()

void carla::client::ActorBlueprint::SetAttribute ( const std::string &  id,
std::string  value 
)

Set the value of the attribute given by id.

Exceptions
std::out_of_rangeif no such element exists.
InvalidAttributeValueif attribute is not modifiable.
InvalidAttributeValueif format does not match the attribute type.

Definition at line 50 of file ActorBlueprint.cpp.

References GetAttribute().

Referenced by ContainsAttribute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

size_t carla::client::ActorBlueprint::size ( ) const
inline

Definition at line 88 of file ActorBlueprint.h.

References _attributes.

Member Data Documentation

◆ _attributes

std::unordered_map<std::string, ActorAttribute> carla::client::ActorBlueprint::_attributes
private

◆ _id

std::string carla::client::ActorBlueprint::_id
private

Definition at line 116 of file ActorBlueprint.h.

Referenced by GetId(), MakeActorDescription(), and MatchTags().

◆ _tags

std::unordered_set<std::string> carla::client::ActorBlueprint::_tags
private

Definition at line 118 of file ActorBlueprint.h.

Referenced by ActorBlueprint(), ContainsTag(), GetTags(), and MatchTags().

◆ _uid

uint32_t carla::client::ActorBlueprint::_uid = 0u
private

Definition at line 114 of file ActorBlueprint.h.

Referenced by MakeActorDescription().


The documentation for this class was generated from the following files: