CARLA
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
carla::time_duration Class Reference

Positive time duration up to milliseconds resolution. More...

#include <Time.h>

+ Collaboration diagram for carla::time_duration:

Public Member Functions

constexpr size_t milliseconds () const noexcept
 
 operator boost::posix_time::time_duration () const
 
time_durationoperator= (const time_duration &)=default
 
constexpr time_duration () noexcept
 
template<typename Rep , typename Period >
 time_duration (std::chrono::duration< Rep, Period > duration)
 
 time_duration (boost::posix_time::time_duration timeout)
 
 time_duration (const time_duration &)=default
 
constexpr auto to_chrono () const
 
boost::posix_time::time_duration to_posix_time () const
 

Static Public Member Functions

static time_duration milliseconds (size_t timeout)
 
static time_duration seconds (size_t timeout)
 

Private Attributes

size_t _milliseconds
 

Detailed Description

Positive time duration up to milliseconds resolution.

Automatically casts between std::chrono::duration and boost::posix_time::time_duration.

Definition at line 19 of file Time.h.

Constructor & Destructor Documentation

◆ time_duration() [1/4]

constexpr carla::time_duration::time_duration ( )
inlinenoexcept

Definition at line 30 of file Time.h.

Referenced by time_duration().

+ Here is the caller graph for this function:

◆ time_duration() [2/4]

template<typename Rep , typename Period >
carla::time_duration::time_duration ( std::chrono::duration< Rep, Period >  duration)
inline

Definition at line 33 of file Time.h.

References DEBUG_ASSERT.

◆ time_duration() [3/4]

carla::time_duration::time_duration ( boost::posix_time::time_duration  timeout)
inline

Definition at line 40 of file Time.h.

References operator=(), and time_duration().

+ Here is the call graph for this function:

◆ time_duration() [4/4]

carla::time_duration::time_duration ( const time_duration )
default

Member Function Documentation

◆ milliseconds() [1/2]

static time_duration carla::time_duration::milliseconds ( size_t  timeout)
inlinestatic

Definition at line 26 of file Time.h.

Referenced by carla::client::World::ApplySettings(), carla::client::detail::Simulator::LoadEpisode(), carla::client::detail::Client::SetTimeout(), carla::client::World::Tick(), and carla::client::World::WaitForTick().

+ Here is the caller graph for this function:

◆ milliseconds() [2/2]

constexpr size_t carla::time_duration::milliseconds ( ) const
inlinenoexcept

Definition at line 58 of file Time.h.

References _milliseconds.

Referenced by carla::client::detail::Client::Pimpl::GetTimeout(), and FCarlaServer::RunSome().

+ Here is the caller graph for this function:

◆ operator boost::posix_time::time_duration()

carla::time_duration::operator boost::posix_time::time_duration ( ) const
inline

Definition at line 54 of file Time.h.

References to_posix_time().

+ Here is the call graph for this function:

◆ operator=()

time_duration& carla::time_duration::operator= ( const time_duration )
default

Referenced by time_duration().

+ Here is the caller graph for this function:

◆ seconds()

static time_duration carla::time_duration::seconds ( size_t  timeout)
inlinestatic

Definition at line 22 of file Time.h.

Referenced by carla::streaming::detail::tcp::Client::Reconnect(), and carla::multigpu::Secondary::Reconnect().

+ Here is the caller graph for this function:

◆ to_chrono()

constexpr auto carla::time_duration::to_chrono ( ) const
inline

Definition at line 50 of file Time.h.

References _milliseconds.

Referenced by carla::ThreadPool::RunFor(), carla::client::detail::SynchronizeFrame(), carla::rpc::Server::SyncRunFor(), and carla::RecurrentSharedFuture< carla::client::WorldSnapshot >::WaitFor().

+ Here is the caller graph for this function:

◆ to_posix_time()

boost::posix_time::time_duration carla::time_duration::to_posix_time ( ) const
inline

Definition at line 46 of file Time.h.

References _milliseconds.

Referenced by operator boost::posix_time::time_duration().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _milliseconds

size_t carla::time_duration::_milliseconds
private

Definition at line 64 of file Time.h.

Referenced by milliseconds(), to_chrono(), and to_posix_time().


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