Keeps a list of actor descriptions to avoid requesting each time the descriptions to the server. More...
#include <CachedActorList.h>
Public Member Functions | |
void | Clear () |
boost::optional< rpc::Actor > | GetActorById (ActorId id) const |
Retrieve the actor matching id, or empty optional if actor is not cached. More... | |
template<typename RangeT > | |
std::vector< rpc::Actor > | GetActorsById (const RangeT &range) const |
Retrieve the actors matching the ids in range. More... | |
template<typename RangeT > | |
std::vector< ActorId > | GetMissingIds (const RangeT &range) const |
Return the actor ids present in range that haven't been added to this list. More... | |
void | Insert (rpc::Actor actor) |
Inserts an actor into the list. More... | |
template<typename RangeT > | |
void | InsertRange (RangeT range) |
Inserts a range containing actors. More... | |
Private Attributes | |
std::unordered_map< ActorId, rpc::Actor > | _actors |
std::mutex | _mutex |
Additional Inherited Members | |
Private Member Functions inherited from carla::MovableNonCopyable | |
MovableNonCopyable ()=default | |
MovableNonCopyable (const MovableNonCopyable &)=delete | |
MovableNonCopyable (MovableNonCopyable &&)=default | |
MovableNonCopyable & | operator= (const MovableNonCopyable &)=delete |
MovableNonCopyable & | operator= (MovableNonCopyable &&)=default |
Keeps a list of actor descriptions to avoid requesting each time the descriptions to the server.
Definition at line 30 of file CachedActorList.h.
|
inline |
Definition at line 119 of file CachedActorList.h.
References _actors, and _mutex.
Referenced by carla::client::detail::Episode::OnEpisodeStarted().
|
inline |
Retrieve the actor matching id, or empty optional if actor is not cached.
Definition at line 96 of file CachedActorList.h.
References _actors, and _mutex.
Referenced by carla::client::detail::Episode::GetActorById().
|
inline |
Retrieve the actors matching the ids in range.
Definition at line 106 of file CachedActorList.h.
References _actors, and _mutex.
Referenced by carla::client::detail::GetActorsById_Impl().
|
inline |
Return the actor ids present in range that haven't been added to this list.
Definition at line 86 of file CachedActorList.h.
References _actors, and _mutex.
Referenced by carla::client::detail::GetActorsById_Impl().
|
inline |
Inserts an actor into the list.
Definition at line 66 of file CachedActorList.h.
References _actors, _mutex, and carla::rpc::Actor::id.
Referenced by carla::client::detail::Episode::GetActorById(), and carla::client::detail::Episode::RegisterActor().
|
inline |
Inserts a range containing actors.
Definition at line 73 of file CachedActorList.h.
References _actors, and _mutex.
Referenced by carla::client::detail::GetActorsById_Impl().
|
private |
Definition at line 59 of file CachedActorList.h.
Referenced by Clear(), GetActorById(), GetActorsById(), GetMissingIds(), Insert(), and InsertRange().
|
mutableprivate |
Definition at line 57 of file CachedActorList.h.
Referenced by Clear(), GetActorById(), GetActorsById(), GetMissingIds(), Insert(), and InsertRange().