package org.omg.CosTransactions;

import org.omg.CORBA.Any;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.StructMember;
import org.omg.CORBA.ORB;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.ObjectImpl;

/**
 * StatusHelper Class generated by the Idl2Java Compiler 3.1 of Jonathan
 */



public class StatusHelper {
	static ORB _orb = ORB.init();
	static TypeCode _type;
	public static String _id = "IDL:omg.org/CosTransactions/Status:1.0";
	public static String id() {
		return _id;
	}

	public static void insert(Any a,org.omg.CosTransactions.Status t) {
		a.type(_type);
		write(a.create_output_stream(),t);
	}

	public static org.omg.CosTransactions.Status extract(Any a) {
		return read(a.create_input_stream());
	}

	static {
		String[] members = {"StatusActive","StatusMarkedRollback","StatusPrepared","StatusCommitted","StatusRolledBack","StatusUnknown","StatusNoTransaction","StatusPreparing","StatusCommitting","StatusRollingBack"};
		_type = _orb.create_enum_tc(_id,"Status",members);
	}

	public static Status read(InputStream istream) {
		return org.omg.CosTransactions.Status.from_int(istream.read_ulong());
	}

	public static void write(OutputStream ostream, Status value) {
		ostream.write_ulong(value.value());
	}

	public static TypeCode type() {
		return _type;
	}

}
