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;

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



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

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

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

	static {
		String[] members = {"VoteCommit","VoteRollback","VoteReadOnly"};
		_type = _orb.create_enum_tc(_id,"Vote",members);
	}

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

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

	public static TypeCode type() {
		return _type;
	}

}
