TDWTime Struct Reference

Structure for time type. 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 time value is valid.
bool operator!= (const TDWTime &in_time) const
 Overloaded != operator.
TDWHourSecondInterval operator- (const TDWTime &in_time) const
 Overloaded - (subtract) operator.
bool operator< (const TDWTime &in_time) const
 Overloaded < operator.
bool operator<= (const TDWTime &in_time) const
 Overloaded <= operator.
bool operator== (const TDWTime &in_time) const
 Overloaded == operator.
bool operator> (const TDWTime &in_time) const
 Overloaded > operator.
bool operator>= (const TDWTime &in_time) const
 Overloaded >= operator.
void Set (const simba_wstring &in_value, bool in_throwOnError)
 Sets the time with the given string value.
void Set (const simba_string &in_value, bool in_throwOnError)
 Sets the time with the given string value.
void Set (const simba_char *in_value, simba_size_t in_length, bool in_throwOnError)
 Sets the time with the given string value.
void Set (const simba_char *in_value, bool in_throwOnError)
 Sets the time with the given string value.
 TDWTime (const simba_wstring &in_value, bool in_throwOnError=true)
 Constructor.
 TDWTime (const simba_string &in_value, bool in_throwOnError=true)
 Constructor.
 TDWTime (const simba_char *in_value, simba_size_t in_length, bool in_throwOnError=true)
 Constructor.
 TDWTime (const simba_char *in_value, bool in_throwOnError=true)
 Constructor.
 TDWTime (simba_uint16 in_hour, simba_uint16 in_minute, simba_uint16 in_second, simba_uint32 in_fraction=0)
 Constructor.
 TDWTime ()
 Constructor.
simba_string ToString (simba_uint16 in_precision=0, bool in_keepZeroFraction=false) const
 Get a string representation of the time.

Static Public Member Functions

static simba_size_t AppendFractionString (simba_uint32 in_fraction, simba_uint16 in_precision, simba_char *out_buffer, simba_size_t in_bufferSize, bool in_keepZeroFraction)
 Append Fractional Seconds of the time if it is non-zero.
static bool Validate (simba_uint16 in_hour, simba_uint16 in_minute, simba_uint16 in_second, simba_uint32 in_fraction=0)
 Determine if the specified time is valid.

Public Attributes

simba_uint32 Fraction
 The fractions of seconds of the time. [0-999999999].
simba_uint16 Hour
 The hour of the time. [0-23].
simba_uint16 Minute
 The minutes of the time. [0-59].
simba_uint16 Second
 The seconds of the time. [0-61].

Detailed Description

Structure for time type.

This structure is used for SQL_TYPE_TIME and SQL_C_TYPE_TIME.


Constructor & Destructor Documentation

TDWTime (  ) 

Constructor.

TDWTime ( simba_uint16  in_hour,
simba_uint16  in_minute,
simba_uint16  in_second,
simba_uint32  in_fraction = 0 
)

Constructor.

Parameters:
in_hour The hour of the time, starting from 0.
in_minute The minute of the time, starting from 0.
in_second The second of the time, starting from 0.
in_fraction The fractional seconds of the time. (Default is 0)
TDWTime ( const simba_char in_value,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The time as a NULL-terminated string in the format hh:mm:ss(.fffffffff) (NOT OWN)
in_throwOnError True to throw an exception on error; false otherwise.
TDWTime ( const simba_char in_value,
simba_size_t  in_length,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The time as a string in the format hh:mm:ss(.fffffffff) (NOT OWN)
in_length The length of the string in characters.
in_throwOnError True to throw an exception on error; false otherwise.
TDWTime ( const simba_string in_value,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The time as a string in the format hh:mm:ss(.fffffffff)
in_throwOnError True to throw an exception on error; false otherwise.
TDWTime ( const simba_wstring in_value,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The time as a string in the format hh:mm:ss(.fffffffff)
in_throwOnError True to throw an exception on error; false otherwise.

Member Function Documentation

static simba_size_t AppendFractionString ( simba_uint32  in_fraction,
simba_uint16  in_precision,
simba_char out_buffer,
simba_size_t  in_bufferSize,
bool  in_keepZeroFraction 
) [static]

Append Fractional Seconds of the time if it is non-zero.

The format will be '12345', the string buffer will be null-terminated

Parameters:
in_fraction the fractional seconds to convert to string
in_precision The fractional seconds precision to use when formatting the string.
in_keepZeroFraction whether to keep zero fraction in converted string
Returns:
the number of bytes appended
simba_uint64 Hash ( const simba_byte in_buffer,
simba_uint32  in_seed 
) const

Get the hash code for the given data.

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 time value is valid.

Returns:
True if valid; false otherwise.
bool operator!= ( const TDWTime in_time  )  const

Overloaded != operator.

TDWHourSecondInterval operator- ( const TDWTime in_time  )  const

Overloaded - (subtract) operator.

bool operator< ( const TDWTime in_time  )  const

Overloaded < operator.

bool operator<= ( const TDWTime in_time  )  const

Overloaded <= operator.

bool operator== ( const TDWTime in_time  )  const

Overloaded == operator.

bool operator> ( const TDWTime in_time  )  const

Overloaded > operator.

bool operator>= ( const TDWTime in_time  )  const

Overloaded >= operator.

void Set ( const simba_wstring in_value,
bool  in_throwOnError 
)

Sets the time with the given string value.

Parameters:
in_value The string value in the format of hh:mm:ss(.fffffffff)
in_throwOnError True to throw an exception on error; false otherwise.
void Set ( const simba_string in_value,
bool  in_throwOnError 
)

Sets the time with the given string value.

Parameters:
in_value The string value in the format of hh:mm:ss(.fffffffff)
in_throwOnError True to throw an exception on error; false otherwise.
void Set ( const simba_char in_value,
simba_size_t  in_length,
bool  in_throwOnError 
)

Sets the time with the given string value.

Parameters:
in_value The string value in the format of hh:mm:ss(.fffffffff) (NOT OWN)
in_length The length of the string in characters.
in_throwOnError True to throw an exception on error; false otherwise.
void Set ( const simba_char in_value,
bool  in_throwOnError 
)

Sets the time with the given string value.

Parameters:
in_value The string value in the format of hh:mm:ss(.fffffffff) (NOT OWN)
in_throwOnError True to throw an exception on error; false otherwise.
simba_string ToString ( simba_uint16  in_precision = 0,
bool  in_keepZeroFraction = false 
) const

Get a string representation of the time.

The format will be hh:mm:ss(.fffffffff)

Parameters:
in_precision The fractional seconds precision to use when formatting the string.
Returns:
The string representation of the time.
static bool Validate ( simba_uint16  in_hour,
simba_uint16  in_minute,
simba_uint16  in_second,
simba_uint32  in_fraction = 0 
) [static]

Determine if the specified time is valid.

Parameters:
in_hour The hour of the specified time.
in_minute The minute of the specified time.
in_second The second of the specified time.
in_fraction The fraction of the specified time.
Returns:
True if valid; false otherwise.

Member Data Documentation

The fractions of seconds of the time. [0-999999999].

Note that this is always given as nano-second precision. If the actual precision of the data is less, then the value of the fraction should be padded with zeros. For instance, with a precision of 3, the value "123" should be represented as 123000000.

The hour of the time. [0-23].

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

The seconds of the time. [0-61].


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