diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-10-24 06:40:07 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-10-24 06:40:07 +0300 |
| commit | adaddad79352c156303e9178a6f172a18af50cd2 (patch) | |
| tree | 0ff2a59c3007bc9c40b7b543a9a2afe32dbc3d45 /Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs | |
| parent | 2d803e9410cd383d8e66c300f86fe0f7374c81ea (diff) | |
| download | Tango-adaddad79352c156303e9178a6f172a18af50cd2.tar.gz Tango-adaddad79352c156303e9178a6f172a18af50cd2.zip | |
Refactored DataStore Proto.
Diffstat (limited to 'Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs b/Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs index 4b7534738..f560237ae 100644 --- a/Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs +++ b/Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs @@ -23,16 +23,17 @@ namespace Tango.PMR.DataStore { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChNEYXRhU3RvcmVJdGVtLnByb3RvEhNUYW5nby5QTVIuRGF0YVN0b3JlGg5E", - "YXRhVHlwZS5wcm90byK8AQoNRGF0YVN0b3JlSXRlbRIvCghEYXRhVHlwZRgB", - "IAEoDjIdLlRhbmdvLlBNUi5EYXRhU3RvcmUuRGF0YVR5cGUSEgoKSW50MzJW", - "YWx1ZRgCIAEoBRISCgpGbG9hdFZhbHVlGAMgASgCEhMKC0RvdWJsZVZhbHVl", - "GAQgASgBEhQKDEJvb2xlYW5WYWx1ZRgFIAEoCBITCgtTdHJpbmdWYWx1ZRgG", - "IAEoCRISCgpCeXRlc1ZhbHVlGAcgASgMQh8KHWNvbS50d2luZS50YW5nby5w", - "bXIuZGF0YXN0b3JlYgZwcm90bzM=")); + "YXRhVHlwZS5wcm90bxoRTWVzc2FnZVR5cGUucHJvdG8i7gEKDURhdGFTdG9y", + "ZUl0ZW0SLwoIRGF0YVR5cGUYASABKA4yHS5UYW5nby5QTVIuRGF0YVN0b3Jl", + "LkRhdGFUeXBlEhIKCkludDMyVmFsdWUYAiABKAUSEgoKRmxvYXRWYWx1ZRgD", + "IAEoAhITCgtEb3VibGVWYWx1ZRgEIAEoARIUCgxCb29sZWFuVmFsdWUYBSAB", + "KAgSEwoLU3RyaW5nVmFsdWUYBiABKAkSEgoKQnl0ZXNWYWx1ZRgHIAEoDBIw", + "CglQcm90b1R5cGUYFCABKA4yHS5UYW5nby5QTVIuQ29tbW9uLk1lc3NhZ2VU", + "eXBlQh8KHWNvbS50d2luZS50YW5nby5wbXIuZGF0YXN0b3JlYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tango.PMR.DataStore.DataTypeReflection.Descriptor, }, + new pbr::FileDescriptor[] { global::Tango.PMR.DataStore.DataTypeReflection.Descriptor, global::Tango.PMR.Common.MessageTypeReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.DataStore.DataStoreItem), global::Tango.PMR.DataStore.DataStoreItem.Parser, new[]{ "DataType", "Int32Value", "FloatValue", "DoubleValue", "BooleanValue", "StringValue", "BytesValue" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.DataStore.DataStoreItem), global::Tango.PMR.DataStore.DataStoreItem.Parser, new[]{ "DataType", "Int32Value", "FloatValue", "DoubleValue", "BooleanValue", "StringValue", "BytesValue", "ProtoType" }, null, null, null) })); } #endregion @@ -70,6 +71,7 @@ namespace Tango.PMR.DataStore { booleanValue_ = other.booleanValue_; stringValue_ = other.stringValue_; bytesValue_ = other.bytesValue_; + protoType_ = other.protoType_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -154,6 +156,20 @@ namespace Tango.PMR.DataStore { } } + /// <summary>Field number for the "ProtoType" field.</summary> + public const int ProtoTypeFieldNumber = 20; + private global::Tango.PMR.Common.MessageType protoType_ = 0; + /// <summary> + ///Use only when DataType = Proto. + /// </summary> + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Common.MessageType ProtoType { + get { return protoType_; } + set { + protoType_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as DataStoreItem); @@ -174,6 +190,7 @@ namespace Tango.PMR.DataStore { if (BooleanValue != other.BooleanValue) return false; if (StringValue != other.StringValue) return false; if (BytesValue != other.BytesValue) return false; + if (ProtoType != other.ProtoType) return false; return true; } @@ -187,6 +204,7 @@ namespace Tango.PMR.DataStore { if (BooleanValue != false) hash ^= BooleanValue.GetHashCode(); if (StringValue.Length != 0) hash ^= StringValue.GetHashCode(); if (BytesValue.Length != 0) hash ^= BytesValue.GetHashCode(); + if (ProtoType != 0) hash ^= ProtoType.GetHashCode(); return hash; } @@ -225,6 +243,10 @@ namespace Tango.PMR.DataStore { output.WriteRawTag(58); output.WriteBytes(BytesValue); } + if (ProtoType != 0) { + output.WriteRawTag(160, 1); + output.WriteEnum((int) ProtoType); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -251,6 +273,9 @@ namespace Tango.PMR.DataStore { if (BytesValue.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeBytesSize(BytesValue); } + if (ProtoType != 0) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) ProtoType); + } return size; } @@ -280,6 +305,9 @@ namespace Tango.PMR.DataStore { if (other.BytesValue.Length != 0) { BytesValue = other.BytesValue; } + if (other.ProtoType != 0) { + ProtoType = other.ProtoType; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -318,6 +346,10 @@ namespace Tango.PMR.DataStore { BytesValue = input.ReadBytes(); break; } + case 160: { + protoType_ = (global::Tango.PMR.Common.MessageType) input.ReadEnum(); + break; + } } } } |
