Other Deephaven Types

A variety of other types that appear in the system.

Types used for sorting tables

class deephaven::client::SortPair

A tuple (not really 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

SortPair(std::string column, SortDirection direction, bool abs)

Constructor.

~SortPair()

Destructor.

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 SortPair ascending(std::string columnName, bool abs = false)

Create a SortPair with direction set to ascending.

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

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

Returns

The SortPair tuple.

static SortPair ascending(const Column &column, bool abs = false)

Create a SortPair with direction set to ascending.

Parameters
  • column – The column to sort.

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

Returns

The SortPair tuple.

static SortPair descending(std::string columnName, bool abs = false)

Create a SortPair with direction set to descending.

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

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

Returns

The SortPair tuple.

static SortPair descending(const Column &column, bool abs = false)

Create a SortPair with direction set to descending.

Parameters
  • column – The column to sort.

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

Returns

The SortPair tuple.

enum deephaven::client::SortDirection

Describes a sort direction

Values:

enumerator Ascending
enumerator Descending

Types used for manipulating dates/times

class deephaven::client::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, long 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.

void streamIrisRepresentation(std::ostream &result) const

Used internally to serialize this object to Deephaven.

Public Static Functions

static inline DateTime fromNanos(long 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.