RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
Public Member Functions | Static Public Member Functions | Friends | List of all members
rstudio::launcher_plugins::system::TimeDuration Class Referencefinal

Represents an duration of time (e.g. 5 hours, 43 minutes, and 21 seconds) as opposed to a point in time. More...

#include <DateTime.hpp>

Public Member Functions

 TimeDuration (int64_t in_hours=0, int64_t in_minutes=0, int64_t in_seconds=0, int64_t in_microseconds=0)
 Constructor. More...
 
 TimeDuration (const TimeDuration &in_other)
 Copy constructor. More...
 
 TimeDuration (TimeDuration &&in_other) noexcept
 Move constructor. More...
 
 ~TimeDuration ()=default
 Destructor.
 
TimeDurationoperator= (const TimeDuration &in_other)
 Assignment operator. More...
 
TimeDurationoperator= (TimeDuration &&in_other) noexcept
 Move operator. More...
 
bool operator== (const TimeDuration &in_other) const
 Equality comparison operator. More...
 
bool operator!= (const TimeDuration &in_other) const
 Inequality comparison operator. More...
 
bool operator< (const TimeDuration &in_other) const
 Less-than comparison operator. More...
 
bool operator<= (const TimeDuration &in_other) const
 Less-than-equal comparison operator. More...
 
bool operator> (const TimeDuration &in_other) const
 Greater-than comparison operator. More...
 
bool operator>= (const TimeDuration &in_other) const
 Greater-than-equal comparison operator. More...
 
bool isInfinity () const
 Checks whether this TimeDuration represents "any amount of time". More...
 
int64_t getHours () const
 Gets the number of hours in this TimeDuration. More...
 
int64_t getMinutes () const
 Gets the number of minutes in this TimeDuration. More...
 
int64_t getSeconds () const
 Gets the number of seconds in this TimeDuration. More...
 
int64_t getMicroseconds () const
 Gets the number of days in this TimeDuration. More...
 

Static Public Member Functions

static TimeDuration Infinity ()
 Constructs a TimeDuration which represents "any amount of time". Use with caution. More...
 
static TimeDuration Hours (int64_t in_hours)
 Constructs an TimeDuration which represents the specified number of hours. More...
 
static TimeDuration Minutes (int64_t in_minutes)
 Constructs an TimeDuration which represents the specified number of minutes. More...
 
static TimeDuration Seconds (int64_t in_seconds)
 Constructs an TimeDuration which represents the specified number of seconds. More...
 
static TimeDuration Microseconds (int64_t in_microseconds)
 Constructs an TimeDuration which represents the specified number of microseconds. More...
 

Friends

class DateTime
 

Detailed Description

Represents an duration of time (e.g. 5 hours, 43 minutes, and 21 seconds) as opposed to a point in time.

Constructor & Destructor Documentation

◆ TimeDuration() [1/3]

rstudio::launcher_plugins::system::TimeDuration::TimeDuration ( int64_t  in_hours = 0,
int64_t  in_minutes = 0,
int64_t  in_seconds = 0,
int64_t  in_microseconds = 0 
)
explicit

Constructor.

Parameters
in_hoursThe number of hours in this TimeDuration.
in_minutesThe number of minutes in this TimeDuration.
in_secondsThe number of seconds in this TimeDuration.
in_microsecondsThe number of microseconds in this TimeDuration.

◆ TimeDuration() [2/3]

rstudio::launcher_plugins::system::TimeDuration::TimeDuration ( const TimeDuration in_other)

Copy constructor.

Parameters
in_otherThe TimeDuration to copy into this TimeDuration.

◆ TimeDuration() [3/3]

rstudio::launcher_plugins::system::TimeDuration::TimeDuration ( TimeDuration &&  in_other)
noexcept

Move constructor.

Parameters
in_otherThe TimeDuration to move into this TimeDuration.

Member Function Documentation

◆ getHours()

int64_t rstudio::launcher_plugins::system::TimeDuration::getHours ( ) const

Gets the number of hours in this TimeDuration.

Returns
The number of hours in this TimeDuration.

◆ getMicroseconds()

int64_t rstudio::launcher_plugins::system::TimeDuration::getMicroseconds ( ) const

Gets the number of days in this TimeDuration.

Returns
The number of days in this TimeDuration.

◆ getMinutes()

int64_t rstudio::launcher_plugins::system::TimeDuration::getMinutes ( ) const

Gets the number of minutes in this TimeDuration.

Returns
The number of minutes in this TimeDuration.

◆ getSeconds()

int64_t rstudio::launcher_plugins::system::TimeDuration::getSeconds ( ) const

Gets the number of seconds in this TimeDuration.

Returns
The number of seconds in this TimeDuration.

◆ Hours()

static TimeDuration rstudio::launcher_plugins::system::TimeDuration::Hours ( int64_t  in_hours)
static

Constructs an TimeDuration which represents the specified number of hours.

Parameters
in_hoursThe number of hours which should be represented by the TimeDuration.
Returns
The new TimeDuration.

◆ Infinity()

static TimeDuration rstudio::launcher_plugins::system::TimeDuration::Infinity ( )
static

Constructs a TimeDuration which represents "any amount of time". Use with caution.

Returns
The new TimeDuration.

◆ isInfinity()

bool rstudio::launcher_plugins::system::TimeDuration::isInfinity ( ) const

Checks whether this TimeDuration represents "any amount of time".

Returns
True if this TimeDuration is "Infinity"; false otherwise.

◆ Microseconds()

static TimeDuration rstudio::launcher_plugins::system::TimeDuration::Microseconds ( int64_t  in_microseconds)
static

Constructs an TimeDuration which represents the specified number of microseconds.

Parameters
in_microsecondsThe number of microseconds which should be represented by the TimeDuration.
Returns
The new TimeDuration.

◆ Minutes()

static TimeDuration rstudio::launcher_plugins::system::TimeDuration::Minutes ( int64_t  in_minutes)
static

Constructs an TimeDuration which represents the specified number of minutes.

Parameters
in_minutesThe number of minutes which should be represented by the TimeDuration.
Returns
The new TimeDuration.

◆ operator!=()

bool rstudio::launcher_plugins::system::TimeDuration::operator!= ( const TimeDuration in_other) const

Inequality comparison operator.

Parameters
in_otherThe TimeDuration to compare against.
Returns
False if in_other has the same values as this TimeDuration; true otherwise.

◆ operator<()

bool rstudio::launcher_plugins::system::TimeDuration::operator< ( const TimeDuration in_other) const

Less-than comparison operator.

Parameters
in_otherThe TimeDuration to compare against.
Returns
True if this TimeDuration is less than in_other; false otherwise.

◆ operator<=()

bool rstudio::launcher_plugins::system::TimeDuration::operator<= ( const TimeDuration in_other) const

Less-than-equal comparison operator.

Parameters
in_otherThe TimeDuration to compare against.
Returns
True if this TimeDuration is less than or equal to in_other; false otherwise.

◆ operator=() [1/2]

TimeDuration& rstudio::launcher_plugins::system::TimeDuration::operator= ( const TimeDuration in_other)

Assignment operator.

Parameters
in_otherThe TimeDuration to copy into this TimeDuration.
Returns
A reference to this TimeDuration.

◆ operator=() [2/2]

TimeDuration& rstudio::launcher_plugins::system::TimeDuration::operator= ( TimeDuration &&  in_other)
noexcept

Move operator.

Parameters
in_otherThe TimeDuration to move into this TimeDuration.
Returns
A reference to this TimeDuration.

◆ operator==()

bool rstudio::launcher_plugins::system::TimeDuration::operator== ( const TimeDuration in_other) const

Equality comparison operator.

Parameters
in_otherThe TimeDuration to compare against.
Returns
True if in_other has the same values as this TimeDuration; false otherwise.

◆ operator>()

bool rstudio::launcher_plugins::system::TimeDuration::operator> ( const TimeDuration in_other) const

Greater-than comparison operator.

Parameters
in_otherThe TimeDuration to compare against.
Returns
True if this TimeDuration is greater than in_other; false otherwise.

◆ operator>=()

bool rstudio::launcher_plugins::system::TimeDuration::operator>= ( const TimeDuration in_other) const

Greater-than-equal comparison operator.

Parameters
in_otherThe TimeDuration to compare against.
Returns
True if this TimeDuration is greater than or equal to in_other; false otherwise.

◆ Seconds()

static TimeDuration rstudio::launcher_plugins::system::TimeDuration::Seconds ( int64_t  in_seconds)
static

Constructs an TimeDuration which represents the specified number of seconds.

Parameters
in_secondsThe number of seconds which should be represented by the TimeDuration.
Returns
The new TimeDuration.

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