// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace GLib {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	[StructLayout(LayoutKind.Sequential)]
	public partial struct OutputMessage : IEquatable<OutputMessage> {

		private IntPtr _address;
		public GLib.SocketAddress Address {
			get {
				return GLib.Object.GetObject(_address) as GLib.SocketAddress;
			}
			set {
				_address = value == null ? IntPtr.Zero : value.Handle;
			}
		}
		private IntPtr _vectors;

		public GLib.OutputVector vectors {
			get { return GLib.OutputVector.New (_vectors); }
		}
		public uint NumVectors;
		public uint BytesSent;
		private IntPtr _control_messages;
		public GLib.SocketControlMessage ControlMessages {
			get {
				return GLib.Object.GetObject(_control_messages) as GLib.SocketControlMessage;
			}
			set {
				_control_messages = value == null ? IntPtr.Zero : value.Handle;
			}
		}
		public uint NumControlMessages;

		public static GLib.OutputMessage Zero = new GLib.OutputMessage ();

		public static GLib.OutputMessage New(IntPtr raw) {
			if (raw == IntPtr.Zero)
				return GLib.OutputMessage.Zero;
			return (GLib.OutputMessage) Marshal.PtrToStructure (raw, typeof (GLib.OutputMessage));
		}

		public bool Equals (OutputMessage other)
		{
			return true && Address.Equals (other.Address) && vectors.Equals (other.vectors) && NumVectors.Equals (other.NumVectors) && BytesSent.Equals (other.BytesSent) && ControlMessages.Equals (other.ControlMessages) && NumControlMessages.Equals (other.NumControlMessages);
		}

		public override bool Equals (object other)
		{
			return other is OutputMessage && Equals ((OutputMessage) other);
		}

		public override int GetHashCode ()
		{
			return this.GetType ().FullName.GetHashCode () ^ Address.GetHashCode () ^ vectors.GetHashCode () ^ NumVectors.GetHashCode () ^ BytesSent.GetHashCode () ^ ControlMessages.GetHashCode () ^ NumControlMessages.GetHashCode ();
		}

		private static GLib.GType GType {
			get { return GLib.GType.Pointer; }
		}
#endregion
	}
}
