CARLA
Loading...
Searching...
No Matches
carla::client::WorldSnapshot Class Reference

#include <WorldSnapshot.h>

Public Member Functions

auto begin () const
 Return a begin iterator to the list of ActorSnapshots.
bool Contains (ActorId actor_id) const
 Check if an actor is present in this snapshot.
auto end () const
 Return a past-the-end iterator to the list of ActorSnapshots.
std::optional< ActorSnapshot > Find (ActorId actor_id) const
 Find an ActorSnapshot by id.
size_t GetFrame () const
uint64_t GetId () const
 Get the id of the episode associated with this world.
const Timestamp & GetTimestamp () const
 Get timestamp of this snapshot.
bool operator!= (const WorldSnapshot &rhs) const
bool operator== (const WorldSnapshot &rhs) const
size_t size () const
 Return number of ActorSnapshots present in this WorldSnapshot.
 WorldSnapshot (std::shared_ptr< const detail::EpisodeState > state)

Private Attributes

std::shared_ptr< const detail::EpisodeState > _state

Detailed Description

Definition at line 18 of file WorldSnapshot.h.

Constructor & Destructor Documentation

◆ WorldSnapshot()

carla::client::WorldSnapshot::WorldSnapshot ( std::shared_ptr< const detail::EpisodeState > state)
inline

Definition at line 21 of file WorldSnapshot.h.

References _state.

Referenced by operator!=(), and operator==().

Member Function Documentation

◆ begin()

auto carla::client::WorldSnapshot::begin ( ) const
inline

Return a begin iterator to the list of ActorSnapshots.

Definition at line 54 of file WorldSnapshot.h.

References _state.

◆ Contains()

bool carla::client::WorldSnapshot::Contains ( ActorId actor_id) const
inline

Check if an actor is present in this snapshot.

Definition at line 39 of file WorldSnapshot.h.

References _state.

◆ end()

auto carla::client::WorldSnapshot::end ( ) const
inline

Return a past-the-end iterator to the list of ActorSnapshots.

Definition at line 59 of file WorldSnapshot.h.

References _state.

◆ Find()

std::optional< ActorSnapshot > carla::client::WorldSnapshot::Find ( ActorId actor_id) const
inline

Find an ActorSnapshot by id.

Definition at line 44 of file WorldSnapshot.h.

References _state.

Referenced by carla::client::LaneInvasionCallback::Tick().

◆ GetFrame()

size_t carla::client::WorldSnapshot::GetFrame ( ) const
inline

◆ GetId()

uint64_t carla::client::WorldSnapshot::GetId ( ) const
inline

Get the id of the episode associated with this world.

Definition at line 25 of file WorldSnapshot.h.

References _state.

◆ GetTimestamp()

const Timestamp & carla::client::WorldSnapshot::GetTimestamp ( ) const
inline

Get timestamp of this snapshot.

Definition at line 34 of file WorldSnapshot.h.

References _state.

Referenced by GetFrame(), operator==(), and carla::client::LaneInvasionCallback::Tick().

◆ operator!=()

bool carla::client::WorldSnapshot::operator!= ( const WorldSnapshot & rhs) const
inline

Definition at line 67 of file WorldSnapshot.h.

References WorldSnapshot().

◆ operator==()

bool carla::client::WorldSnapshot::operator== ( const WorldSnapshot & rhs) const
inline

Definition at line 63 of file WorldSnapshot.h.

References GetTimestamp(), and WorldSnapshot().

◆ size()

size_t carla::client::WorldSnapshot::size ( ) const
inline

Return number of ActorSnapshots present in this WorldSnapshot.

Definition at line 49 of file WorldSnapshot.h.

References _state.

Member Data Documentation

◆ _state

std::shared_ptr<const detail::EpisodeState> carla::client::WorldSnapshot::_state
private

Definition at line 73 of file WorldSnapshot.h.

Referenced by begin(), Contains(), end(), Find(), GetId(), GetTimestamp(), size(), and WorldSnapshot().


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