Esempio n. 1
0
 public static Offset <ScalarType> CreateScalarType(FlatBufferBuilder builder,
                                                    sbyte byteType    = 0,
                                                    byte ubyteType    = 0,
                                                    bool boolType     = false,
                                                    short shortType   = 0,
                                                    ushort ushortType = 0,
                                                    int inttype       = 0,
                                                    uint uintType     = 0,
                                                    float floatType   = 0.0f,
                                                    long longType     = 0,
                                                    ulong ulongType   = 0,
                                                    double doubleType = 0.0)
 {
     builder.StartTable(11);
     ScalarType.AddDoubleType(builder, doubleType);
     ScalarType.AddUlongType(builder, ulongType);
     ScalarType.AddLongType(builder, longType);
     ScalarType.AddFloatType(builder, floatType);
     ScalarType.AddUintType(builder, uintType);
     ScalarType.AddInttype(builder, inttype);
     ScalarType.AddUshortType(builder, ushortType);
     ScalarType.AddShortType(builder, shortType);
     ScalarType.AddBoolType(builder, boolType);
     ScalarType.AddUbyteType(builder, ubyteType);
     ScalarType.AddByteType(builder, byteType);
     return(ScalarType.EndScalarType(builder));
 }
Esempio n. 2
0
 public static Offset <ScalarType> BuildScalarType(FlatBufferBuilder fbb)
 {
     ScalarType.StartScalarType(fbb);
     ScalarType.AddByteType(fbb, 1);
     ScalarType.AddUbyteType(fbb, 2);
     ScalarType.AddBoolType(fbb, true);
     ScalarType.AddShortType(fbb, 3);
     ScalarType.AddUshortType(fbb, 4);
     ScalarType.AddInttype(fbb, 5);
     ScalarType.AddUintType(fbb, 6);
     ScalarType.AddFloatType(fbb, 7.05f);
     ScalarType.AddLongType(fbb, 8);
     ScalarType.AddUlongType(fbb, 9);
     ScalarType.AddDoubleType(fbb, 10.125);
     ScalarType.AddDoubleType(fbb, 11.05); //Note: AddDoubleType is invoked twice, DoubleType field will be set to value passed by last invocation.
     return(ScalarType.EndScalarType(fbb));
 }