58 virtual const std::string &
GetId()
const = 0;
72 template <rpc::ActorAttributeType Type>
80 return !(*
this ==
rhs);
84 virtual const std::string &
GetValue()
const = 0;
99 std::string ActorAttributeValueAccess::As<std::string>()
const;
105 inline auto ActorAttributeValueAccess::As<rpc::ActorAttributeType::Bool>()
const {
110 inline auto ActorAttributeValueAccess::As<rpc::ActorAttributeType::Int>()
const {
115 inline auto ActorAttributeValueAccess::As<rpc::ActorAttributeType::Float>()
const {
120 inline auto ActorAttributeValueAccess::As<rpc::ActorAttributeType::String>()
const {
125 inline auto ActorAttributeValueAccess::As<rpc::ActorAttributeType::RGBColor>()
const {
129 template <
typename T>
156 virtual const std::string &
GetId()
const override {
169 virtual const std::string &
GetValue()
const override {
180 return rhs.operator==(*this);
200 virtual const std::string &
GetId()
const override {
220 void Set(std::string value);
227 virtual const std::string &
GetValue()
const override {
237 return rhs.operator==(*this);
bool operator!=(const T &rhs) const
virtual ~ActorAttributeValueAccess()=default
virtual const std::string & GetValue() const =0
ActorAttributeValueAccess()=default
bool operator==(const T &rhs) const
ActorAttributeValueAccess & operator=(ActorAttributeValueAccess const &)=default
virtual const std::string & GetId() const =0
ActorAttributeValueAccess(ActorAttributeValueAccess &&)=default
virtual rpc::ActorAttributeType GetType() const =0
ActorAttributeValueAccess(ActorAttributeValueAccess const &)=default
auto As() const
Cast the value to the type specified by the enum carla::rpc::ActorAttributeType.
T As() const
Cast the value to the given type.
ActorAttributeValue(ActorAttributeValue const &)=default
ActorAttributeValue & operator=(ActorAttributeValue const &)=default
virtual ~ActorAttributeValue()=default
virtual const std::string & GetId() const override
ActorAttributeValue(rpc::ActorAttributeValue attribute)
virtual rpc::ActorAttributeType GetType() const override
virtual const std::string & GetValue() const override
rpc::ActorAttributeValue _attribute
ActorAttributeValue(ActorAttributeValue &&)=default
An attribute of an ActorBlueprint.
virtual const std::string & GetId() const override
virtual const std::string & GetValue() const override
bool IsModifiable() const
ActorAttribute(ActorAttribute &&)=default
void Set(std::string value)
Set the value of this attribute.
ActorAttribute(rpc::ActorAttribute attribute)
rpc::ActorAttribute _attribute
virtual ~ActorAttribute()=default
ActorAttribute(ActorAttribute const &)=default
virtual rpc::ActorAttributeType GetType() const override
const std::vector< std::string > & GetRecommendedValues() const
ActorAttribute & operator=(ActorAttribute const &)=default
Exception thrown when the value of an ActorAttribute cannot be cast to the requested type.
BadAttributeCast(const std::string &what)
Exception thrown when the value given to an ActorAttribute cannot be converted to its type.
InvalidAttributeValue(const std::string &what)
std::vector< std::string > recommended_values
sensor::data::Color ActorAttributeValueAccess::As< sensor::data::Color >() const
std::string ActorAttributeValueAccess::As< std::string >() const
This file contains definitions of common data structures used in traffic manager.