-
Notifications
You must be signed in to change notification settings - Fork 16
/
VariableWithValues.cs
129 lines (120 loc) · 9.62 KB
/
VariableWithValues.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace openmeteo_sdk
{
using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
public struct VariableWithValues : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static VariableWithValues GetRootAsVariableWithValues(ByteBuffer _bb) { return GetRootAsVariableWithValues(_bb, new VariableWithValues()); }
public static VariableWithValues GetRootAsVariableWithValues(ByteBuffer _bb, VariableWithValues obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public VariableWithValues __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public openmeteo_sdk.Variable Variable { get { int o = __p.__offset(4); return o != 0 ? (openmeteo_sdk.Variable)__p.bb.Get(o + __p.bb_pos) : openmeteo_sdk.Variable.undefined; } }
public openmeteo_sdk.Unit Unit { get { int o = __p.__offset(6); return o != 0 ? (openmeteo_sdk.Unit)__p.bb.Get(o + __p.bb_pos) : openmeteo_sdk.Unit.undefined; } }
public float Value { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } }
public float Values(int j) { int o = __p.__offset(10); return o != 0 ? __p.bb.GetFloat(__p.__vector(o) + j * 4) : (float)0; }
public int ValuesLength { get { int o = __p.__offset(10); return o != 0 ? __p.__vector_len(o) : 0; } }
#if ENABLE_SPAN_T
public Span<float> GetValuesBytes() { return __p.__vector_as_span<float>(10, 4); }
#else
public ArraySegment<byte>? GetValuesBytes() { return __p.__vector_as_arraysegment(10); }
#endif
public float[] GetValuesArray() { return __p.__vector_as_array<float>(10); }
public long ValuesInt64(int j) { int o = __p.__offset(12); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; }
public int ValuesInt64Length { get { int o = __p.__offset(12); return o != 0 ? __p.__vector_len(o) : 0; } }
#if ENABLE_SPAN_T
public Span<long> GetValuesInt64Bytes() { return __p.__vector_as_span<long>(12, 8); }
#else
public ArraySegment<byte>? GetValuesInt64Bytes() { return __p.__vector_as_arraysegment(12); }
#endif
public long[] GetValuesInt64Array() { return __p.__vector_as_array<long>(12); }
public short Altitude { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } }
public openmeteo_sdk.Aggregation Aggregation { get { int o = __p.__offset(16); return o != 0 ? (openmeteo_sdk.Aggregation)__p.bb.Get(o + __p.bb_pos) : openmeteo_sdk.Aggregation.none; } }
public short PressureLevel { get { int o = __p.__offset(18); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } }
public short Depth { get { int o = __p.__offset(20); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } }
public short DepthTo { get { int o = __p.__offset(22); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } }
public short EnsembleMember { get { int o = __p.__offset(24); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } }
public short PreviousDay { get { int o = __p.__offset(26); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } }
public static Offset<openmeteo_sdk.VariableWithValues> CreateVariableWithValues(FlatBufferBuilder builder,
openmeteo_sdk.Variable variable = openmeteo_sdk.Variable.undefined,
openmeteo_sdk.Unit unit = openmeteo_sdk.Unit.undefined,
float value = 0.0f,
VectorOffset valuesOffset = default(VectorOffset),
VectorOffset values_int64Offset = default(VectorOffset),
short altitude = 0,
openmeteo_sdk.Aggregation aggregation = openmeteo_sdk.Aggregation.none,
short pressure_level = 0,
short depth = 0,
short depth_to = 0,
short ensemble_member = 0,
short previous_day = 0) {
builder.StartTable(12);
VariableWithValues.AddValuesInt64(builder, values_int64Offset);
VariableWithValues.AddValues(builder, valuesOffset);
VariableWithValues.AddValue(builder, value);
VariableWithValues.AddPreviousDay(builder, previous_day);
VariableWithValues.AddEnsembleMember(builder, ensemble_member);
VariableWithValues.AddDepthTo(builder, depth_to);
VariableWithValues.AddDepth(builder, depth);
VariableWithValues.AddPressureLevel(builder, pressure_level);
VariableWithValues.AddAltitude(builder, altitude);
VariableWithValues.AddAggregation(builder, aggregation);
VariableWithValues.AddUnit(builder, unit);
VariableWithValues.AddVariable(builder, variable);
return VariableWithValues.EndVariableWithValues(builder);
}
public static void StartVariableWithValues(FlatBufferBuilder builder) { builder.StartTable(12); }
public static void AddVariable(FlatBufferBuilder builder, openmeteo_sdk.Variable variable) { builder.AddByte(0, (byte)variable, 0); }
public static void AddUnit(FlatBufferBuilder builder, openmeteo_sdk.Unit unit) { builder.AddByte(1, (byte)unit, 0); }
public static void AddValue(FlatBufferBuilder builder, float value) { builder.AddFloat(2, value, 0.0f); }
public static void AddValues(FlatBufferBuilder builder, VectorOffset valuesOffset) { builder.AddOffset(3, valuesOffset.Value, 0); }
public static VectorOffset CreateValuesVector(FlatBufferBuilder builder, float[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddFloat(data[i]); return builder.EndVector(); }
public static VectorOffset CreateValuesVectorBlock(FlatBufferBuilder builder, float[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateValuesVectorBlock(FlatBufferBuilder builder, ArraySegment<float> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateValuesVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<float>(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static void AddValuesInt64(FlatBufferBuilder builder, VectorOffset valuesInt64Offset) { builder.AddOffset(4, valuesInt64Offset.Value, 0); }
public static VectorOffset CreateValuesInt64Vector(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddLong(data[i]); return builder.EndVector(); }
public static VectorOffset CreateValuesInt64VectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateValuesInt64VectorBlock(FlatBufferBuilder builder, ArraySegment<long> data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateValuesInt64VectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<long>(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartValuesInt64Vector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
public static void AddAltitude(FlatBufferBuilder builder, short altitude) { builder.AddShort(5, altitude, 0); }
public static void AddAggregation(FlatBufferBuilder builder, openmeteo_sdk.Aggregation aggregation) { builder.AddByte(6, (byte)aggregation, 0); }
public static void AddPressureLevel(FlatBufferBuilder builder, short pressureLevel) { builder.AddShort(7, pressureLevel, 0); }
public static void AddDepth(FlatBufferBuilder builder, short depth) { builder.AddShort(8, depth, 0); }
public static void AddDepthTo(FlatBufferBuilder builder, short depthTo) { builder.AddShort(9, depthTo, 0); }
public static void AddEnsembleMember(FlatBufferBuilder builder, short ensembleMember) { builder.AddShort(10, ensembleMember, 0); }
public static void AddPreviousDay(FlatBufferBuilder builder, short previousDay) { builder.AddShort(11, previousDay, 0); }
public static Offset<openmeteo_sdk.VariableWithValues> EndVariableWithValues(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<openmeteo_sdk.VariableWithValues>(o);
}
}
static public class VariableWithValuesVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyField(tablePos, 4 /*Variable*/, 1 /*openmeteo_sdk.Variable*/, 1, false)
&& verifier.VerifyField(tablePos, 6 /*Unit*/, 1 /*openmeteo_sdk.Unit*/, 1, false)
&& verifier.VerifyField(tablePos, 8 /*Value*/, 4 /*float*/, 4, false)
&& verifier.VerifyVectorOfData(tablePos, 10 /*Values*/, 4 /*float*/, false)
&& verifier.VerifyVectorOfData(tablePos, 12 /*ValuesInt64*/, 8 /*long*/, false)
&& verifier.VerifyField(tablePos, 14 /*Altitude*/, 2 /*short*/, 2, false)
&& verifier.VerifyField(tablePos, 16 /*Aggregation*/, 1 /*openmeteo_sdk.Aggregation*/, 1, false)
&& verifier.VerifyField(tablePos, 18 /*PressureLevel*/, 2 /*short*/, 2, false)
&& verifier.VerifyField(tablePos, 20 /*Depth*/, 2 /*short*/, 2, false)
&& verifier.VerifyField(tablePos, 22 /*DepthTo*/, 2 /*short*/, 2, false)
&& verifier.VerifyField(tablePos, 24 /*EnsembleMember*/, 2 /*short*/, 2, false)
&& verifier.VerifyField(tablePos, 26 /*PreviousDay*/, 2 /*short*/, 2, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}