// Autogenerated C# message buffer code. // Source: clad/externalInterface/messageShared.clad // Full command line: victor-clad/tools/message-buffers/emitters/CSharp_emitter.py -C src -I clad/src lib/util/source/anki/clad robot/clad/src coretech/vision/clad_src coretech/common/clad_src -o generated/cladCSharp clad/externalInterface/messageShared.clad namespace Anki { namespace Vector { namespace ExternalInterface { [System.Flags] public enum CommsConstants : uint { kDirectCommsBufferSize = 1048576, kVizCommsBufferSize = 131072 }; public partial class Ping { private uint _counter; // uint_32 private double _timeSent_ms; // float_64 private bool _isResponse; // bool public uint counter { get { return _counter; } set { _counter = value; } } public double timeSent_ms { get { return _timeSent_ms; } set { _timeSent_ms = value; } } public bool isResponse { get { return _isResponse; } set { _isResponse = value; } } /**** Constructors ****/ public Ping() { } public Ping(uint counter, double timeSent_ms, bool isResponse) { this.counter = counter; this.timeSent_ms = timeSent_ms; this.isResponse = isResponse; } public Ping(System.IO.Stream stream) { Unpack(stream); } public Ping(System.IO.BinaryReader reader) { Unpack(reader); } public Ping Initialize(uint counter, double timeSent_ms, bool isResponse) { this.counter = counter; this.timeSent_ms = timeSent_ms; this.isResponse = isResponse; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _counter = reader.ReadUInt32(); _timeSent_ms = reader.ReadDouble(); _isResponse = reader.ReadBoolean(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_counter); writer.Write((double)_timeSent_ms); writer.Write((bool)_isResponse); } public int Size { get { return 13; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(Ping a, Ping b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(Ping a, Ping b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as Ping); } public bool Equals(Ping p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._counter.Equals(p._counter) && this._timeSent_ms.Equals(p._timeSent_ms) && this._isResponse.Equals(p._isResponse); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._counter.GetHashCode(); hash = hash * 23 + this._timeSent_ms.GetHashCode(); hash = hash * 23 + this._isResponse.GetHashCode(); return hash; } } } } // namespace ExternalInterface } // namespace Vector } // namespace Anki