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

Static Public Member Functions

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

Friends

class Date
 
class DateTime
 
class Time
 

Detailed Description

Allows for acquisition and manipulation of a duration of time.

Constructor & Destructor Documentation

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

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

Author
GW
Date
11/2014
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
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
virtual hdi::core::Duration::~Duration ( )
virtual

Destructs a Duration object.

Author
GW
Date
11/2014

Member Function Documentation

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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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_
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_
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_
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
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_
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_
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
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.
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
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