Class Enumeration
Represents a TileDB enumeration object.
Implements
Namespace: TileDB.CSharp
Assembly: TileDB.CSharp.dll
Syntax
public sealed class Enumeration : IDisposable
Fields
| Edit this page View SourceVariableSized
This value indicates an enumeration with variable-sized members. It may be returned from ValuesPerMember.
Declaration
public const uint VariableSized = 4294967295
Field Value
Type | Description |
---|---|
uint |
See Also
Properties
| Edit this page View SourceDataType
The DataType of the Enumeration.
Declaration
public DataType DataType { get; }
Property Value
Type | Description |
---|---|
DataType |
IsOrdered
Whether the Enumeration should be considered as ordered.
Declaration
public bool IsOrdered { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
If false, prevents inequality operators in QueryConditions from being used with this enumeration.
ValuesPerMember
Returns the number of values for each member of the Enumeration.
Declaration
public uint ValuesPerMember { get; }
Property Value
Type | Description |
---|---|
uint |
Remarks
If this property has a value of VariableSized, each value has a different size.
This method exposes the tiledb_enumeration_get_cell_val_num
function of the TileDB Embedded C API.
Methods
| Edit this page View SourceCreate(Context, string, bool, IReadOnlyCollection<string>, DataType)
Creates an Enumeration from a collection of strings.
Declaration
public static Enumeration Create(Context ctx, string name, bool ordered, IReadOnlyCollection<string> values, DataType dataType = DataType.StringUtf8)
Parameters
Type | Name | Description |
---|---|---|
Context | ctx | The Context to use. |
string | name | The name of the enumeration. |
bool | ordered | Whether the enumeration should be considered as ordered. If false, prevents inequality operators in QueryConditions from being used with this enumeration. |
IReadOnlyCollection<string> | values | The collection of values for the enumeration. |
DataType | dataType | The data type of the enumeration. Must be a string type. Optional, defaults to StringUtf8. |
Returns
Type | Description |
---|---|
Enumeration |
Create<T>(Context, string, bool, ReadOnlySpan<T>, ReadOnlySpan<ulong>, DataType?)
Creates an Enumeration with variable-sized members.
Declaration
public static Enumeration Create<T>(Context ctx, string name, bool ordered, ReadOnlySpan<T> values, ReadOnlySpan<ulong> offsets, DataType? dataType = null) where T : struct
Parameters
Type | Name | Description |
---|---|---|
Context | ctx | The Context to use. |
string | name | The name of the enumeration. |
bool | ordered | The value of IsOrdered. |
ReadOnlySpan<T> | values | A ReadOnlySpan<T> of all values of each member of the enumeration, concatenated. |
ReadOnlySpan<ulong> | offsets | A ReadOnlySpan<T> of the offsets to the first byte of each member of the enumeration. |
DataType? | dataType | The data type of the enumeration. Defaults to the
default data type of |
Returns
Type | Description |
---|---|
Enumeration |
Type Parameters
Name | Description |
---|---|
T | The type of the enumeration's members. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException |
|
Create<T>(Context, string, bool, ReadOnlySpan<T>, uint, DataType?)
Creates an Enumeration with fixed-sized members.
Declaration
public static Enumeration Create<T>(Context ctx, string name, bool ordered, ReadOnlySpan<T> values, uint cellValNum = 1, DataType? dataType = null) where T : struct
Parameters
Type | Name | Description |
---|---|---|
Context | ctx | The Context to use. |
string | name | The name of the enumeration. |
bool | ordered | The value of IsOrdered. |
ReadOnlySpan<T> | values | A ReadOnlySpan<T> of the enumeration's values. |
uint | cellValNum | The number of values per member in the enumeration. Optional,
defaults to 1. If specified, its value must divide the length of |
DataType? | dataType | The data type of the enumeration. Defaults to the
default data type of |
Returns
Type | Description |
---|---|
Enumeration |
Type Parameters
Name | Description |
---|---|
T | The type of the enumeration's members. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException |
|
Dispose()
Disposes the Enumeration.
Declaration
public void Dispose()
Extend(IReadOnlyCollection<string>)
Extends an Enumeration of strings.
Declaration
public Enumeration Extend(IReadOnlyCollection<string> values)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<string> | values | The strings to add to the enumeration. |
Returns
Type | Description |
---|---|
Enumeration |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The enumeration has a non-string data type, or its members are fixed-size. |
Extend<T>(ReadOnlySpan<T>)
Adds additional values to an Enumeration with fixed-sized members.
Declaration
public Enumeration Extend<T>(ReadOnlySpan<T> values) where T : struct
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<T> | values | A ReadOnlySpan<T> of the enumeration's values. |
Returns
Type | Description |
---|---|
Enumeration |
Type Parameters
Name | Description |
---|---|
T | The type of the enumeration's members. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The enumeration's
DataType does not match |
Extend<T>(ReadOnlySpan<T>, ReadOnlySpan<ulong>)
Extends an Enumeration with variable-sized members.
Declaration
public Enumeration Extend<T>(ReadOnlySpan<T> values, ReadOnlySpan<ulong> offsets) where T : struct
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<T> | values | A ReadOnlySpan<T> of all values of each additional member of the enumeration, concatenated. |
ReadOnlySpan<ulong> | offsets | A ReadOnlySpan<T> of the offsets to the first byte of each member of the enumeration. |
Returns
Type | Description |
---|---|
Enumeration |
Type Parameters
Name | Description |
---|---|
T | The type of the enumeration's members. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The enumeration's
DataType does not match |
GetName()
Returns the name of the Enumeration.
Declaration
public string GetName()
Returns
Type | Description |
---|---|
string |
GetRawData()
Returns a byte array with the raw data of the Enumeration's members.
Declaration
public byte[] GetRawData()
Returns
Type | Description |
---|---|
byte[] |
See Also
| Edit this page View SourceGetRawOffsets()
Returns an array with the offsets to the first byte of each member of the Enumeration.
Declaration
public ulong[] GetRawOffsets()
Returns
Type | Description |
---|---|
ulong[] |
Remarks
In enumerations with fixed-size members (i.e. ValuesPerMember is not equal to VariableSized, this method will return an empty array, as each member has the same size.
See Also
| Edit this page View SourceGetValues()
Returns the values of the Enumeration.
Declaration
public Array GetValues()
Returns
Type | Description |
---|---|
Array | An array whose type depends on the enumeration's DataType and ValuesPerMember:
|
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |