CARLA
Loading...
Searching...
No Matches
Private Attributes | List of all members
carla::client::ActorBlueprint Class Reference

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

Member Function Documentation

◆ begin()

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

◆ ContainsAttribute()

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

Definition at line 74 of file ActorBlueprint.h.

References _attributes.

◆ ContainsTag()

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

Definition at line 53 of file ActorBlueprint.h.

References _tags.

◆ end()

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

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

◆ 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

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

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

◆ 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: