Web Analytics Made Easy - Statcounter
Skip to content

Class SBDTypeDateTime#

ClassList > 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.

SBDTypeDateTime::SBDTypeDateTime () 

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.

SBDTypeDateTime::SBDTypeDateTime (
    unsigned long long millisecondsSinceEpoch
) 

Constructs a date-time object with the specified milliseconds since the Unix epoch.

Parameters:

  • millisecondsSinceEpoch The number of milliseconds since the Unix epoch.

function SBDTypeDateTime [3/4]#

Copy constructor.

SBDTypeDateTime::SBDTypeDateTime (
    const SBDTypeDateTime & dateTime
) 

Constructs a date-time object as a copy of another.

Parameters:

  • dateTime The source date-time object to copy from.

function SBDTypeDateTime [4/4]#

Move constructor.

SBDTypeDateTime::SBDTypeDateTime (
    SBDTypeDateTime && dateTime
) noexcept

Constructs a date-time object by moving resources from another object.

Parameters:

  • dateTime The 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.

unsigned long long SBDTypeDateTime::getMillisecondsSinceEpoch () const

Retrieves the number of milliseconds elapsed since the Unix epoch.

Returns:

The milliseconds since epoch.


function isSerializable#

Returns true __

bool SBDTypeDateTime::isSerializable () const

Indicates whether the date-time type supports serialization.

Returns:

true indicating the type can be serialized.


function operator!=#

The inequality operator.

bool SBDTypeDateTime::operator!= (
    const SBDTypeDateTime & color
) const

Checks whether two date-time objects are not equal.

Parameters:

  • dateTime The date-time object to compare with.

Returns:

true if the objects represent different points in time; otherwise false.


function operator<#

The "less than" operator.

bool SBDTypeDateTime::operator< (
    const SBDTypeDateTime & color
) const

Determines whether this date-time is earlier than another.

Parameters:

  • dateTime The 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.

bool SBDTypeDateTime::operator<= (
    const SBDTypeDateTime & color
) const

Determines whether this date-time is earlier than or equal to another.

Parameters:

  • dateTime The 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.

SBDTypeDateTime & SBDTypeDateTime::operator= (
    const SBDTypeDateTime & color
) 

Assigns the value of another date-time object to this object.

Parameters:

  • dateTime The source date-time object to assign from.

Returns:

A reference to this date-time object.


function operator=#

Move assignment.

SBDTypeDateTime & SBDTypeDateTime::operator= (
    SBDTypeDateTime && color
) noexcept

Moves the value of another date-time object to this object.

Parameters:

  • dateTime The source date-time object to move from.

Returns:

A reference to this date-time object.


function operator==#

The equality operator.

bool SBDTypeDateTime::operator== (
    const SBDTypeDateTime & color
) const

Checks whether two date-time objects are equal.

Parameters:

  • dateTime The 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.

bool SBDTypeDateTime::operator> (
    const SBDTypeDateTime & color
) const

Determines whether this date-time is later than another.

Parameters:

  • dateTime The 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.

bool SBDTypeDateTime::operator>= (
    const SBDTypeDateTime & color
) const

Determines whether this date-time is later than or equal to another.

Parameters:

  • dateTime The 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.

virtual void SBDTypeDateTime::print (
    unsigned int offset=0
) const

Prints the date-time in a human-readable UTC format.

Parameters:

  • offset The 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:

  • serializer The serializer to write data to.
  • sdkVersionNumber The SDK version number for compatibility.

The function writes the milliseconds since epoch to the serializer.


function setMillisecondsSinceEpoch#

Sets the number of milliseconds since Epoch.

void SBDTypeDateTime::setMillisecondsSinceEpoch (
    unsigned long long millisecondsSinceEpoch
) 

Sets the number of milliseconds elapsed since the Unix epoch.

Parameters:

  • millisecondsSinceEpoch The 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:

  • serializer The serializer to read data from.
  • sdkVersionNumber The SDK version number for compatibility.

The function reads the milliseconds since epoch from the serializer.


function ~SBDTypeDateTime#

Destructs the date time.

virtual SBDTypeDateTime::~SBDTypeDateTime () 

Destroys the date-time object and releases associated resources.


Public Static Functions Documentation#

function currentDateTimeUTC#

Returns the current date time in UTC.

static SBDTypeDateTime SBDTypeDateTime::currentDateTimeUTC () 

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.

SBDTypeDateTimeData* SBDTypeDateTime::dataPointer;