Other Deephaven Types¶
A variety of other types that appear in the system.
Types used for expressing Deephaven data types¶
-
class ElementType¶
Represents the element type of the column source. This data structure is able to represent any of the simple types, as well as lists and nested lists of the simple types. If ‘list_depth_’ == 0, this object represents a scalar element of type ‘element_type_id_’. If ‘list_depth_’ == 1, then this object represents a list of elements of type ‘element_type_id_’. If ‘list_depth_’ == 2, then this object represents a list of lists of elements of type ‘element_type_id_’, and so on. Note that even though this object can represent multidimensional lists, the rest of the system currently only supports scalars and one-dimensional lists.
Public Functions
-
ElementType() = default¶
Default Constructor.
-
inline ElementType(uint32_t list_depth, ElementTypeId::Enum element_type_id)¶
Constructs an ElementType with the given list_depth and scalar type. See class documentation for the interpretation of list_depth.
-
inline uint32_t ListDepth() const¶
The list depth of this ElementType. Scalar types have a list depth of 0. One-dimensional list types (e.g. list<int>) have a list depth of 1. Higher-dimensional list types (e.g. list<list<int>>) have a list depth greater than 1.
- Returns:
The list depth.
-
inline ElementTypeId::Enum Id() const¶
If this object represents a scalar, returns the scalar’s type. Otherwise, if this object represents a list (of any dimension), returns the element type of the innermost list.
- Returns:
The enumeration representing this scalar or the elemenet type of the innermost list.
-
inline ElementType WrapList() const¶
Assuming this object represents the type T, returns a new object representing the type list<T>
- Returns:
The wrapped type.
-
ElementType UnwrapList() const¶
If this object represents the type list<T>, returns a new object representing the type T. If this object is not a list type, throws an exception.
- Returns:
The unwrapped type.
-
inline std::string ToString() const¶
Makes a string representation of this type object. For example “list<int32_t>”
- Returns:
This object’s string representation.
Public Static Functions
-
static inline ElementType Of(ElementTypeId::Enum element_type_id)¶
Create an ElementType representing the specified scalar type.
-
ElementType() = default¶
-
class ElementTypeId¶
A static class (not instantiable) used to create a scope for the ElementTypeId::Enum
Public Types
-
enum Enum¶
The Deephaven server types that are known to the C++ client.
Values:
-
enumerator kChar¶
-
enumerator kInt8¶
-
enumerator kInt16¶
-
enumerator kInt32¶
-
enumerator kInt64¶
-
enumerator kFloat¶
-
enumerator kDouble¶
-
enumerator kBool¶
-
enumerator kString¶
-
enumerator kTimestamp¶
-
enumerator kLocalDate¶
-
enumerator kLocalTime¶
-
enumerator kChar¶
-
enum Enum¶
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:
-
inline SortPair(std::string column, SortDirection direction, bool abs = false)¶
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 Types
-
using rep_t = int64_t¶
Convenience using.
Public Functions
-
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.
Public Static Functions
-
static inline constexpr bool IsBlittableToInt64()¶
This method exists to document and enforce an assumption in Cython, namely that this class has the same representation as an int64_t. This constexpr method always returns true (or fails to compile).
-
using rep_t = int64_t¶
-
class LocalDate¶
The Deephaven LocalDate type which corresponds to java.time.LocalDate. For consistency with the Arrow type we use, stores its value in units of milliseconds. However we do not allow fractional days, so only millisecond values that are an even number of days are permitted.
Public Types
-
using rep_t = int64_t¶
Convenience using.
Public Functions
Public Static Functions
-
static inline constexpr bool IsBlittableToInt64()¶
This method exists to document and enforce an assumption in Cython, namely that this class has the same representation as an int64_t. This constexpr method always returns true (or fails to compile).
-
static LocalDate Of(int32_t year, int32_t month, int32_t day_of_month)¶
Creates an instance of LocalDate from the specified year, month, and day.
-
static inline LocalDate FromMillis(int64_t millis)¶
Creates an instance of LocalDate from milliseconds-since-UTC-epoch. The Deephaven null value sentinel is turned into LocalDate(0).
- Parameters:
millis – Milliseconds since the epoch (January 1, 1970 UTC). An exception is thrown if millis is not an even number of days.
- Returns:
The corresponding LocalDate
-
using rep_t = int64_t¶
-
class LocalTime¶
The Deephaven LocalTime type which corresponds to java.time.LocalTime. Records nanoseconds since midnight (of some unspecified reference day).
Public Types
-
using rep_t = int64_t¶
Convenience using.
Public Functions
Public Static Functions
-
static inline constexpr bool IsBlittableToInt64()¶
This method exists to document and enforce an assumption in Cython, namely that this class has the same representation as an int64_t. This constexpr method always returns true (or fails to compile).
-
using rep_t = int64_t¶