Other Deephaven Types#

A variety of other types that appear in the system.

Types used for sorting tables#

class SortPair#

A tuple (not a “pair”, despite the name) representing a column to sort, the SortDirection, and whether the Sort should consider the value’s regular or absolute value when doing comparisons.

Public Functions

inline SortPair(std::string column, SortDirection direction, bool abs = false)#

Constructor.

inline SortPair(std::string column, bool abs = false)#

Constructor.

inline std::string &Column()#

Get the column name

Returns:

The column name

inline const std::string &Column() const#

Get the column name

Returns:

The column name

inline SortDirection Direction() const#

Get the SortDirection

Returns:

The SortDirection

inline bool Abs() const#

Get the “Sort by absolute value” flag

Returns:

Public Static Functions

static inline SortPair Ascending(std::string column, bool abs = false)#

Create a SortPair with direction set to ascending.

Parameters:
  • column – The name of the column to sort.

  • abs – If true, the data should be sorted by absolute value.

Returns:

The SortPair tuple.

static inline SortPair Descending(std::string column, bool abs = false)#

Create a SortPair with direction set to descending.

Parameters:
  • column – The name of the column to sort.

  • abs – If true, the data should be sorted by absolute value.

Returns:

The SortPair tuple.

enum class deephaven::client::SortDirection#

Describes a sort direction

Values:

enumerator kAscending#
enumerator kDescending#

Types used for manipulating dates/times#

class DateTime#

The Deephaven DateTime type. Records nanoseconds relative to the epoch (January 1, 1970) UTC. Times before the epoch can be represented with negative nanosecond values.

Public Functions

DateTime() = default#

Default constructor. Sets the DateTime equal to the epoch.

inline explicit DateTime(int64_t nanos)#

Sets the DateTime to the specified number of nanoseconds relative to the epoch.

Parameters:

nanos – Nanoseconds since the epoch (January 1, 1970 UTC).

DateTime(int year, int month, int day)#

Sets the DateTime to the specified date, with a time component of zero.

Parameters:
  • year – Year.

  • month – Month.

  • day – Day.

DateTime(int year, int month, int day, int hour, int minute, int second)#

Sets the DateTime to the specified date and time, with a fractional second component of zero.

Parameters:
  • year – Year.

  • month – Month.

  • day – Day.

  • hour – Hour.

  • minute – Minute.

  • second – Second.

DateTime(int year, int month, int day, int hour, int minute, int second, int64_t nanos)#

Sets the DateTime to the specified date and time, including fractional seconds expressed in nanos.

Parameters:
  • year – Year.

  • month – Month.

  • day – Day.

  • hour – Hour.

  • minute – Minute.

  • second – Second.

  • nanos – Nanoseconds.

inline int64_t Nanos() const#

The DateTime as expressed in nanoseconds since the epoch. Can be negative.

Public Static Functions

static inline DateTime FromNanos(int64_t nanos)#

Converts nanoseconds-since-UTC-epoch to DateTime. The Deephaven null value sentinel is turned into DateTime(0).

Parameters:

nanos – Nanoseconds since the epoch (January 1, 1970 UTC).

Returns:

The corresponding DateTime.

static DateTime Parse(std::string_view iso_8601_timestamp)#

Parses a string in ISO 8601 format into a DateTime.

Parameters:

iso_8601_timestamp – The timestamp, in ISO 8601 format.

Returns:

The corresponding DateTime.