-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relation SourceCode Generator WIP2 (fixes regressions form previous c…
…ommit)
- Loading branch information
Showing
4 changed files
with
378 additions
and
189 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...est/RelationTests.VerifyRelationWithSecondaryKey#TestNamespace.IPersonTable.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//HintName: TestNamespace.IPersonTable.g.cs | ||
// <auto-generated/> | ||
#pragma warning disable 612,618 | ||
#nullable enable | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
// Name: IPersonTable | ||
// Field: ParentId int | ||
// PrimaryIndex: 1 | ||
// Field: PersonId int | ||
// PrimaryIndex: 2 | ||
// SecondaryIndex PersonId: 1 | ||
// Field: Name string reference | ||
// PrimaryIndex: 3 InKeyValue | ||
// Field: LowerCaseName string reference computed | ||
// SecondaryIndex LowerCaseName: 2 IncludePrimaryKeyOrder 1 | ||
|
||
namespace TestNamespace; | ||
[CompilerGenerated] | ||
static file class IPersonTableRegistration | ||
{ | ||
[ModuleInitializer] | ||
internal static unsafe void Register4BTDB() | ||
{ | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
...ator.Test/RelationTests.VerifyRelationWithSecondaryKey#TestNamespace.Person.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
//HintName: TestNamespace.Person.g.cs | ||
// <auto-generated/> | ||
#pragma warning disable 612,618 | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace TestNamespace; | ||
|
||
[CompilerGenerated] | ||
static file class PersonRegistration | ||
{ | ||
[UnsafeAccessor(UnsafeAccessorKind.Constructor)] | ||
extern static global::TestNamespace.Person Creator(); | ||
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "<ParentId>k__BackingField")] | ||
extern static ref int Field1(global::TestNamespace.Person @this); | ||
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "<PersonId>k__BackingField")] | ||
extern static ref int Field2(global::TestNamespace.Person @this); | ||
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "<Name>k__BackingField")] | ||
extern static ref string Field3(global::TestNamespace.Person @this); | ||
[UnsafeAccessor(UnsafeAccessorKind.Method, Name = "get_LowerCaseName")] | ||
extern static string Getter4(global::TestNamespace.Person @this); | ||
static void GenGetter4(object @this, ref byte value) | ||
{ | ||
Unsafe.As<byte, string>(ref value) = Getter4(Unsafe.As<global::TestNamespace.Person>(@this)); | ||
} | ||
[ModuleInitializer] | ||
internal static unsafe void Register4BTDB() | ||
{ | ||
global::BTDB.IOC.IContainer.RegisterFactory(typeof(global::TestNamespace.Person), (container, ctx) => | ||
{ | ||
return (container2, ctx2) => | ||
{ | ||
var res = new global::TestNamespace.Person(); | ||
return res; | ||
}; | ||
}); | ||
var metadata = new global::BTDB.Serialization.ClassMetadata(); | ||
metadata.Name = "Person"; | ||
metadata.Type = typeof(global::TestNamespace.Person); | ||
metadata.Namespace = "TestNamespace"; | ||
metadata.Implements = []; | ||
metadata.Creator = &Creator; | ||
var dummy = Unsafe.As<global::TestNamespace.Person>(metadata); | ||
metadata.Fields = new global::BTDB.Serialization.FieldMetadata[] | ||
{ | ||
new global::BTDB.Serialization.FieldMetadata | ||
{ | ||
Name = "ParentId", | ||
Type = typeof(int), | ||
ByteOffset = global::BTDB.Serialization.RawData.CalcOffset(dummy, ref Field1(dummy)), | ||
}, | ||
new global::BTDB.Serialization.FieldMetadata | ||
{ | ||
Name = "PersonId", | ||
Type = typeof(int), | ||
ByteOffset = global::BTDB.Serialization.RawData.CalcOffset(dummy, ref Field2(dummy)), | ||
}, | ||
new global::BTDB.Serialization.FieldMetadata | ||
{ | ||
Name = "Name", | ||
Type = typeof(string), | ||
ByteOffset = global::BTDB.Serialization.RawData.CalcOffset(dummy, ref Field3(dummy)), | ||
}, | ||
new global::BTDB.Serialization.FieldMetadata | ||
{ | ||
Name = "LowerCaseName", | ||
Type = typeof(string), | ||
PropRefGetter = &GenGetter4, | ||
}, | ||
}; | ||
global::BTDB.Serialization.ReflectionMetadata.Register(metadata); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.