TDWDaySecondInterval Struct Reference

Structure for day/second interval type. More...

List of all members.

Public Member Functions

TDWDaySecondInterval Add (const TDWDaySecondInterval &in_interval, simba_int16 in_precision) const
 Addition operator which takes a fractional precision.
TDWDaySecondInterval Divide (const TDWExactNumericType &in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWDaySecondInterval Divide (simba_double64 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWDaySecondInterval Divide (simba_double32 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWDaySecondInterval Divide (simba_int64 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWDaySecondInterval Divide (simba_uint64 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWDaySecondInterval Divide (simba_int32 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWDaySecondInterval Divide (simba_uint32 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWDaySecondInterval Divide (simba_int16 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWDaySecondInterval Divide (simba_uint16 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWDaySecondInterval Divide (simba_int8 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWDaySecondInterval Divide (simba_uint8 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
simba_uint64 Hash (const simba_byte *in_buffer, simba_uint32 in_seed) const
 Get the hash code for the given data.
bool IsValid () const
 Determine if the currently stored interval value is valid.
TDWDaySecondInterval Multiply (const TDWExactNumericType &in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWDaySecondInterval Multiply (simba_double64 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWDaySecondInterval Multiply (simba_double32 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWDaySecondInterval Multiply (simba_int64 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWDaySecondInterval Multiply (simba_uint64 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWDaySecondInterval Multiply (simba_int32 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWDaySecondInterval Multiply (simba_uint32 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWDaySecondInterval Multiply (simba_int16 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWDaySecondInterval Multiply (simba_uint16 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWDaySecondInterval Multiply (simba_int8 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWDaySecondInterval Multiply (simba_uint8 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
bool operator!= (const TDWDaySecondInterval &in_interval) const
 Overloaded != operator.
TDWDaySecondIntervaloperator- ()
 Overloaded - (negate) operator.
bool operator< (const TDWDaySecondInterval &in_interval) const
 Overloaded < operator.
bool operator<= (const TDWDaySecondInterval &in_interval) const
 Overloaded <= operator.
bool operator== (const TDWDaySecondInterval &in_interval) const
 Overloaded == operator.
bool operator> (const TDWDaySecondInterval &in_interval) const
 Overloaded > operator.
bool operator>= (const TDWDaySecondInterval &in_interval) const
 Overloaded >= operator.
void Set (const simba_wstring &in_value, bool in_throwOnError=true)
 Set the current interval to the given wstring value.
void Set (const simba_string &in_value, bool in_throwOnError=true)
 Set the current interval to the given string value.
void Set (const simba_char *in_value, simba_size_t in_length, simba_uint32 in_leadingPrecision, simba_uint32 in_fractionalPrecision, bool in_throwOnError=true)
 Set the current interval to the given string value.
void Set (const simba_char *in_value, simba_size_t in_length, bool in_throwOnError=true)
 Set the current interval to the given string value.
void Set (const simba_char *in_value, bool in_throwOnError=true)
 Set the current interval to the given string value.
void SetToInvalidValue ()
 Set the current interval fields to invalid values.
TDWDaySecondInterval Subtract (const TDWDaySecondInterval &in_interval, simba_int16 in_precision) const
 Subtraction operator which takes a fractional precision.
 TDWDaySecondInterval (const simba_wstring &in_value, simba_uint32 in_leadingPrecision, simba_uint32 in_fractionalPrecision, bool in_throwOnError=true)
 Constructor.
 TDWDaySecondInterval (const simba_wstring &in_value, bool in_throwOnError=true)
 Constructor.
 TDWDaySecondInterval (const simba_string &in_value, bool in_throwOnError=true)
 Constructor.
 TDWDaySecondInterval (const simba_char *in_value, simba_size_t in_length, bool in_throwOnError=true)
 Constructor.
 TDWDaySecondInterval (const simba_char *in_value, bool in_throwOnError=true)
 Constructor.
 TDWDaySecondInterval (simba_uint32 in_day, simba_uint32 in_hour, simba_uint32 in_minute, simba_uint32 in_second, simba_uint32 in_fraction, bool in_isNegative=false)
 Constructor.
 TDWDaySecondInterval ()
 Constructor.
simba_string ToString (simba_uint16 in_precision) const
 Return a string representation of the TDWDaySecondInterval.
simba_string ToString () const
 Return a string representation of the TDWDaySecondInterval.

Static Public Member Functions

static bool Validate (simba_uint32 in_day, simba_uint32 in_hour, simba_uint32 in_minute, simba_uint32 in_second, simba_uint32 in_fraction)
 Determine if the specified interval value is valid.

Public Attributes

simba_uint32 Day
 The days of the interval. [0, 999999999].
simba_uint32 Fraction
 The seconds fraction of the interval.
simba_uint32 Hour
 The hours of the interval. [0-23].
bool IsNegative
 Flag indicating if the interval is negative.
simba_uint32 Minute
 The minutes of the interval. [0-59].
simba_uint32 Second
 The seconds of the interval. [0-59].

Detailed Description

Structure for day/second interval type.

This structure is used for SQL_INTERVAL_DAY_TO_SECOND.

The day is constrained to [0, 999999999]. The hour is constrained to [0, 23], as a value of 24 would increment the day portion. The minute is constrained to [0, 59], as a value of 60 would increment the hour portion. The second is constrained to [0, 59], as a value of 60 would increment the minute portion. To indicate a negative interval, set the IsNegative flag.


Constructor & Destructor Documentation

Constructor.

TDWDaySecondInterval ( simba_uint32  in_day,
simba_uint32  in_hour,
simba_uint32  in_minute,
simba_uint32  in_second,
simba_uint32  in_fraction,
bool  in_isNegative = false 
)

Constructor.

Parameters:
in_day The days of the interval.
in_hour The hours of the interval.
in_minute The minutes of the interval.
in_second The seconds of the interval.
in_fraction The seconds fraction of the interval.
in_isNegative True if the interval is negative; false otherwise.
TDWDaySecondInterval ( const simba_char in_value,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The NULL-terminated string value of the interval. (NOT OWN)
in_throwOnError True to throw if the value is invalid; false otherwise.
TDWDaySecondInterval ( const simba_char in_value,
simba_size_t  in_length,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The string value of the interval. (NOT OWN)
in_length The length of the string value.
in_throwOnError True to throw if the value is invalid; false otherwise.
TDWDaySecondInterval ( const simba_string in_value,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The string value of the interval.
in_throwOnError True to throw if the value is invalid; false otherwise.
TDWDaySecondInterval ( const simba_wstring in_value,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The string value of the interval.
in_throwOnError True to throw if the value is invalid; false otherwise.
TDWDaySecondInterval ( const simba_wstring in_value,
simba_uint32  in_leadingPrecision,
simba_uint32  in_fractionalPrecision,
bool  in_throwOnError = true 
)

Constructor.

The fractional seconds will be adjusted to the given fractional precision, and validation will be done to ensure the leading and fractional fields are within the specified precision.

Parameters:
in_value The string value of the interval.
in_leadingPrecision The specified leading field precision
in_fractionalPrecision The specified fractional seconds precision
in_throwOnError True to throw if the value is invalid; false otherwise.

Member Function Documentation

TDWDaySecondInterval Add ( const TDWDaySecondInterval in_interval,
simba_int16  in_precision 
) const

Addition operator which takes a fractional precision.

Parameters:
in_interval The value to add to this interval.
in_precision The fractional precision to use.
Returns:
The result of the addition.
TDWDaySecondInterval Divide ( const TDWExactNumericType in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Divide ( simba_double64  in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Divide ( simba_double32  in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Divide ( simba_int64  in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Divide ( simba_uint64  in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Divide ( simba_int32  in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Divide ( simba_uint32  in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Divide ( simba_int16  in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Divide ( simba_uint16  in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Divide ( simba_int8  in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Divide ( simba_uint8  in_value,
simba_int16  in_precision 
) const

Division operator which takes a fractional precision.

Parameters:
in_value The value to divide the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
simba_uint64 Hash ( const simba_byte in_buffer,
simba_uint32  in_seed 
) const

Get the hash code for the given data.

In the implementation we avoid hashing padded bytes due to alignment

Parameters:
in_buffer The data buffer. (NOT OWN)
in_seed The seed to use
Returns:
A hash code for the given data.
bool IsValid (  )  const

Determine if the currently stored interval value is valid.

Returns:
True if valid; false otherwise.
TDWDaySecondInterval Multiply ( const TDWExactNumericType in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Multiply ( simba_double64  in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Multiply ( simba_double32  in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Multiply ( simba_int64  in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Multiply ( simba_uint64  in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Multiply ( simba_int32  in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Multiply ( simba_uint32  in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Multiply ( simba_int16  in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Multiply ( simba_uint16  in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Multiply ( simba_int8  in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
TDWDaySecondInterval Multiply ( simba_uint8  in_value,
simba_int16  in_precision 
) const

Multiplication operator which takes a fractional precision.

Parameters:
in_value The value to multiply the interval by.
in_precision The fractional precision to use.
Returns:
The result of the multiplication.
bool operator!= ( const TDWDaySecondInterval in_interval  )  const

Overloaded != operator.

TDWDaySecondInterval& operator- (  ) 

Overloaded - (negate) operator.

bool operator< ( const TDWDaySecondInterval in_interval  )  const

Overloaded < operator.

bool operator<= ( const TDWDaySecondInterval in_interval  )  const

Overloaded <= operator.

bool operator== ( const TDWDaySecondInterval in_interval  )  const

Overloaded == operator.

bool operator> ( const TDWDaySecondInterval in_interval  )  const

Overloaded > operator.

bool operator>= ( const TDWDaySecondInterval in_interval  )  const

Overloaded >= operator.

void Set ( const simba_wstring in_value,
bool  in_throwOnError = true 
)

Set the current interval to the given wstring value.

Parameters:
in_value The value to set the interval to.
in_throwOnError True to throw if the value is invalid; false otherwise.
void Set ( const simba_string in_value,
bool  in_throwOnError = true 
)

Set the current interval to the given string value.

Parameters:
in_value The value to set the interval to.
in_throwOnError True to throw if the value is invalid; false otherwise.
void Set ( const simba_char in_value,
simba_size_t  in_length,
simba_uint32  in_leadingPrecision,
simba_uint32  in_fractionalPrecision,
bool  in_throwOnError = true 
)

Set the current interval to the given string value.

The fractional seconds will be adjusted to the given fractional precision, and validation will be done to ensure the leading and fractional fields are within the specified precision.

Parameters:
in_value The value to set the interval to. (NOT OWN)
in_length The length of the string value.
in_leadingPrecision The specified leading field precision
in_fractionalPrecision The specified fractional seconds precision
in_throwOnError True to throw if the value is invalid; false otherwise.
void Set ( const simba_char in_value,
simba_size_t  in_length,
bool  in_throwOnError = true 
)

Set the current interval to the given string value.

Parameters:
in_value The value to set the interval to. (NOT OWN)
in_length The length of the string value.
in_throwOnError True to throw if the value is invalid; false otherwise.
void Set ( const simba_char in_value,
bool  in_throwOnError = true 
)

Set the current interval to the given string value.

Parameters:
in_value The NULL-terminated string value of the interval. (NOT OWN)
in_throwOnError True to throw if the value is invalid; false otherwise.
void SetToInvalidValue (  ) 

Set the current interval fields to invalid values.

TDWDaySecondInterval Subtract ( const TDWDaySecondInterval in_interval,
simba_int16  in_precision 
) const

Subtraction operator which takes a fractional precision.

Parameters:
in_interval The value to subtract from this interval.
in_precision The fractional precision to use.
Returns:
The result of the subtraction.
simba_string ToString ( simba_uint16  in_precision  )  const

Return a string representation of the TDWDaySecondInterval.

The format is [-]D HH:MM:SS[.fffffffff].

Note that there may be more or less than 1 digit for the day, depending on the value of Day.

This function is provided for convenience, not efficiency.

Parameters:
in_precision The precision of the fractions component. Controls left padding of zeros. If in_precision is less than the number of digits in the fraction, the fraction will be truncated.
Returns:
The string representation of the TDWDaySecondInterval.
simba_string ToString (  )  const

Return a string representation of the TDWDaySecondInterval.

The format is [-]D HH:MM:SS[.fffffffff].

Note that there may be more or less than 1 digit for the day, depending on the value of Day.

The precision of the fractional component will be taken as the number of digits in the fraction.

This function is provided for convenience, not efficiency.

Returns:
The string representation of the TDWDaySecondInterval.
static bool Validate ( simba_uint32  in_day,
simba_uint32  in_hour,
simba_uint32  in_minute,
simba_uint32  in_second,
simba_uint32  in_fraction 
) [static]

Determine if the specified interval value is valid.

Parameters:
in_day The days of the interval.
in_hour The hours of the interval.
in_minute The minutes of the interval.
in_second The seconds of the interval.
in_fraction The seconds fraction of the interval.
Returns:
True if valid; false otherwise.

Member Data Documentation

The days of the interval. [0, 999999999].

The seconds fraction of the interval.

The hours of the interval. [0-23].

bool IsNegative

Flag indicating if the interval is negative.

The minutes of the interval. [0-59].

The seconds of the interval. [0-59].


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

Generated on Wed May 17 14:21:19 2017 for SimbaEngine 10.1.3.1011 by simba