TDWSecondInterval Struct Reference

Structure for second interval type. More...

List of all members.

Public Member Functions

TDWSecondInterval Add (const TDWSecondInterval &in_interval, simba_int16 in_precision) const
 Addition operator which takes a fractional precision.
TDWSecondInterval Divide (const TDWExactNumericType &in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWSecondInterval Divide (simba_double64 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWSecondInterval Divide (simba_double32 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWSecondInterval Divide (simba_int64 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWSecondInterval Divide (simba_uint64 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWSecondInterval Divide (simba_int32 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWSecondInterval Divide (simba_uint32 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWSecondInterval Divide (simba_int16 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWSecondInterval Divide (simba_uint16 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWSecondInterval Divide (simba_int8 in_value, simba_int16 in_precision) const
 Division operator which takes a fractional precision.
TDWSecondInterval 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.
TDWSecondInterval Multiply (const TDWExactNumericType &in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWSecondInterval Multiply (simba_double64 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWSecondInterval Multiply (simba_double32 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWSecondInterval Multiply (simba_int64 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWSecondInterval Multiply (simba_uint64 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWSecondInterval Multiply (simba_int32 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWSecondInterval Multiply (simba_uint32 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWSecondInterval Multiply (simba_int16 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWSecondInterval Multiply (simba_uint16 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWSecondInterval Multiply (simba_int8 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
TDWSecondInterval Multiply (simba_uint8 in_value, simba_int16 in_precision) const
 Multiplication operator which takes a fractional precision.
bool operator!= (const TDWSecondInterval &in_interval) const
 Overloaded != operator.
TDWSecondIntervaloperator- ()
 Overloaded - (negate) operator.
bool operator< (const TDWSecondInterval &in_interval) const
 Overloaded < operator.
bool operator<= (const TDWSecondInterval &in_interval) const
 Overloaded <= operator.
bool operator== (const TDWSecondInterval &in_interval) const
 Overloaded == operator.
bool operator> (const TDWSecondInterval &in_interval) const
 Overloaded > operator.
bool operator>= (const TDWSecondInterval &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.
TDWSecondInterval Subtract (const TDWSecondInterval &in_interval, simba_int16 in_precision) const
 Subtraction operator which takes a fractional precision.
 TDWSecondInterval (const simba_wstring &in_value, simba_uint32 in_leadingPrecision, simba_uint32 in_fractionalPrecision, bool in_throwOnError=true)
 Constructor.
 TDWSecondInterval (const simba_wstring &in_value, bool in_throwOnError=true)
 Constructor.
 TDWSecondInterval (const simba_string &in_value, bool in_throwOnError=true)
 Constructor.
 TDWSecondInterval (const simba_char *in_value, simba_size_t in_length, bool in_throwOnError=true)
 Constructor.
 TDWSecondInterval (const simba_char *in_value, bool in_throwOnError=true)
 Constructor.
 TDWSecondInterval (simba_uint32 in_second, simba_uint32 in_fraction, bool in_isNegative=false)
 Constructor.
 TDWSecondInterval ()
 Constructor.
simba_string ToString (simba_uint16 in_precision) const
 Return a string representation of the TDWSecondInterval.
simba_string ToString () const
 Return a string representation of the TDWSecondInterval.

Static Public Member Functions

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

Public Attributes

simba_uint32 Fraction
 The seconds fraction of the interval.
bool IsNegative
 Flag indicating if the interval is negative.
simba_uint32 Second
 The seconds of the interval. [0, 999999999].

Detailed Description

Structure for second interval type.

This structure is used for SQL_INTERVAL_SECOND.

The Second is constrained to [0, 999999999]. To indicate a negative interval, set the IsNegative flag.


Constructor & Destructor Documentation

Constructor.

TDWSecondInterval ( simba_uint32  in_second,
simba_uint32  in_fraction,
bool  in_isNegative = false 
)

Constructor.

Parameters:
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.
TDWSecondInterval ( 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.
TDWSecondInterval ( 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.
TDWSecondInterval ( 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.
TDWSecondInterval ( 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.
TDWSecondInterval ( 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

TDWSecondInterval Add ( const TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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.
TDWSecondInterval 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 TDWSecondInterval in_interval  )  const

Overloaded != operator.

TDWSecondInterval& operator- (  ) 

Overloaded - (negate) operator.

bool operator< ( const TDWSecondInterval in_interval  )  const

Overloaded < operator.

bool operator<= ( const TDWSecondInterval in_interval  )  const

Overloaded <= operator.

bool operator== ( const TDWSecondInterval in_interval  )  const

Overloaded == operator.

bool operator> ( const TDWSecondInterval in_interval  )  const

Overloaded > operator.

bool operator>= ( const TDWSecondInterval 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.

TDWSecondInterval Subtract ( const TDWSecondInterval 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 TDWSecondInterval.

The format is [-]SS[.fffffffff].

Note that there may be more or less than 2 digits for the seconds, depending on the value of Second.

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 TDWSecondInterval.
simba_string ToString (  )  const

Return a string representation of the TDWSecondInterval.

The format is [-]SS[.fffffffff].

Note that there may be more or less than 2 digits for the seconds, depending on the value of Second.

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 TDWSecondInterval.
static bool Validate ( simba_uint32  in_second,
simba_uint32  in_fraction 
) [static]

Determine if the specified interval value is valid.

Parameters:
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 seconds fraction of the interval.

bool IsNegative

Flag indicating if the interval is negative.

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


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