CARLA
Public Member Functions | Private Attributes | List of all members
carla::client::ActorAttribute Class Reference

An attribute of an ActorBlueprint. More...

#include <ActorAttribute.h>

+ Inheritance diagram for carla::client::ActorAttribute:
+ Collaboration diagram for carla::client::ActorAttribute:

Public Member Functions

 ActorAttribute (rpc::ActorAttribute attribute)
 
 ActorAttribute (ActorAttribute const &)=default
 
 ActorAttribute (ActorAttribute &&)=default
 
virtual const std::string & GetId () const override
 
const std::vector< std::string > & GetRecommendedValues () const
 
virtual rpc::ActorAttributeType GetType () const override
 
virtual const std::string & GetValue () const override
 
bool IsModifiable () const
 
 operator rpc::ActorAttributeValue () const
 Serialize this object as a carla::rpc::ActorAttributeValue. More...
 
ActorAttributeoperator= (ActorAttribute const &)=default
 
ActorAttributeoperator= (ActorAttribute &&)=default
 
void Set (std::string value)
 Set the value of this attribute. More...
 
virtual ~ActorAttribute ()=default
 
- Public Member Functions inherited from carla::client::ActorAttributeValueAccess
 ActorAttributeValueAccess ()=default
 
 ActorAttributeValueAccess (ActorAttributeValueAccess const &)=default
 
 ActorAttributeValueAccess (ActorAttributeValueAccess &&)=default
 
template<>
bool As () const
 
template<>
int As () const
 
template<>
float As () const
 
template<typename T >
As () const
 Cast the value to the given type. More...
 
template<rpc::ActorAttributeType Type>
auto As () const
 Cast the value to the type specified by the enum carla::rpc::ActorAttributeType. More...
 
template<>
bool As () const
 
template<>
int As () const
 
template<>
float As () const
 
template<>
std::string As () const
 
template<>
sensor::data::Color As () const
 
template<typename T >
bool operator!= (const T &rhs) const
 
ActorAttributeValueAccessoperator= (ActorAttributeValueAccess const &)=default
 
ActorAttributeValueAccessoperator= (ActorAttributeValueAccess &&)=default
 
template<typename T >
bool operator== (const T &rhs) const
 
template<>
bool operator== (const ActorAttributeValueAccess &rhs) const
 
template<>
bool operator== (const ActorAttributeValue &rhs) const
 
template<>
bool operator== (const ActorAttribute &rhs) const
 
virtual ~ActorAttributeValueAccess ()=default
 

Private Attributes

rpc::ActorAttribute _attribute
 

Additional Inherited Members

- Protected Member Functions inherited from carla::client::ActorAttributeValueAccess
void Validate () const
 

Detailed Description

An attribute of an ActorBlueprint.

Definition at line 184 of file LibCarla/source/carla/client/ActorAttribute.h.

Constructor & Destructor Documentation

◆ ActorAttribute() [1/3]

carla::client::ActorAttribute::ActorAttribute ( rpc::ActorAttribute  attribute)
inline

◆ ActorAttribute() [2/3]

carla::client::ActorAttribute::ActorAttribute ( ActorAttribute const &  )
default

◆ ActorAttribute() [3/3]

carla::client::ActorAttribute::ActorAttribute ( ActorAttribute &&  )
default

◆ ~ActorAttribute()

virtual carla::client::ActorAttribute::~ActorAttribute ( )
virtualdefault

Member Function Documentation

◆ GetId()

virtual const std::string& carla::client::ActorAttribute::GetId ( ) const
inlineoverridevirtual

◆ GetRecommendedValues()

const std::vector<std::string>& carla::client::ActorAttribute::GetRecommendedValues ( ) const
inline

Definition at line 208 of file LibCarla/source/carla/client/ActorAttribute.h.

Referenced by carla::client::BlueprintLibrary::FilterByAttribute().

+ Here is the caller graph for this function:

◆ GetType()

virtual rpc::ActorAttributeType carla::client::ActorAttribute::GetType ( ) const
inlineoverridevirtual

Implements carla::client::ActorAttributeValueAccess.

Definition at line 204 of file LibCarla/source/carla/client/ActorAttribute.h.

Referenced by Set(), and carla::client::ActorAttributeValueAccess::Validate().

+ Here is the caller graph for this function:

◆ GetValue()

virtual const std::string& carla::client::ActorAttribute::GetValue ( ) const
inlineoverridevirtual

Implements carla::client::ActorAttributeValueAccess.

Definition at line 227 of file LibCarla/source/carla/client/ActorAttribute.h.

Referenced by carla::client::ActorAttributeValueAccess::As< sensor::data::Color >(), carla::client::ActorAttributeValueAccess::As< std::string >(), carla::client::ActorAttributeValueAccess::As(), and carla::client::BlueprintLibrary::FilterByAttribute().

+ Here is the caller graph for this function:

◆ IsModifiable()

bool carla::client::ActorAttribute::IsModifiable ( ) const
inline

◆ operator rpc::ActorAttributeValue()

carla::client::ActorAttribute::operator rpc::ActorAttributeValue ( ) const
inline

Serialize this object as a carla::rpc::ActorAttributeValue.

Definition at line 223 of file LibCarla/source/carla/client/ActorAttribute.h.

◆ operator=() [1/2]

ActorAttribute& carla::client::ActorAttribute::operator= ( ActorAttribute const &  )
default

◆ operator=() [2/2]

ActorAttribute& carla::client::ActorAttribute::operator= ( ActorAttribute &&  )
default

◆ Set()

void carla::client::ActorAttribute::Set ( std::string  value)

Set the value of this attribute.

Exceptions
InvalidAttributeValueif attribute is not modifiable.
InvalidAttributeValueif format does not match this type.

Definition at line 22 of file ActorAttribute.cpp.

References _attribute, carla::rpc::Bool, GetType(), carla::rpc::ActorAttribute::is_modifiable, LIBCARLA_THROW_INVALID_VALUE, carla::StringUtil::ToLower(), carla::client::ActorAttributeValueAccess::Validate(), and carla::rpc::ActorAttribute::value.

+ Here is the call graph for this function:

Member Data Documentation

◆ _attribute

rpc::ActorAttribute carla::client::ActorAttribute::_attribute
private

Definition at line 232 of file LibCarla/source/carla/client/ActorAttribute.h.

Referenced by Set().


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