Skip to content

Commit

Permalink
Build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HermanSchoenfeld committed Apr 26, 2024
1 parent be556dd commit 46892b7
Showing 1 changed file with 64 additions and 64 deletions.
128 changes: 64 additions & 64 deletions utils/Hydrogen.Utils.WinFormsTester/Screens/ObjectSpaceScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override void InitializeUIPrimingData() {
}

private void DoConsensusSpaceDemo(string path) {
using var appSpace = new DemoObjectSpace(path);
//using var appSpace = new DemoObjectSpace(path);

var secret = "MyPassword";

Expand All @@ -46,7 +46,7 @@ private void DoConsensusSpaceDemo(string path) {
Quantity = 0
};

appSpace.Commit();
//appSpace.Commit();
}

private void SaveSettings() {
Expand All @@ -68,78 +68,78 @@ private void _buildButton_Click(object sender, EventArgs e) {
}
}

public class DemoObjectSpace : ObjectSpace {

public DemoObjectSpace(string file, FileAccessMode accessMode = FileAccessMode.Default)
: base(BuildFileDefinition(file), BuildSpaceDefinition(), SerializerFactory.Default, ComparerFactory.Default, accessMode) {
}

//public IRepository<Account, long> Accounts => throw new NotImplementedException();

//public IRepository<Account, long> AccountsByName => throw new NotImplementedException();

//public IRepository<Identity, long> Identities => throw new NotImplementedException();

//public IRepository<Identity, long> IdentitiesByKey => throw new NotImplementedException();

private static HydrogenFileDescriptor BuildFileDefinition(string filePath)
=> HydrogenFileDescriptor.From(
filePath,
8192,
Tools.Memory.ToBytes(50, MemoryMetric.Megabyte),
512,
ClusteredStreamsPolicy.Default
);

private static ObjectSpaceDefinition BuildSpaceDefinition() {
var definition = new ObjectSpaceDefinition {
Dimensions = new ObjectSpaceDefinition.DimensionDefinition[] {
new() {
ObjectType = typeof(Account),
Indexes = new ObjectSpaceDefinition.IndexDefinition[] {
new() {
Type = ObjectSpaceDefinition.IndexType.RecyclableIndexStore,
},
new() {
Type = ObjectSpaceDefinition.IndexType.UniqueKey,
Member = Tools.Mapping.GetMember<Account, string>(x => x.Name),
}
}
},
new() {
ObjectType = typeof(Identity),
Indexes = new ObjectSpaceDefinition.IndexDefinition[] {
new() {
Type = ObjectSpaceDefinition.IndexType.RecyclableIndexStore,
},
new() {
Type = ObjectSpaceDefinition.IndexType.UniqueKey,
Member = Tools.Mapping.GetMember<Identity, byte[]>(x => x.Key),
}
}
},


}
};


return definition;
}
}
//public class DemoObjectSpace : ObjectSpace {

// public DemoObjectSpace(string file, FileAccessMode accessMode = FileAccessMode.Default)
// : base(BuildFileDefinition(file), BuildSpaceDefinition(), SerializerFactory.Default, ComparerFactory.Default, accessMode) {
// }

// //public IRepository<Account, long> Accounts => throw new NotImplementedException();

// //public IRepository<Account, long> AccountsByName => throw new NotImplementedException();

// //public IRepository<Identity, long> Identities => throw new NotImplementedException();

// //public IRepository<Identity, long> IdentitiesByKey => throw new NotImplementedException();

// private static HydrogenFileDescriptor BuildFileDefinition(string filePath)
// => HydrogenFileDescriptor.From(
// filePath,
// 8192,
// Tools.Memory.ToBytes(50, MemoryMetric.Megabyte),
// 512,
// ClusteredStreamsPolicy.Default
// );

// private static ObjectSpaceDefinition BuildSpaceDefinition() {
// var definition = new ObjectSpaceDefinition {
// Dimensions = new ObjectSpaceDefinition.DimensionDefinition[] {
// new() {
// ObjectType = typeof(Account),
// Indexes = new ObjectSpaceDefinition.IndexDefinition[] {
// new() {
// Type = ObjectSpaceDefinition.IndexType.RecyclableIndexStore,
// },
// new() {
// Type = ObjectSpaceDefinition.IndexType.UniqueKey,
// Member = Tools.Mapping.GetMember<Account, string>(x => x.Name),
// }
// }
// },
// new() {
// ObjectType = typeof(Identity),
// Indexes = new ObjectSpaceDefinition.IndexDefinition[] {
// new() {
// Type = ObjectSpaceDefinition.IndexType.RecyclableIndexStore,
// },
// new() {
// Type = ObjectSpaceDefinition.IndexType.UniqueKey,
// Member = Tools.Mapping.GetMember<Identity, byte[]>(x => x.Key),
// }
// }
// },


// }
// };


// return definition;
// }
//}

public class Account {

[UniqueProperty]
public string Name { get; set; }

public decimal Quantity { get; set; }

public Identity Identity { get; set; }

}

public class Identity {
public class Identity {

public DSS DSS { get; set; }

Expand Down

0 comments on commit 46892b7

Please sign in to comment.