package com.nativelibs4java.mono.library;
/**
 * This structure is internal to the runtime: use the mono_type*<br>
 * accessors below, because it will soon ago away from the public header file.<br>
 * This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
 * a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
 * For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a>, <a href="http://rococoa.dev.java.net/">Rococoa</a>, or <a href="http://jna.dev.java.net/">JNA</a>.
 */
public class MonoType extends com.ochafik.lang.jnaerator.runtime.Structure<MonoType, MonoType.ByValue, MonoType.ByReference> {
	/// C type : data_union
	public data_union data;
	/// param attributes or field flags
	@com.ochafik.lang.jnaerator.runtime.Bits(16)
	public short attrs;
	/**
	 * @see MonoTypeEnum<br>
	 * C type : MonoTypeEnum
	 */
	@com.ochafik.lang.jnaerator.runtime.Bits(8)
	public byte type;
	/// max 64 modifiers follow at the end
	@com.ochafik.lang.jnaerator.runtime.Bits(6)
	public byte num_mods;
	@com.ochafik.lang.jnaerator.runtime.Bits(1)
	public byte byref;
	/// valid when included in a local var signature
	@com.ochafik.lang.jnaerator.runtime.Bits(1)
	public byte pinned;
	/**
	 * this may grow<br>
	 * C type : MonoCustomMod[1]
	 */
	public com.nativelibs4java.mono.library.MonoCustomMod[] modifiers = new com.nativelibs4java.mono.library.MonoCustomMod[(1)];
	public static class data_union extends com.ochafik.lang.jnaerator.runtime.Union<data_union, data_union.ByValue, data_union.ByReference> {
		/**
		 * for VALUETYPE and CLASS<br>
		 * C type : MonoClass*
		 */
		public com.nativelibs4java.mono.library.MonoLibrary.MonoClass klass;
		/**
		 * for PTR<br>
		 * C type : MonoType*
		 */
		public com.nativelibs4java.mono.library.MonoType.ByReference type;
		/**
		 * for ARRAY<br>
		 * C type : MonoArrayType*
		 */
		public com.nativelibs4java.mono.library.MonoArrayType.ByReference array;
		/// C type : MonoMethodSignature*
		public com.nativelibs4java.mono.library.MonoMethodSignature.ByReference method;
		/**
		 * for VAR and MVAR<br>
		 * C type : MonoGenericParam*
		 */
		public com.nativelibs4java.mono.library.MonoLibrary.MonoGenericParam generic_param;
		/**
		 * for GENERICINST<br>
		 * C type : MonoGenericClass*
		 */
		public com.nativelibs4java.mono.library.MonoLibrary.MonoGenericClass generic_class;
		public data_union() {
			super();
		}
		/**
		 * @param type for PTR<br>
		 * C type : MonoType*
		 */
		public data_union(com.nativelibs4java.mono.library.MonoType.ByReference type) {
			super();
			this.type = type;
			setType(com.nativelibs4java.mono.library.MonoType.ByReference.class);
		}
		/// @param method C type : MonoMethodSignature*
		public data_union(com.nativelibs4java.mono.library.MonoMethodSignature.ByReference method) {
			super();
			this.method = method;
			setType(com.nativelibs4java.mono.library.MonoMethodSignature.ByReference.class);
		}
		/**
		 * @param klass for VALUETYPE and CLASS<br>
		 * C type : MonoClass*
		 */
		public data_union(com.nativelibs4java.mono.library.MonoLibrary.MonoClass klass) {
			super();
			this.klass = klass;
			setType(com.nativelibs4java.mono.library.MonoLibrary.MonoClass.class);
		}
		/**
		 * @param generic_param for VAR and MVAR<br>
		 * C type : MonoGenericParam*
		 */
		public data_union(com.nativelibs4java.mono.library.MonoLibrary.MonoGenericParam generic_param) {
			super();
			this.generic_param = generic_param;
			setType(com.nativelibs4java.mono.library.MonoLibrary.MonoGenericParam.class);
		}
		/**
		 * @param generic_class for GENERICINST<br>
		 * C type : MonoGenericClass*
		 */
		public data_union(com.nativelibs4java.mono.library.MonoLibrary.MonoGenericClass generic_class) {
			super();
			this.generic_class = generic_class;
			setType(com.nativelibs4java.mono.library.MonoLibrary.MonoGenericClass.class);
		}
		/**
		 * @param array for ARRAY<br>
		 * C type : MonoArrayType*
		 */
		public data_union(com.nativelibs4java.mono.library.MonoArrayType.ByReference array) {
			super();
			this.array = array;
			setType(com.nativelibs4java.mono.library.MonoArrayType.ByReference.class);
		}
		protected ByReference newByReference() { return new ByReference(); }
		protected ByValue newByValue() { return new ByValue(); }
		protected data_union newInstance() { return new data_union(); }
		public static data_union[] newArray(int arrayLength) {
			return com.ochafik.lang.jnaerator.runtime.Union.newArray(data_union.class, arrayLength);
		}
		public static class ByReference extends data_union implements com.sun.jna.Structure.ByReference {}
		public static class ByValue extends data_union implements com.sun.jna.Structure.ByValue {}
	}
	public MonoType() {
		super();
	}
	/**
	 * @param data C type : data_union<br>
	 * @param attrs param attributes or field flags<br>
	 * @param type @see MonoTypeEnum<br>
	 * C type : MonoTypeEnum<br>
	 * @param num_mods max 64 modifiers follow at the end<br>
	 * @param pinned valid when included in a local var signature<br>
	 * @param modifiers this may grow<br>
	 * C type : MonoCustomMod[1]
	 */
	public MonoType(data_union data, short attrs, byte type, byte num_mods, byte byref, byte pinned, com.nativelibs4java.mono.library.MonoCustomMod modifiers[]) {
		super();
		this.data = data;
		this.attrs = attrs;
		this.type = type;
		this.num_mods = num_mods;
		this.byref = byref;
		this.pinned = pinned;
		if (modifiers.length != this.modifiers.length) 
			throw new java.lang.IllegalArgumentException("Wrong array size !");
		this.modifiers = modifiers;
	}
	protected ByReference newByReference() { return new ByReference(); }
	protected ByValue newByValue() { return new ByValue(); }
	protected MonoType newInstance() { return new MonoType(); }
	public static MonoType[] newArray(int arrayLength) {
		return com.ochafik.lang.jnaerator.runtime.Structure.newArray(MonoType.class, arrayLength);
	}
	public static class ByReference extends MonoType implements com.sun.jna.Structure.ByReference {}
	public static class ByValue extends MonoType implements com.sun.jna.Structure.ByValue {}
}
