A registry of all the Carla actors. More...
#include <ActorRegistry.h>
Public Types | |
using | IdType = FCarlaActor::IdType |
using | ValueType = TSharedPtr< FCarlaActor > |
Public Member Functions | |
Actor registry functions | |
FCarlaActor * | Register (AActor &Actor, FActorDescription Description, IdType DesiredId=0) |
Register the Actor in the database. More... | |
void | Deregister (IdType Id) |
void | Deregister (AActor *Actor) |
Look up functions | |
int32 | Num () const |
bool | IsEmpty () const |
bool | Contains (uint32 Id) const |
FCarlaActor * | FindCarlaActor (IdType Id) |
const FCarlaActor * | FindCarlaActor (IdType Id) const |
FCarlaActor * | FindCarlaActor (const AActor *Actor) |
const FCarlaActor * | FindCarlaActor (const AActor *Actor) const |
FString | GetDescriptionFromStream (carla::streaming::detail::stream_id_type Id) |
void | PutActorToSleep (IdType Id, UCarlaEpisode *CarlaEpisode) |
void | WakeActorUp (IdType Id, UCarlaEpisode *CarlaEpisode) |
Range iteration support | |
auto | begin () const noexcept |
auto | end () const noexcept |
Private Types | |
using | DatabaseType = TMap< IdType, TSharedPtr< FCarlaActor > > |
Private Member Functions | |
TSharedPtr< FCarlaActor > | MakeCarlaActor (IdType Id, AActor &Actor, FActorDescription Description, carla::rpc::ActorState InState) const |
FCarlaActor | MakeFakeActor (AActor &Actor) const |
Private Attributes | |
DatabaseType | ActorDatabase |
TMap< IdType, AActor * > | Actors |
TMap< AActor *, IdType > | Ids |
Static Private Attributes | |
static IdType | ID_COUNTER = 0u |
A registry of all the Carla actors.
Definition at line 20 of file ActorRegistry.h.
|
private |
Definition at line 30 of file ActorRegistry.h.
Definition at line 24 of file ActorRegistry.h.
using FActorRegistry::ValueType = TSharedPtr<FCarlaActor> |
Definition at line 25 of file ActorRegistry.h.
|
inlinenoexcept |
Definition at line 106 of file ActorRegistry.h.
References ActorDatabase.
Referenced by FCarlaServer::FPimpl::BindActions(), CarlaReplayerHelper::FindTrafficLightAt(), FFrameData::FindTrafficLightAt(), FFrameData::GetFrameData(), and ACarlaRecorder::Ticking().
|
inline |
Definition at line 64 of file ActorRegistry.h.
References ActorDatabase.
Referenced by FFrameData::CreateOrReuseActor(), and CarlaReplayerHelper::TryToCreateReplayerActor().
void FActorRegistry::Deregister | ( | IdType | Id | ) |
Definition at line 118 of file ActorRegistry.cpp.
References ActorDatabase, Actors, FindCarlaActor(), FCarlaActor::GetActor(), Ids, and FCarlaActor::TheActor.
Referenced by Deregister(), UActorDispatcher::DestroyActor(), and UActorDispatcher::OnActorDestroyed().
void FActorRegistry::Deregister | ( | AActor * | Actor | ) |
Definition at line 135 of file ActorRegistry.cpp.
References Deregister(), FindCarlaActor(), FCarlaActor::GetActor(), and FCarlaActor::GetActorId().
|
inlinenoexcept |
Definition at line 111 of file ActorRegistry.h.
References ActorDatabase, MakeCarlaActor(), and MakeFakeActor().
Referenced by FCarlaServer::FPimpl::BindActions(), CarlaReplayerHelper::FindTrafficLightAt(), FFrameData::FindTrafficLightAt(), FFrameData::GetFrameData(), and ACarlaRecorder::Ticking().
|
inline |
Definition at line 69 of file ActorRegistry.h.
References ActorDatabase.
Referenced by ACarlaRecorder::AddCollision(), FFrameData::AddPhysicsControl(), ACarlaRecorder::AddPhysicsControl(), FFrameData::AddTrafficLightTime(), ACarlaRecorder::AddTrafficLightTime(), FFrameData::AddTriggerVolume(), ACarlaRecorder::AddTriggerVolume(), ARayCastSemanticLidar::ComputeRawDetection(), Deregister(), UActorDispatcher::DestroyActor(), FindCarlaActor(), FWorldObserver_GetActorState(), UActorDispatcher::OnActorDestroyed(), PutActorToSleep(), Register(), and WakeActorUp().
|
inline |
Definition at line 75 of file ActorRegistry.h.
References ActorDatabase.
|
inline |
Definition at line 81 of file ActorRegistry.h.
References FindCarlaActor(), and Ids.
|
inline |
Definition at line 87 of file ActorRegistry.h.
References FindCarlaActor(), GetDescriptionFromStream(), Ids, PutActorToSleep(), and WakeActorUp().
FString FActorRegistry::GetDescriptionFromStream | ( | carla::streaming::detail::stream_id_type | Id | ) |
Definition at line 240 of file ActorRegistry.cpp.
References ActorDatabase, FActorInfo::Description, ASensor::GetToken(), and FActorDescription::Id.
Referenced by FindCarlaActor().
|
inline |
Definition at line 59 of file ActorRegistry.h.
References Num().
|
private |
Definition at line 143 of file ActorRegistry.cpp.
References CarlaGetRelevantTagAsString(), FCarlaActor::ConstructCarlaActor(), FActorRegistry_GetActorType(), UBoundingBoxCalculator::GetActorBoundingBox(), and ATagger::GetTagsOfTaggedActor().
Referenced by end(), and Register().
|
private |
|
inline |
Definition at line 54 of file ActorRegistry.h.
References Actors.
Referenced by FWorldObserver_Serialize(), and IsEmpty().
void FActorRegistry::PutActorToSleep | ( | FCarlaActor::IdType | Id, |
UCarlaEpisode * | CarlaEpisode | ||
) |
Definition at line 186 of file ActorRegistry.cpp.
References Actors, FindCarlaActor(), FCarlaActor::GetActor(), FCarlaActor::GetChildren(), Ids, and FCarlaActor::PutActorToSleep().
Referenced by FindCarlaActor(), and UActorDispatcher::PutActorToSleep().
FCarlaActor * FActorRegistry::Register | ( | AActor & | Actor, |
FActorDescription | Description, | ||
IdType | DesiredId = 0 |
||
) |
Register the Actor in the database.
A new ID will be assign to this actor.
Definition at line 72 of file ActorRegistry.cpp.
References ActorDatabase, Actors, FindCarlaActor(), ID_COUNTER, Ids, FCarlaActor::IsDormant(), MakeCarlaActor(), and FCarlaActor::TheActor.
Referenced by UActorDispatcher::RegisterActor().
void FActorRegistry::WakeActorUp | ( | FCarlaActor::IdType | Id, |
UCarlaEpisode * | CarlaEpisode | ||
) |
Definition at line 206 of file ActorRegistry.cpp.
References Actors, UCarlaEpisode::AttachActors(), FindCarlaActor(), FCarlaActor::GetActor(), FCarlaActor::GetAttachmentType(), FCarlaActor::GetChildren(), FCarlaActor::GetParent(), Ids, FCarlaActor::IsDormant(), and FCarlaActor::WakeActorUp().
Referenced by FindCarlaActor(), and UActorDispatcher::WakeActorUp().
|
private |
Definition at line 132 of file ActorRegistry.h.
Referenced by begin(), Contains(), Deregister(), end(), FindCarlaActor(), GetDescriptionFromStream(), and Register().
Definition at line 128 of file ActorRegistry.h.
Referenced by Deregister(), Num(), PutActorToSleep(), Register(), and WakeActorUp().
|
staticprivate |
Definition at line 134 of file ActorRegistry.h.
Referenced by Register().
Definition at line 130 of file ActorRegistry.h.
Referenced by Deregister(), FindCarlaActor(), PutActorToSleep(), Register(), and WakeActorUp().