From 8d2b13aaa70bc6a8f521df4eab165caf078c33fa Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Fri, 23 Oct 2020 03:13:09 +0300 Subject: DataStore Improvements. --- .../DataStore/GetDataStoreItemResponse.cs | 42 ++++++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) (limited to 'Software/Visual_Studio/Tango.PMR/DataStore/GetDataStoreItemResponse.cs') diff --git a/Software/Visual_Studio/Tango.PMR/DataStore/GetDataStoreItemResponse.cs b/Software/Visual_Studio/Tango.PMR/DataStore/GetDataStoreItemResponse.cs index 892f197d8..a42d22d23 100644 --- a/Software/Visual_Studio/Tango.PMR/DataStore/GetDataStoreItemResponse.cs +++ b/Software/Visual_Studio/Tango.PMR/DataStore/GetDataStoreItemResponse.cs @@ -23,14 +23,14 @@ namespace Tango.PMR.DataStore { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Ch5HZXREYXRhU3RvcmVJdGVtUmVzcG9uc2UucHJvdG8SE1RhbmdvLlBNUi5E", - "YXRhU3RvcmUaE0RhdGFTdG9yZUl0ZW0ucHJvdG8iTAoYR2V0RGF0YVN0b3Jl", - "SXRlbVJlc3BvbnNlEjAKBEl0ZW0YASABKAsyIi5UYW5nby5QTVIuRGF0YVN0", - "b3JlLkRhdGFTdG9yZUl0ZW1CHwodY29tLnR3aW5lLnRhbmdvLnBtci5kYXRh", - "c3RvcmViBnByb3RvMw==")); + "YXRhU3RvcmUaE0RhdGFTdG9yZUl0ZW0ucHJvdG8iWQoYR2V0RGF0YVN0b3Jl", + "SXRlbVJlc3BvbnNlEgsKA0tleRgBIAEoCRIwCgRJdGVtGAIgASgLMiIuVGFu", + "Z28uUE1SLkRhdGFTdG9yZS5EYXRhU3RvcmVJdGVtQh8KHWNvbS50d2luZS50", + "YW5nby5wbXIuZGF0YXN0b3JlYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tango.PMR.DataStore.DataStoreItemReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.DataStore.GetDataStoreItemResponse), global::Tango.PMR.DataStore.GetDataStoreItemResponse.Parser, new[]{ "Item" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.DataStore.GetDataStoreItemResponse), global::Tango.PMR.DataStore.GetDataStoreItemResponse.Parser, new[]{ "Key", "Item" }, null, null, null) })); } #endregion @@ -61,6 +61,7 @@ namespace Tango.PMR.DataStore { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public GetDataStoreItemResponse(GetDataStoreItemResponse other) : this() { + key_ = other.key_; Item = other.item_ != null ? other.Item.Clone() : null; } @@ -69,8 +70,19 @@ namespace Tango.PMR.DataStore { return new GetDataStoreItemResponse(this); } + /// Field number for the "Key" field. + public const int KeyFieldNumber = 1; + private string key_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Field number for the "Item" field. - public const int ItemFieldNumber = 1; + public const int ItemFieldNumber = 2; private global::Tango.PMR.DataStore.DataStoreItem item_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Tango.PMR.DataStore.DataStoreItem Item { @@ -93,6 +105,7 @@ namespace Tango.PMR.DataStore { if (ReferenceEquals(other, this)) { return true; } + if (Key != other.Key) return false; if (!object.Equals(Item, other.Item)) return false; return true; } @@ -100,6 +113,7 @@ namespace Tango.PMR.DataStore { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (Key.Length != 0) hash ^= Key.GetHashCode(); if (item_ != null) hash ^= Item.GetHashCode(); return hash; } @@ -111,8 +125,12 @@ namespace Tango.PMR.DataStore { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { - if (item_ != null) { + if (Key.Length != 0) { output.WriteRawTag(10); + output.WriteString(Key); + } + if (item_ != null) { + output.WriteRawTag(18); output.WriteMessage(Item); } } @@ -120,6 +138,9 @@ namespace Tango.PMR.DataStore { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } if (item_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Item); } @@ -131,6 +152,9 @@ namespace Tango.PMR.DataStore { if (other == null) { return; } + if (other.Key.Length != 0) { + Key = other.Key; + } if (other.item_ != null) { if (item_ == null) { item_ = new global::Tango.PMR.DataStore.DataStoreItem(); @@ -148,6 +172,10 @@ namespace Tango.PMR.DataStore { input.SkipLastField(); break; case 10: { + Key = input.ReadString(); + break; + } + case 18: { if (item_ == null) { item_ = new global::Tango.PMR.DataStore.DataStoreItem(); } -- cgit v1.3.1