Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
hdi::core::Duration Class Reference

Allows for acquisition and manipulation of a duration of time. More...

#include <hdicoreDuration.h>

Public Member Functions

 Duration ()
 Constructs a Duration object with a default duration (0 seconds)
 
 Duration (const Duration &d_)
 Constructs a Duration object from another existing Duration object.
 
 Duration (const int64_t secs_, const int32_t us_=0)
 Constructs a Duration object with a given number of seconds.
 
virtual ~Duration ()
 Destructs a Duration object.
 
virtual Durationoperator= (const Duration &rhs_)
 Overloaded assignment operator to copy values from one Duration object to another.
 
virtual bool operator== (const Duration &rhs_) const
 Overloaded equality operator to determine if two Duration objects are equal.
 
virtual bool operator!= (const Duration &rhs_) const
 Overloaded inequality operator to determine if two Duration objects differ.
 
virtual bool operator< (const Duration &rhs_) const
 Overloaded less-than operator to determine if one Duration object is less than the other.
 
virtual bool operator<= (const Duration &rhs_) const
 Overloaded less-than-or-equal operator to determine if one Duration object is less than, or equal to, the other.
 
virtual bool operator> (const Duration &rhs_) const
 Overloaded greater-than operator to determine if one Duration object is greater than the other.
 
virtual bool operator>= (const Duration &rhs_) const
 Overloaded greater-than-or-equal operator to determine if one Duration object is greater than, or equal to, the other.
 
virtual Duration operator- () const
 Overloaded unary minus operator, to flip the sign of the target Duration object.
 
virtual Duration operator- (const Duration &rhs_) const
 Overloaded subtraction operator to substract one duration from another.
 
virtual Durationoperator-= (const Duration &rhs_)
 Overloaded subtraction-assignment operator to subtract and assign the resultant Duration.
 
virtual Duration operator+ (const Duration &rhs_) const
 Overloaded addition operator to add one duration to another.
 
virtual Durationoperator+= (const Duration &rhs_)
 Overloaded addition-assignment operator to add and assign the resultant Duration.
 
virtual Duration operator* (const double rhs_) const
 Overloaded multiplication operator to multiply a duration by a constant.
 
virtual Durationoperator*= (const double rhs_)
 Overloaded multiplication-assignment operator to multiply and assign the resultant Duration.
 
virtual Duration operator/ (const double rhs_) const
 Overloaded division operator to divide a duration by a constant.
 
virtual Durationoperator/= (const double rhs_)
 Overloaded division-assignment operator to divide and assign the resultant Duration.
 
virtual double years () const
 Number of years in the duration.
 
virtual double days () const
 Number of days in the duration.
 
virtual double hours () const
 Number of hours in the duration.
 
virtual double minutes () const
 Number of minutes in the duration.
 
virtual double seconds () const
 Number of seconds in the duration.
 

Static Public Member Functions

static Duration Years (const int64_t years_)
 Creates a Duration object for a given number of years.
 
static Duration Days (const int64_t days_)
 Creates a Duration object for a given number of days.
 
static Duration Hours (const int64_t hours_)
 Creates a Duration object for a given number of hours.
 
static Duration Minutes (const int64_t mins_)
 Creates a Duration object for a given number of minutes.
 
static Duration TimeZoneOffset ()
 Creates a Duration object for the system's time zone offset.
 

Friends

class Date
 
class DateTime
 
class Time
 

Detailed Description

Allows for acquisition and manipulation of a duration of time.

Constructor & Destructor Documentation

◆ Duration() [1/3]

hdi::core::Duration::Duration ( )

Constructs a Duration object with a default duration (0 seconds)

Author
GW
Date
11/2014

◆ Duration() [2/3]

hdi::core::Duration::Duration ( const Duration d_)

Constructs a Duration object from another existing Duration object.

Author
GW
Date
11/2014
Parameters
d_Existing object to copy values from

◆ Duration() [3/3]

hdi::core::Duration::Duration ( const int64_t  secs_,
const int32_t  us_ = 0 
)

Constructs a Duration object with a given number of seconds.

Author
GW
Date
11/2014
Parameters
secs_Number of seconds in the duration
us_Number of microseconds, in additions to secs_, in the duration

◆ ~Duration()

virtual hdi::core::Duration::~Duration ( )
virtual

Destructs a Duration object.

Author
GW
Date
11/2014

Member Function Documentation

◆ days()

virtual double hdi::core::Duration::days ( ) const
virtual

Number of days in the duration.

Author
GW
Date
11/2014
Returns
The number of days in the duration

◆ Days()

static Duration hdi::core::Duration::Days ( const int64_t  days_)
static

Creates a Duration object for a given number of days.

Author
GW
Date
11/2014
Parameters
days_Number of days in the duration
Returns
New Duration object for the given days

◆ hours()

virtual double hdi::core::Duration::hours ( ) const
virtual

Number of hours in the duration.

Author
GW
Date
11/2014
Returns
The number of hours in the duration

◆ Hours()

static Duration hdi::core::Duration::Hours ( const int64_t  hours_)
static

Creates a Duration object for a given number of hours.

Author
GW
Date
11/2014
Parameters
hours_Number of hours in the duration
Returns
New Duration object for the given hours

◆ minutes()

virtual double hdi::core::Duration::minutes ( ) const
virtual

Number of minutes in the duration.

Author
GW
Date
11/2014
Returns
The number of minutes in the duration

◆ Minutes()

static Duration hdi::core::Duration::Minutes ( const int64_t  mins_)
static

Creates a Duration object for a given number of minutes.

Author
GW
Date
11/2014
Parameters
mins_Number of minutes in the duration
Returns
New Duration object for the given minutes

◆ operator!=()

virtual bool hdi::core::Duration::operator!= ( const Duration rhs_) const
virtual

Overloaded inequality operator to determine if two Duration objects differ.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator; Duration object to compare
Returns
true if the two objects represent different durations of time

◆ operator*()

virtual Duration hdi::core::Duration::operator* ( const double  rhs_) const
virtual

Overloaded multiplication operator to multiply a duration by a constant.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator, constant to multiply by
Returns
The new duration

◆ operator*=()

virtual Duration & hdi::core::Duration::operator*= ( const double  rhs_)
virtual

Overloaded multiplication-assignment operator to multiply and assign the resultant Duration.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator, constant to multiply by
Returns
The target Duration object, but with its values updated to reflect the multiplication of the given constant

◆ operator+()

virtual Duration hdi::core::Duration::operator+ ( const Duration rhs_) const
virtual

Overloaded addition operator to add one duration to another.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator, Duration object to add to the lefthand side
Returns
The new duration

◆ operator+=()

virtual Duration & hdi::core::Duration::operator+= ( const Duration rhs_)
virtual

Overloaded addition-assignment operator to add and assign the resultant Duration.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator, Duration object to add to the lefthand side
Returns
The target Duration object, but with its values updated to reflect the addition of the given duration

◆ operator-() [1/2]

virtual Duration hdi::core::Duration::operator- ( ) const
virtual

Overloaded unary minus operator, to flip the sign of the target Duration object.

Author
GW
Date
11/2014
Returns
The same duration of time as the target, but with an opposite sign

◆ operator-() [2/2]

virtual Duration hdi::core::Duration::operator- ( const Duration rhs_) const
virtual

Overloaded subtraction operator to substract one duration from another.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator, Duration object to "substract" from the lefthand side
Returns
The new duration

◆ operator-=()

virtual Duration & hdi::core::Duration::operator-= ( const Duration rhs_)
virtual

Overloaded subtraction-assignment operator to subtract and assign the resultant Duration.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator, Duration object to substract from the lefthand side
Returns
The target Duration object, but with its values updated to reflect the substraction of the given duration

◆ operator/()

virtual Duration hdi::core::Duration::operator/ ( const double  rhs_) const
virtual

Overloaded division operator to divide a duration by a constant.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator, constant to divide by
Returns
The new duration

◆ operator/=()

virtual Duration & hdi::core::Duration::operator/= ( const double  rhs_)
virtual

Overloaded division-assignment operator to divide and assign the resultant Duration.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator, constant to divide by
Returns
The target Duration object, but with its values updated to reflect the division of the given constant

◆ operator<()

virtual bool hdi::core::Duration::operator< ( const Duration rhs_) const
virtual

Overloaded less-than operator to determine if one Duration object is less than the other.

Author
GW
Date
02/2015
Parameters
rhs_Righthand side of the operator; Duration object that might be greater than the target (i.e. lefthand side)
Returns
true if the target (i.e. lefthand side) represents a duration less than rhs_

◆ operator<=()

virtual bool hdi::core::Duration::operator<= ( const Duration rhs_) const
virtual

Overloaded less-than-or-equal operator to determine if one Duration object is less than, or equal to, the other.

Author
GW
Date
02/2015
Parameters
rhs_Righthand side of the operator; Duration object that might be greater than, or equal to, the target (i.e. lefthand side)
Returns
true if the target (i.e. lefthand side) represents a duration less than, or equal to, rhs_

◆ operator=()

virtual Duration & hdi::core::Duration::operator= ( const Duration rhs_)
virtual

Overloaded assignment operator to copy values from one Duration object to another.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator; Duration object to copy values from
Returns
The target Duration object, but with values updated to match that of rhs_

◆ operator==()

virtual bool hdi::core::Duration::operator== ( const Duration rhs_) const
virtual

Overloaded equality operator to determine if two Duration objects are equal.

Author
GW
Date
11/2014
Parameters
rhs_Righthand side of the operator; Duration object to compare
Returns
true if the two objects represent the duration of time

◆ operator>()

virtual bool hdi::core::Duration::operator> ( const Duration rhs_) const
virtual

Overloaded greater-than operator to determine if one Duration object is greater than the other.

Author
GW
Date
02/2015
Parameters
rhs_Righthand side of the operator; Duration object that might be less than the target (i.e. lefthand side)
Returns
true if the target (i.e. lefthand side) represents a duration greater than rhs_

◆ operator>=()

virtual bool hdi::core::Duration::operator>= ( const Duration rhs_) const
virtual

Overloaded greater-than-or-equal operator to determine if one Duration object is greater than, or equal to, the other.

Author
GW
Date
02/2015
Parameters
rhs_Righthand side of the operator; Duration object that might be less than, or equal to, the target (i.e. lefthand side)
Returns
true if the target (i.e. lefthand side) represents a duration greater than, or equal to, rhs_

◆ seconds()

virtual double hdi::core::Duration::seconds ( ) const
virtual

Number of seconds in the duration.

Author
GW
Date
11/2014
Returns
The number of seconds in the duration

◆ TimeZoneOffset()

static Duration hdi::core::Duration::TimeZoneOffset ( )
static

Creates a Duration object for the system's time zone offset.

Author
GW
Date
12/2014
Returns
New Duration object for the system time zone
Note
This is useful when constructing a DateTime object using DateTime::Current() as the current time will always be reported in UTC.

◆ years()

virtual double hdi::core::Duration::years ( ) const
virtual

Number of years in the duration.

Author
GW
Date
11/2014
Returns
The number of years in the duration

◆ Years()

static Duration hdi::core::Duration::Years ( const int64_t  years_)
static

Creates a Duration object for a given number of years.

Author
GW
Date
11/2014
Parameters
years_Number of years in the duration
Returns
New Duration object for the given years