package org.omg.Security;

/** 
 * Helper class for : DelegationDirective
 *  
 * @author OpenORB Compiler
 */ 
public class DelegationDirectiveHelper
{
    /**
     * Insert DelegationDirective into an any
     * @param a an any
     * @param t DelegationDirective value
     */
    public static void insert(org.omg.CORBA.Any a, org.omg.Security.DelegationDirective t)
    {
        a.type(type());
        write(a.create_output_stream(),t);
    }

    /**
     * Extract DelegationDirective from an any
     * @param a an any
     * @return the extracted DelegationDirective value
     */
    public static org.omg.Security.DelegationDirective extract(org.omg.CORBA.Any a)
    {
        if (!a.type().equal(type()))
            throw new org.omg.CORBA.MARSHAL();
        return read(a.create_input_stream());
    }

    //
    // Internal TypeCode value
    //
    private static org.omg.CORBA.TypeCode _tc = null;

    /**
     * Return the DelegationDirective TypeCode
     * @return a TypeCode
     */
    public static org.omg.CORBA.TypeCode type()
    {
        if (_tc == null) {
            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
            String []_members = new String[2];
            _members[0] = "Delegate";
            _members[1] = "NoDelegate";
            _tc = orb.create_enum_tc(id(),"DelegationDirective",_members);
        }
        return _tc;
    }

    /**
     * Return the DelegationDirective IDL ID
     * @return an ID
     */
    public static String id()
    {
        return _id;
    }

    private final static String _id = "IDL:omg.org/Security/DelegationDirective:1.0";

    /**
     * Read DelegationDirective from a marshalled stream
     * @param istream the input stream
     * @return the readed DelegationDirective value
     */
    public static org.omg.Security.DelegationDirective read(org.omg.CORBA.portable.InputStream istream)
    {
        return DelegationDirective.from_int(istream.read_ulong());
    }

    /**
     * Write DelegationDirective into a marshalled stream
     * @param ostream the output stream
     * @param value DelegationDirective value
     */
    public static void write(org.omg.CORBA.portable.OutputStream ostream, org.omg.Security.DelegationDirective value)
    {
        ostream.write_ulong(value.value());
    }

}
