]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/csharp/src/Apache.Arrow/Flatbuf/Types/Decimal.cs
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / csharp / src / Apache.Arrow / Flatbuf / Types / Decimal.cs
1 // <auto-generated>
2 // automatically generated by the FlatBuffers compiler, do not modify
3 // </auto-generated>
4
5 namespace Apache.Arrow.Flatbuf
6 {
7
8 using global::System;
9 using global::FlatBuffers;
10
11 /// Exact decimal value represented as an integer value in two's
12 /// complement. Currently only 128-bit (16-byte) and 256-bit (32-byte) integers
13 /// are used. The representation uses the endianness indicated
14 /// in the Schema.
15 internal struct Decimal: IFlatbufferObject
16 {
17 private Table __p;
18 public ByteBuffer ByteBuffer { get { return __p.bb; } }
19 public static Decimal GetRootAsDecimal(ByteBuffer _bb) { return GetRootAsDecimal(_bb, new Decimal()); }
20 public static Decimal GetRootAsDecimal(ByteBuffer _bb, Decimal obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
21 public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
22 public Decimal __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
23
24 /// Total number of decimal digits
25 public int Precision { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
26 /// Number of digits after the decimal point "."
27 public int Scale { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
28 /// Number of bits per value. The only accepted widths are 128 and 256.
29 /// We use bitWidth for consistency with Int::bitWidth.
30 public int BitWidth { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)128; } }
31
32 public static Offset<Decimal> CreateDecimal(FlatBufferBuilder builder,
33 int precision = 0,
34 int scale = 0,
35 int bitWidth = 128) {
36 builder.StartObject(3);
37 Decimal.AddBitWidth(builder, bitWidth);
38 Decimal.AddScale(builder, scale);
39 Decimal.AddPrecision(builder, precision);
40 return Decimal.EndDecimal(builder);
41 }
42
43 public static void StartDecimal(FlatBufferBuilder builder) { builder.StartObject(3); }
44 public static void AddPrecision(FlatBufferBuilder builder, int precision) { builder.AddInt(0, precision, 0); }
45 public static void AddScale(FlatBufferBuilder builder, int scale) { builder.AddInt(1, scale, 0); }
46 public static void AddBitWidth(FlatBufferBuilder builder, int bitWidth) { builder.AddInt(2, bitWidth, 128); }
47 public static Offset<Decimal> EndDecimal(FlatBufferBuilder builder) {
48 int o = builder.EndObject();
49 return new Offset<Decimal>(o);
50 }
51 };
52
53
54 }