Class SBDTypeDateTime#
This class implements the date time management. More...
#include <SBDTypeDateTime.hpp>
Public Functions#
| Type | Name |
|---|---|
| SBDTypeDateTime () Constructs a date time. |
|
| SBDTypeDateTime (unsigned long long millisecondsSinceEpoch) Constructs a date time. |
|
| SBDTypeDateTime (const SBDTypeDateTime & dateTime) Copy constructor. |
|
| SBDTypeDateTime (SBDTypeDateTime && dateTime) noexcept Move constructor. |
|
| unsigned long long | getMillisecondsSinceEpoch () const Returns the number of milliseconds since Epoch. |
| bool | isSerializable () const Returns true __ |
| bool | operator!= (const SBDTypeDateTime & color) const The inequality operator. |
| bool | operator< (const SBDTypeDateTime & color) const The "less than" operator. |
| bool | operator<= (const SBDTypeDateTime & color) const The "less or equal than" operator. |
| SBDTypeDateTime & | operator= (const SBDTypeDateTime & color) Copy assignment. |
| SBDTypeDateTime & | operator= (SBDTypeDateTime && color) noexcept Move assignment. |
| bool | operator== (const SBDTypeDateTime & color) const The equality operator. |
| bool | operator> (const SBDTypeDateTime & color) const The "greater than" operator. |
| bool | operator>= (const SBDTypeDateTime & color) const The "greater or equal than" operator. |
| virtual void | print (unsigned int offset=0) const Prints the date time. |
| void | serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) const Serializes the color. |
| void | setMillisecondsSinceEpoch (unsigned long long millisecondsSinceEpoch) Sets the number of milliseconds since Epoch. |
| void | unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) Unserializes the color. |
| virtual | ~SBDTypeDateTime () Destructs the date time. |
Public Static Functions#
| Type | Name |
|---|---|
| SBDTypeDateTime | currentDateTimeUTC () Returns the current date time in UTC. |
Protected Attributes#
| Type | Name |
|---|---|
| SBDTypeDateTimeData * | dataPointer A pointer to the private data. |
Detailed Description#
Short name: SBDateTime
Public Functions Documentation#
function SBDTypeDateTime [1/4]#
Constructs a date time.
Constructs a date-time object with the default epoch value.
Initializes the object to represent the Unix epoch (0 milliseconds since the epoch).
function SBDTypeDateTime [2/4]#
Constructs a date time.
Constructs a date-time object with the specified milliseconds since the Unix epoch.
Parameters:
millisecondsSinceEpochThe number of milliseconds since the Unix epoch.
function SBDTypeDateTime [3/4]#
Copy constructor.
Constructs a date-time object as a copy of another.
Parameters:
dateTimeThe source date-time object to copy from.
function SBDTypeDateTime [4/4]#
Move constructor.
Constructs a date-time object by moving resources from another object.
Parameters:
dateTimeThe source date-time object to move from. Note: The source object is left in a valid but unspecified state.
function getMillisecondsSinceEpoch#
Returns the number of milliseconds since Epoch.
Retrieves the number of milliseconds elapsed since the Unix epoch.
Returns:
The milliseconds since epoch.
function isSerializable#
Returns true __
Indicates whether the date-time type supports serialization.
Returns:
true indicating the type can be serialized.
function operator!=#
The inequality operator.
Checks whether two date-time objects are not equal.
Parameters:
dateTimeThe date-time object to compare with.
Returns:
true if the objects represent different points in time; otherwise false.
function operator<#
The "less than" operator.
Determines whether this date-time is earlier than another.
Parameters:
dateTimeThe date-time object to compare with.
Returns:
true if this object represents an earlier point in time; otherwise false.
function operator<=#
The "less or equal than" operator.
Determines whether this date-time is earlier than or equal to another.
Parameters:
dateTimeThe date-time object to compare with.
Returns:
true if this object represents an earlier or equal point in time; otherwise false.
function operator=#
Copy assignment.
Assigns the value of another date-time object to this object.
Parameters:
dateTimeThe source date-time object to assign from.
Returns:
A reference to this date-time object.
function operator=#
Move assignment.
Moves the value of another date-time object to this object.
Parameters:
dateTimeThe source date-time object to move from.
Returns:
A reference to this date-time object.
function operator==#
The equality operator.
Checks whether two date-time objects are equal.
Parameters:
dateTimeThe date-time object to compare with.
Returns:
true if both objects represent the same point in time; otherwise false.
function operator>#
The "greater than" operator.
Determines whether this date-time is later than another.
Parameters:
dateTimeThe date-time object to compare with.
Returns:
true if this object represents a later point in time; otherwise false.
function operator>=#
The "greater or equal than" operator.
Determines whether this date-time is later than or equal to another.
Parameters:
dateTimeThe date-time object to compare with.
Returns:
true if this object represents a later or equal point in time; otherwise false.
function print#
Prints the date time.
Prints the date-time in a human-readable UTC format.
Parameters:
offsetThe number of tab characters to prepend before the output.
function serialize#
Serializes the color.
void SBDTypeDateTime::serialize (
SBCSerializer * serializer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const
Serializes the date-time object's state to a serializer.
Parameters:
serializerThe serializer to write data to.sdkVersionNumberThe SDK version number for compatibility.
The function writes the milliseconds since epoch to the serializer.
function setMillisecondsSinceEpoch#
Sets the number of milliseconds since Epoch.
Sets the number of milliseconds elapsed since the Unix epoch.
Parameters:
millisecondsSinceEpochThe new milliseconds value.
function unserialize#
Unserializes the color.
void SBDTypeDateTime::unserialize (
SBCSerializer * serializer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
)
Deserializes the date-time object's state from a serializer.
Parameters:
serializerThe serializer to read data from.sdkVersionNumberThe SDK version number for compatibility.
The function reads the milliseconds since epoch from the serializer.
function ~SBDTypeDateTime#
Destructs the date time.
Destroys the date-time object and releases associated resources.
Public Static Functions Documentation#
function currentDateTimeUTC#
Returns the current date time in UTC.
Obtains the current date and time in UTC.
Returns:
A date-time object representing the current UTC time.
Protected Attributes Documentation#
variable dataPointer#
A pointer to the private data.