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

Holds an Actor, but only instantiates it when needed. More...

#include <ActorVariant.h>

+ Collaboration diagram for carla::client::detail::ActorVariant:

Classes

struct  Visitor
 

Public Member Functions

 ActorVariant (rpc::Actor actor)
 
 ActorVariant (SharedPtr< client::Actor > actor)
 
SharedPtr< client::ActorGet (EpisodeProxy episode) const
 
ActorId GetId () const
 
ActorId GetParentId () const
 
const std::string & GetTypeId () const
 
bool operator!= (ActorVariant rhs) const
 
ActorVariantoperator= (rpc::Actor actor)
 
ActorVariantoperator= (SharedPtr< client::Actor > actor)
 
bool operator== (ActorVariant rhs) const
 
const rpc::ActorSerialize () const
 

Private Member Functions

void MakeActor (EpisodeProxy episode) const
 

Private Attributes

boost::variant2::variant< rpc::Actor, SharedPtr< client::Actor > > _value
 

Detailed Description

Holds an Actor, but only instantiates it when needed.

Definition at line 30 of file ActorVariant.h.

Constructor & Destructor Documentation

◆ ActorVariant() [1/2]

carla::client::detail::ActorVariant::ActorVariant ( rpc::Actor  actor)
inline

Definition at line 33 of file ActorVariant.h.

◆ ActorVariant() [2/2]

carla::client::detail::ActorVariant::ActorVariant ( SharedPtr< client::Actor actor)
inline

Definition at line 36 of file ActorVariant.h.

Member Function Documentation

◆ Get()

SharedPtr<client::Actor> carla::client::detail::ActorVariant::Get ( EpisodeProxy  episode) const
inline

Definition at line 49 of file ActorVariant.h.

References _value, DEBUG_ASSERT, and MakeActor().

Referenced by carla::sensor::data::CollisionEvent::GetActor(), carla::sensor::data::ObstacleDetectionEvent::GetActor(), carla::sensor::data::CollisionEvent::GetOtherActor(), carla::sensor::data::ObstacleDetectionEvent::GetOtherActor(), and carla::traffic_manager::TrafficManagerServer::TrafficManagerServer().

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

◆ GetId()

ActorId carla::client::detail::ActorVariant::GetId ( ) const
inline

Definition at line 61 of file ActorVariant.h.

References carla::rpc::Actor::id, and Serialize().

Referenced by operator==().

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

◆ GetParentId()

ActorId carla::client::detail::ActorVariant::GetParentId ( ) const
inline

Definition at line 65 of file ActorVariant.h.

References carla::rpc::Actor::parent_id, and Serialize().

+ Here is the call graph for this function:

◆ GetTypeId()

const std::string& carla::client::detail::ActorVariant::GetTypeId ( ) const
inline

Definition at line 69 of file ActorVariant.h.

References carla::rpc::Actor::description, carla::rpc::ActorDescription::id, and Serialize().

+ Here is the call graph for this function:

◆ MakeActor()

void carla::client::detail::ActorVariant::MakeActor ( EpisodeProxy  episode) const
private

Definition at line 16 of file ActorVariant.cpp.

References _value, carla::client::Disabled, and carla::client::detail::ActorFactory::MakeActor().

Referenced by Get(), and carla::client::detail::ActorVariant::Visitor::operator()().

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

◆ operator!=()

bool carla::client::detail::ActorVariant::operator!= ( ActorVariant  rhs) const
inline

Definition at line 77 of file ActorVariant.h.

◆ operator=() [1/2]

ActorVariant& carla::client::detail::ActorVariant::operator= ( rpc::Actor  actor)
inline

Definition at line 39 of file ActorVariant.h.

References _value.

◆ operator=() [2/2]

ActorVariant& carla::client::detail::ActorVariant::operator= ( SharedPtr< client::Actor actor)
inline

Definition at line 44 of file ActorVariant.h.

References _value.

◆ operator==()

bool carla::client::detail::ActorVariant::operator== ( ActorVariant  rhs) const
inline

Definition at line 73 of file ActorVariant.h.

References GetId().

+ Here is the call graph for this function:

◆ Serialize()

const rpc::Actor& carla::client::detail::ActorVariant::Serialize ( ) const
inline

Definition at line 57 of file ActorVariant.h.

References _value.

Referenced by GetId(), GetParentId(), and GetTypeId().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _value

boost::variant2::variant<rpc::Actor, SharedPtr<client::Actor> > carla::client::detail::ActorVariant::_value
mutableprivate

Definition at line 94 of file ActorVariant.h.

Referenced by Get(), MakeActor(), operator=(), and Serialize().


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