mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 14:51:41 +01:00
Removed accidentally added code-behind files
This commit is contained in:
parent
d889bdb469
commit
77b28d23ec
@ -1,412 +0,0 @@
|
||||
using Capnp;
|
||||
using Capnp.Rpc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapnpGen
|
||||
{
|
||||
public class Person : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
Id = reader.Id;
|
||||
Name = reader.Name;
|
||||
Email = reader.Email;
|
||||
Phones = reader.Phones.ToReadOnlyList(_ => CapnpSerializable.Create<CapnpGen.Person.PhoneNumber>(_));
|
||||
Employment = CapnpSerializable.Create<CapnpGen.Person.@employment>(reader.Employment);
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
writer.Id = Id;
|
||||
writer.Name = Name;
|
||||
writer.Email = Email;
|
||||
writer.Phones.Init(Phones, (_s1, _v1) => _v1?.serialize(_s1));
|
||||
Employment?.serialize(writer.Employment);
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public uint Id
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string Email
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public IReadOnlyList<CapnpGen.Person.PhoneNumber> Phones
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public CapnpGen.Person.@employment Employment
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
public uint Id => ctx.ReadDataUInt(0UL, 0U);
|
||||
public string Name => ctx.ReadText(0, "");
|
||||
public string Email => ctx.ReadText(1, "");
|
||||
public IReadOnlyList<CapnpGen.Person.PhoneNumber.READER> Phones => ctx.ReadList(2).Cast(CapnpGen.Person.PhoneNumber.READER.create);
|
||||
public @employment.READER Employment => new @employment.READER(ctx);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(1, 4);
|
||||
}
|
||||
|
||||
public uint Id
|
||||
{
|
||||
get => this.ReadDataUInt(0UL, 0U);
|
||||
set => this.WriteData(0UL, value, 0U);
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => this.ReadText(0, "");
|
||||
set => this.WriteText(0, value, "");
|
||||
}
|
||||
|
||||
public string Email
|
||||
{
|
||||
get => this.ReadText(1, "");
|
||||
set => this.WriteText(1, value, "");
|
||||
}
|
||||
|
||||
public ListOfStructsSerializer<CapnpGen.Person.PhoneNumber.WRITER> Phones
|
||||
{
|
||||
get => BuildPointer<ListOfStructsSerializer<CapnpGen.Person.PhoneNumber.WRITER>>(2);
|
||||
set => Link(2, value);
|
||||
}
|
||||
|
||||
public @employment.WRITER Employment
|
||||
{
|
||||
get => Rewrap<@employment.WRITER>();
|
||||
}
|
||||
}
|
||||
|
||||
public class @employment : ICapnpSerializable
|
||||
{
|
||||
public enum WHICH : ushort
|
||||
{
|
||||
Unemployed = 0,
|
||||
Employer = 1,
|
||||
School = 2,
|
||||
SelfEmployed = 3,
|
||||
undefined = 65535
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
switch (reader.which)
|
||||
{
|
||||
case WHICH.Unemployed:
|
||||
which = reader.which;
|
||||
break;
|
||||
case WHICH.Employer:
|
||||
Employer = reader.Employer;
|
||||
break;
|
||||
case WHICH.School:
|
||||
School = reader.School;
|
||||
break;
|
||||
case WHICH.SelfEmployed:
|
||||
which = reader.which;
|
||||
break;
|
||||
}
|
||||
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
private WHICH _which = WHICH.undefined;
|
||||
private object _content;
|
||||
public WHICH which
|
||||
{
|
||||
get => _which;
|
||||
set
|
||||
{
|
||||
if (value == _which)
|
||||
return;
|
||||
_which = value;
|
||||
switch (value)
|
||||
{
|
||||
case WHICH.Unemployed:
|
||||
break;
|
||||
case WHICH.Employer:
|
||||
_content = null;
|
||||
break;
|
||||
case WHICH.School:
|
||||
_content = null;
|
||||
break;
|
||||
case WHICH.SelfEmployed:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
writer.which = which;
|
||||
switch (which)
|
||||
{
|
||||
case WHICH.Unemployed:
|
||||
break;
|
||||
case WHICH.Employer:
|
||||
writer.Employer = Employer;
|
||||
break;
|
||||
case WHICH.School:
|
||||
writer.School = School;
|
||||
break;
|
||||
case WHICH.SelfEmployed:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public string Employer
|
||||
{
|
||||
get => _which == WHICH.Employer ? (string)_content : null;
|
||||
set
|
||||
{
|
||||
_which = WHICH.Employer;
|
||||
_content = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string School
|
||||
{
|
||||
get => _which == WHICH.School ? (string)_content : null;
|
||||
set
|
||||
{
|
||||
_which = WHICH.School;
|
||||
_content = value;
|
||||
}
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
public WHICH which => (WHICH)ctx.ReadDataUShort(32U, (ushort)0);
|
||||
public string Employer => which == WHICH.Employer ? ctx.ReadText(3, "") : default;
|
||||
public string School => which == WHICH.School ? ctx.ReadText(3, "") : default;
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
}
|
||||
|
||||
public WHICH which
|
||||
{
|
||||
get => (WHICH)this.ReadDataUShort(32U, (ushort)0);
|
||||
set => this.WriteData(32U, (ushort)value, (ushort)0);
|
||||
}
|
||||
|
||||
public string Employer
|
||||
{
|
||||
get => which == WHICH.Employer ? this.ReadText(3, "") : default;
|
||||
set => this.WriteText(3, value, "");
|
||||
}
|
||||
|
||||
public string School
|
||||
{
|
||||
get => which == WHICH.School ? this.ReadText(3, "") : default;
|
||||
set => this.WriteText(3, value, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PhoneNumber : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
Number = reader.Number;
|
||||
TheType = reader.TheType;
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
writer.Number = Number;
|
||||
writer.TheType = TheType;
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public string Number
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public CapnpGen.Person.PhoneNumber.Type TheType
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
public string Number => ctx.ReadText(0, "");
|
||||
public CapnpGen.Person.PhoneNumber.Type TheType => (CapnpGen.Person.PhoneNumber.Type)ctx.ReadDataUShort(0UL, (ushort)0);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(1, 1);
|
||||
}
|
||||
|
||||
public string Number
|
||||
{
|
||||
get => this.ReadText(0, "");
|
||||
set => this.WriteText(0, value, "");
|
||||
}
|
||||
|
||||
public CapnpGen.Person.PhoneNumber.Type TheType
|
||||
{
|
||||
get => (CapnpGen.Person.PhoneNumber.Type)this.ReadDataUShort(0UL, (ushort)0);
|
||||
set => this.WriteData(0UL, (ushort)value, (ushort)0);
|
||||
}
|
||||
}
|
||||
|
||||
public enum Type : ushort
|
||||
{
|
||||
mobile,
|
||||
home,
|
||||
work
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AddressBook : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
People = reader.People.ToReadOnlyList(_ => CapnpSerializable.Create<CapnpGen.Person>(_));
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
writer.People.Init(People, (_s1, _v1) => _v1?.serialize(_s1));
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public IReadOnlyList<CapnpGen.Person> People
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
public IReadOnlyList<CapnpGen.Person.READER> People => ctx.ReadList(0).Cast(CapnpGen.Person.READER.create);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(0, 1);
|
||||
}
|
||||
|
||||
public ListOfStructsSerializer<CapnpGen.Person.WRITER> People
|
||||
{
|
||||
get => BuildPointer<ListOfStructsSerializer<CapnpGen.Person.WRITER>>(0);
|
||||
set => Link(0, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
using Capnp;
|
||||
using Capnp.Rpc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Capnp.Annotations
|
||||
{
|
||||
}
|
@ -1,393 +0,0 @@
|
||||
using Capnp;
|
||||
using Capnp.Rpc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Capnp.Rpc.Twoparty
|
||||
{
|
||||
public enum Side : ushort
|
||||
{
|
||||
server,
|
||||
client
|
||||
}
|
||||
|
||||
public class VatId : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
Side = reader.Side;
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
writer.Side = Side;
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public Capnp.Rpc.Twoparty.Side Side
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
public Capnp.Rpc.Twoparty.Side Side => (Capnp.Rpc.Twoparty.Side)ctx.ReadDataUShort(0UL, (ushort)0);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(1, 0);
|
||||
}
|
||||
|
||||
public Capnp.Rpc.Twoparty.Side Side
|
||||
{
|
||||
get => (Capnp.Rpc.Twoparty.Side)this.ReadDataUShort(0UL, (ushort)0);
|
||||
set => this.WriteData(0UL, (ushort)value, (ushort)0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ProvisionId : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
JoinId = reader.JoinId;
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
writer.JoinId = JoinId;
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public uint JoinId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
public uint JoinId => ctx.ReadDataUInt(0UL, 0U);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(1, 0);
|
||||
}
|
||||
|
||||
public uint JoinId
|
||||
{
|
||||
get => this.ReadDataUInt(0UL, 0U);
|
||||
set => this.WriteData(0UL, value, 0U);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RecipientId : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ThirdPartyCapId : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class JoinKeyPart : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
JoinId = reader.JoinId;
|
||||
PartCount = reader.PartCount;
|
||||
PartNum = reader.PartNum;
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
writer.JoinId = JoinId;
|
||||
writer.PartCount = PartCount;
|
||||
writer.PartNum = PartNum;
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public uint JoinId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public ushort PartCount
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public ushort PartNum
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
public uint JoinId => ctx.ReadDataUInt(0UL, 0U);
|
||||
public ushort PartCount => ctx.ReadDataUShort(32UL, (ushort)0);
|
||||
public ushort PartNum => ctx.ReadDataUShort(48UL, (ushort)0);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(1, 0);
|
||||
}
|
||||
|
||||
public uint JoinId
|
||||
{
|
||||
get => this.ReadDataUInt(0UL, 0U);
|
||||
set => this.WriteData(0UL, value, 0U);
|
||||
}
|
||||
|
||||
public ushort PartCount
|
||||
{
|
||||
get => this.ReadDataUShort(32UL, (ushort)0);
|
||||
set => this.WriteData(32UL, value, (ushort)0);
|
||||
}
|
||||
|
||||
public ushort PartNum
|
||||
{
|
||||
get => this.ReadDataUShort(48UL, (ushort)0);
|
||||
set => this.WriteData(48UL, value, (ushort)0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class JoinResult : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
JoinId = reader.JoinId;
|
||||
Succeeded = reader.Succeeded;
|
||||
Cap = CapnpSerializable.Create<AnyPointer>(reader.Cap);
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
writer.JoinId = JoinId;
|
||||
writer.Succeeded = Succeeded;
|
||||
writer.Cap.SetObject(Cap);
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public uint JoinId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool Succeeded
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public AnyPointer Cap
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
public uint JoinId => ctx.ReadDataUInt(0UL, 0U);
|
||||
public bool Succeeded => ctx.ReadDataBool(32UL, false);
|
||||
public DeserializerState Cap => ctx.StructReadPointer(0);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(1, 1);
|
||||
}
|
||||
|
||||
public uint JoinId
|
||||
{
|
||||
get => this.ReadDataUInt(0UL, 0U);
|
||||
set => this.WriteData(0UL, value, 0U);
|
||||
}
|
||||
|
||||
public bool Succeeded
|
||||
{
|
||||
get => this.ReadDataBool(32UL, false);
|
||||
set => this.WriteData(32UL, value, false);
|
||||
}
|
||||
|
||||
public DynamicSerializerState Cap
|
||||
{
|
||||
get => BuildPointer<DynamicSerializerState>(0);
|
||||
set => Link(0, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,67 +0,0 @@
|
||||
using Capnp;
|
||||
using Capnp.Rpc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapnpGen
|
||||
{
|
||||
public class TestImport : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
Field = CapnpSerializable.Create<Capnproto_test.Capnp.Test.TestAllTypes>(reader.Field);
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
Field?.serialize(writer.Field);
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public Capnproto_test.Capnp.Test.TestAllTypes Field
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
public Capnproto_test.Capnp.Test.TestAllTypes.READER Field => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestAllTypes.READER.create);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(0, 1);
|
||||
}
|
||||
|
||||
public Capnproto_test.Capnp.Test.TestAllTypes.WRITER Field
|
||||
{
|
||||
get => BuildPointer<Capnproto_test.Capnp.Test.TestAllTypes.WRITER>(0);
|
||||
set => Link(0, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
using Capnp;
|
||||
using Capnp.Rpc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapnpGen
|
||||
{
|
||||
public class TestImport2 : ICapnpSerializable
|
||||
{
|
||||
void ICapnpSerializable.Deserialize(DeserializerState arg_)
|
||||
{
|
||||
var reader = READER.create(arg_);
|
||||
Foo = CapnpSerializable.Create<Capnproto_test.Capnp.Test.TestAllTypes>(reader.Foo);
|
||||
Bar = CapnpSerializable.Create<Capnp.Schema.Node>(reader.Bar);
|
||||
Baz = CapnpSerializable.Create<CapnpGen.TestImport>(reader.Baz);
|
||||
applyDefaults();
|
||||
}
|
||||
|
||||
public void serialize(WRITER writer)
|
||||
{
|
||||
Foo?.serialize(writer.Foo);
|
||||
Bar?.serialize(writer.Bar);
|
||||
Baz?.serialize(writer.Baz);
|
||||
}
|
||||
|
||||
void ICapnpSerializable.Serialize(SerializerState arg_)
|
||||
{
|
||||
serialize(arg_.Rewrap<WRITER>());
|
||||
}
|
||||
|
||||
public void applyDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
public Capnproto_test.Capnp.Test.TestAllTypes Foo
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Capnp.Schema.Node Bar
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public CapnpGen.TestImport Baz
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public struct READER
|
||||
{
|
||||
readonly DeserializerState ctx;
|
||||
public READER(DeserializerState ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public static READER create(DeserializerState ctx) => new READER(ctx);
|
||||
public static implicit operator DeserializerState(READER reader) => reader.ctx;
|
||||
public static implicit operator READER(DeserializerState ctx) => new READER(ctx);
|
||||
public Capnproto_test.Capnp.Test.TestAllTypes.READER Foo => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestAllTypes.READER.create);
|
||||
public Capnp.Schema.Node.READER Bar => ctx.ReadStruct(1, Capnp.Schema.Node.READER.create);
|
||||
public CapnpGen.TestImport.READER Baz => ctx.ReadStruct(2, CapnpGen.TestImport.READER.create);
|
||||
}
|
||||
|
||||
public class WRITER : SerializerState
|
||||
{
|
||||
public WRITER()
|
||||
{
|
||||
this.SetStruct(0, 3);
|
||||
}
|
||||
|
||||
public Capnproto_test.Capnp.Test.TestAllTypes.WRITER Foo
|
||||
{
|
||||
get => BuildPointer<Capnproto_test.Capnp.Test.TestAllTypes.WRITER>(0);
|
||||
set => Link(0, value);
|
||||
}
|
||||
|
||||
public Capnp.Schema.Node.WRITER Bar
|
||||
{
|
||||
get => BuildPointer<Capnp.Schema.Node.WRITER>(1);
|
||||
set => Link(1, value);
|
||||
}
|
||||
|
||||
public CapnpGen.TestImport.WRITER Baz
|
||||
{
|
||||
get => BuildPointer<CapnpGen.TestImport.WRITER>(2);
|
||||
set => Link(2, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user