factory argument comes first
This commit is contained in:
parent
d3aff83097
commit
e233fe1126
2 changed files with 14 additions and 10 deletions
|
@ -990,10 +990,12 @@ private:
|
|||
spaces(indent), " public final ", type, ".Reader<", elementReaderType, ">",
|
||||
" get", titleCase, "() {\n",
|
||||
spaces(indent), " return new ", type, ".Reader<",
|
||||
elementReaderType, ">(_reader.getPointerField(", offset, ").getList(",
|
||||
elementReaderType, ">(\n",
|
||||
spaces(indent), " ", elementReaderType, ".factory,\n",
|
||||
spaces(indent), " _reader.getPointerField(", offset, ").getList(",
|
||||
// XXX what about lists of non-structs?
|
||||
typeName(typeBody.getList().getElementType()),".STRUCT_SIZE.preferredListEncoding), ",
|
||||
elementReaderType, ".factory);\n",
|
||||
typeName(typeBody.getList().getElementType()),".STRUCT_SIZE.preferredListEncoding)",
|
||||
");\n",
|
||||
spaces(indent), " }\n",
|
||||
"\n"),
|
||||
|
||||
|
@ -1011,10 +1013,12 @@ private:
|
|||
spaces(indent), " }\n",
|
||||
spaces(indent), " public final ", type, ".Builder<", elementBuilderType,">",
|
||||
" init", titleCase, "(int size) {\n",
|
||||
spaces(indent), " return new ", type, ".Builder<", elementBuilderType, ">",
|
||||
"(_builder.getPointerField(", offset, ").initStructList(", // XXX what about non-struct lists?
|
||||
"size,", typeName(typeBody.getList().getElementType()),".STRUCT_SIZE), ",
|
||||
elementBuilderType, ".factory);\n",
|
||||
spaces(indent), " return new ", type, ".Builder<", elementBuilderType, ">(\n",
|
||||
spaces(indent), " ", elementBuilderType,".factory,\n",
|
||||
// XXX what about non-struct lists?
|
||||
spaces(indent), " _builder.getPointerField(", offset, ").initStructList(",
|
||||
"size,", typeName(typeBody.getList().getElementType()),".STRUCT_SIZE)",
|
||||
");\n",
|
||||
spaces(indent), " }\n"),
|
||||
|
||||
kj::strTree(
|
||||
|
|
|
@ -5,7 +5,7 @@ public final class StructList {
|
|||
public ListReader reader;
|
||||
public final FromStructReader<T> factory;
|
||||
|
||||
public Reader(ListReader reader, FromStructReader<T> factory) {
|
||||
public Reader(FromStructReader<T> factory, ListReader reader) {
|
||||
this.reader = reader;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ public final class StructList {
|
|||
public ListBuilder builder;
|
||||
public final FromStructBuilder<T> factory;
|
||||
|
||||
public Builder(ListBuilder builder, FromStructBuilder<T> factory) {
|
||||
public Builder(FromStructBuilder<T> factory, ListBuilder builder) {
|
||||
this.builder = builder;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
// init
|
||||
Builder(PointerBuilder builder, int size, FromStructBuilder<T> factory) {
|
||||
Builder(FromStructBuilder<T> factory, PointerBuilder builder, int size) {
|
||||
this.builder = builder.initStructList(size, factory.structSize());
|
||||
this.factory = factory;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue