TDWYearMonthInterval Struct Reference

Structure for year/month interval type, adapted from SQL_YEAR_MONTH_STRUCT in sqltypes.h. More...

List of all members.

Public Member Functions

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.
bool operator!= (const TDWYearMonthInterval &in_interval) const
 Overloaded != operator.
TDWYearMonthInterval operator* (const TDWExactNumericType &in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator* (simba_double64 in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator* (simba_double32 in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator* (simba_int64 in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator* (simba_uint64 in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator* (simba_int32 in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator* (simba_uint32 in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator* (simba_int16 in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator* (simba_uint16 in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator* (simba_int8 in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator* (simba_uint8 in_value) const
 Overloaded * operator.
TDWYearMonthInterval operator+ (const TDWYearMonthInterval &in_interval) const
 Overloaded + operator.
TDWYearMonthIntervaloperator+= (const TDWYearMonthInterval &in_interval)
 Overloaded += operator.
TDWYearMonthInterval operator- (const TDWYearMonthInterval &in_interval) const
 Overloaded - operator.
TDWYearMonthIntervaloperator- ()
 Overloaded - (negate) operator.
TDWYearMonthInterval operator/ (const TDWExactNumericType &in_value) const
 Overloaded / operator.
TDWYearMonthInterval operator/ (simba_double64 in_value) const
 Overloaded / operator.
TDWYearMonthInterval operator/ (simba_double32 in_value) const
 Overloaded / operator.
TDWYearMonthInterval operator/ (simba_int64 in_value) const
 Overloaded / operator.
TDWYearMonthInterval operator/ (simba_uint64 in_value) const
 Overloaded / operator.
TDWYearMonthInterval operator/ (simba_int32 in_value) const
 Overloaded / operator.
TDWYearMonthInterval operator/ (simba_uint32 in_value) const
 Overloaded / operator.
TDWYearMonthInterval operator/ (simba_int16 in_value) const
 Overloaded / operator.
TDWYearMonthInterval operator/ (simba_uint16 in_value) const
 Overloaded / operator.
TDWYearMonthInterval operator/ (simba_int8 in_value) const
 Overloaded / operator.
TDWYearMonthInterval operator/ (simba_uint8 in_value) const
 Overloaded / operator.
bool operator< (const TDWYearMonthInterval &in_interval) const
 Overloaded < operator.
bool operator<= (const TDWYearMonthInterval &in_interval) const
 Overloaded <= operator.
bool operator== (const TDWYearMonthInterval &in_interval) const
 Overloaded == operator.
bool operator> (const TDWYearMonthInterval &in_interval) const
 Overloaded > operator.
bool operator>= (const TDWYearMonthInterval &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_char *in_value, simba_size_t in_length, simba_uint32 in_leadingFieldPrecision, bool in_throwOnError=true)
 Set the current interval to the given string 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, 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.
 TDWYearMonthInterval (const simba_wstring &in_value, simba_uint32 in_leadingFieldPrecision, bool in_throwOnError=true)
 Constructor.
 TDWYearMonthInterval (const simba_wstring &in_value, bool in_throwOnError=true)
 Constructor.
 TDWYearMonthInterval (const simba_string &in_value, bool in_throwOnError=true)
 Constructor.
 TDWYearMonthInterval (const simba_char *in_value, simba_size_t in_length, bool in_throwOnError=true)
 Constructor.
 TDWYearMonthInterval (const simba_char *in_value, bool in_throwOnError=true)
 Constructor.
 TDWYearMonthInterval (simba_uint32 in_year, simba_uint32 in_month, bool in_isNegative=false)
 Constructor.
 TDWYearMonthInterval ()
 Constructor.
simba_string ToString () const
 Return a string representation of the TDWYearMonthInterval.

Static Public Member Functions

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

Public Attributes

bool IsNegative
 Flag indicating if the interval is negative.
simba_uint32 Month
 The months of the interval [0-11].
simba_uint32 Year
 The years of the interval. [0, 999999999].

Detailed Description

Structure for year/month interval type, adapted from SQL_YEAR_MONTH_STRUCT in sqltypes.h.

This structure is used for SQL_INTERVAL_YEAR_TO_MONTH.

The year is constrained to [0, 999999999]. The month is constrained to [0, 11], as a value of 12 would increment the year portion. To indicate a negative interval, set the IsNegative flag.


Constructor & Destructor Documentation

Constructor.

TDWYearMonthInterval ( simba_uint32  in_year,
simba_uint32  in_month,
bool  in_isNegative = false 
)

Constructor.

Parameters:
in_year The year of the interval.
in_month The month of the interval.
in_isNegative True if the interval is negative; false otherwise.
TDWYearMonthInterval ( 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.
TDWYearMonthInterval ( 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.
TDWYearMonthInterval ( 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.
TDWYearMonthInterval ( 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.
TDWYearMonthInterval ( const simba_wstring in_value,
simba_uint32  in_leadingFieldPrecision,
bool  in_throwOnError = true 
)

Constructor.

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

Member Function Documentation

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.
bool operator!= ( const TDWYearMonthInterval in_interval  )  const

Overloaded != operator.

TDWYearMonthInterval operator* ( const TDWExactNumericType in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator* ( simba_double64  in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator* ( simba_double32  in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator* ( simba_int64  in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator* ( simba_uint64  in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator* ( simba_int32  in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator* ( simba_uint32  in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator* ( simba_int16  in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator* ( simba_uint16  in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator* ( simba_int8  in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator* ( simba_uint8  in_value  )  const

Overloaded * operator.

TDWYearMonthInterval operator+ ( const TDWYearMonthInterval in_interval  )  const

Overloaded + operator.

TDWYearMonthInterval& operator+= ( const TDWYearMonthInterval in_interval  ) 

Overloaded += operator.

TDWYearMonthInterval operator- ( const TDWYearMonthInterval in_interval  )  const

Overloaded - operator.

TDWYearMonthInterval& operator- (  ) 

Overloaded - (negate) operator.

TDWYearMonthInterval operator/ ( const TDWExactNumericType in_value  )  const

Overloaded / operator.

TDWYearMonthInterval operator/ ( simba_double64  in_value  )  const

Overloaded / operator.

TDWYearMonthInterval operator/ ( simba_double32  in_value  )  const

Overloaded / operator.

TDWYearMonthInterval operator/ ( simba_int64  in_value  )  const

Overloaded / operator.

TDWYearMonthInterval operator/ ( simba_uint64  in_value  )  const

Overloaded / operator.

TDWYearMonthInterval operator/ ( simba_int32  in_value  )  const

Overloaded / operator.

TDWYearMonthInterval operator/ ( simba_uint32  in_value  )  const

Overloaded / operator.

TDWYearMonthInterval operator/ ( simba_int16  in_value  )  const

Overloaded / operator.

TDWYearMonthInterval operator/ ( simba_uint16  in_value  )  const

Overloaded / operator.

TDWYearMonthInterval operator/ ( simba_int8  in_value  )  const

Overloaded / operator.

TDWYearMonthInterval operator/ ( simba_uint8  in_value  )  const

Overloaded / operator.

bool operator< ( const TDWYearMonthInterval in_interval  )  const

Overloaded < operator.

bool operator<= ( const TDWYearMonthInterval in_interval  )  const

Overloaded <= operator.

bool operator== ( const TDWYearMonthInterval in_interval  )  const

Overloaded == operator.

bool operator> ( const TDWYearMonthInterval in_interval  )  const

Overloaded > operator.

bool operator>= ( const TDWYearMonthInterval 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_char in_value,
simba_size_t  in_length,
simba_uint32  in_leadingFieldPrecision,
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_leadingFieldPrecision The specified leading field precision
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,
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.

simba_string ToString (  )  const

Return a string representation of the TDWYearMonthInterval.

The format will be [-]YYYY-MM.

Note that there may be more or less than 4 digits for the year, depending on the value of Year.

This function is provided for convenience, not efficiency.

Returns:
The string representation of the TDWYearMonthInterval.
static bool Validate ( simba_uint32  in_year,
simba_uint32  in_month 
) [static]

Determine if the specified interval value is valid.

Parameters:
in_year The year of the interval.
in_month The month of the interval.
Returns:
True if valid; false otherwise.

Member Data Documentation

bool IsNegative

Flag indicating if the interval is negative.

The months of the interval [0-11].

The years 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