2005-06-04 Audrius Meskauskas <[EMAIL PROTECTED]>
* org/omg/CORBA/DefinitionKindHelper.java,
org/omg/CORBA/FieldNameHelper.java,
org/omg/CORBA/IdentifierHelper.java,
org/omg/CORBA/ParameterMode.java,
org/omg/CORBA/ParameterModeHelper.java,
org/omg/CORBA/ParameterModeHolder.java,
org/omg/CORBA/RepositoryIdHelper.java,
org/omg/CORBA/SetOverrideTypeHelper.java,
org/omg/CORBA/VersionSpecHelper.java,
gnu/CORBA/SetOverrideTypeHolder.java,
gnu/CORBA/DefinitionKindHolder.java: New files.
/* VersionSpecHelper.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package org.omg.CORBA;
import gnu.CORBA.Restricted_ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
/**
* A formal helper for the CORBA VersionSpec that is identical to the
* narrow string.
*
* @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
*/
public abstract class VersionSpecHelper
{
/**
* Insert the VersionSpec into Any (uses [EMAIL PROTECTED] Any.insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
*/
public static void insert(Any a, String that)
{
a.insert_string(that);
}
/**
* Extract the VersionSpec from Any ((uses [EMAIL PROTECTED] Any.extract_string}).
*
* @param a the Any to extract from.
*/
public static String extract(Any a)
{
return a.extract_string();
}
/**
* Return an string alias typecode, named "VersionSpec".
*/
public static TypeCode type()
{
ORB orb = Restricted_ORB.Singleton;
return orb.create_alias_tc(id(), "VersionSpec", orb.create_string_tc(0));
}
/**
* Return the VersionSpec repository id.
* @return "IDL:omg.org/CORBA/VersionSpec:1.0", always.
*/
public static String id()
{
return "IDL:omg.org/CORBA/VersionSpec:1.0";
}
/**
* Calls [EMAIL PROTECTED] InputStream#read_string()}.
*
* @param istream the stream to read from.
*/
public static String read(InputStream istream)
{
return istream.read_string();
}
/**
* Calls [EMAIL PROTECTED] OutputStream#write_string()}.
*
* @param ostream the stream to write into.
* @param value the string (VersionSpec) value to write.
*/
public static void write(OutputStream ostream, String value)
{
ostream.write_string(value);
}
}/* DefinitionKindHelper.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package org.omg.CORBA;
import gnu.CORBA.DefinitionKindHolder;
import gnu.CORBA.Restricted_ORB;
import gnu.CORBA.gnuAny;
import gnu.CORBA.primitiveTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
/**
* A helper operations for the definition kind.
*
* @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
*/
public abstract class DefinitionKindHelper
{
/**
* The cached typecode value, computed only once.
*/
private static TypeCode typeCode;
/**
* Insert the definition kind into the given Any.
*/
public static void insert(Any a, DefinitionKind that)
{
a.insert_Streamable(new DefinitionKindHolder(that));
}
/**
* Extract the definition kind from the given Any.
*/
public static DefinitionKind extract(Any a)
{
return ((DefinitionKindHolder) a.extract_Streamable()).value;
}
/**
* Get the definition kind typecode (enumeration, named "DefinitionKind").
* The member names are listed as defined by java 1.4 specification.
* The names, defined in OMG specification only (like dk_Home or
* dk_Event) are not listed.
*/
public static TypeCode type()
{
if (typeCode == null)
{
String[] members =
new String[]
{
"dk_none", "dk_all", "dk_Attribute", "dk_Constant", "dk_Exception",
"dk_Interface", "dk_Module", "dk_Operation", "dk_Typedef",
"dk_Alias", "dk_Struct", "dk_Union", "dk_Enum", "dk_Primitive",
"dk_String", "dk_Sequence", "dk_Array", "dk_Repository",
"dk_Wstring", "dk_Fixed", "dk_Value", "dk_ValueBox",
"dk_ValueMember", "dk_Native"
};
typeCode =
Restricted_ORB.Singleton.create_enum_tc(id(), "DefinitionKind",
members
);
}
return typeCode;
}
/**
* Get the definition kind repository id.
*
* @return "IDL:omg.org/CORBA/DefinitionKind:1.0", always.
*/
public static String id()
{
return "IDL:omg.org/CORBA/DefinitionKind:1.0";
}
/**
* Read the definitin kind (as int) from the CDR intput stream.
*
* @param istream a stream to read from.
*/
public static DefinitionKind read(InputStream istream)
{
return DefinitionKind.from_int(istream.read_long());
}
/**
* Write the definition kind (as int) to the CDR output stream.
*
* @param ostream a stream to write into.
* @param value a value to write.
*/
public static void write(OutputStream ostream, DefinitionKind value)
{
ostream.write_long(value.value());
}
}/* FieldNameHelper.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package org.omg.CORBA;
import gnu.CORBA.Restricted_ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
/**
* A formal helper for the CORBA FieldName that is identical to the
* narrow string.
*
* @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
*/
public abstract class FieldNameHelper
{
/**
* Insert the FieldName into Any (uses [EMAIL PROTECTED] Any.insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
*/
public static void insert(Any a, String that)
{
a.insert_string(that);
}
/**
* Extract the FieldName from Any ((uses [EMAIL PROTECTED] Any.extract_string}).
*
* @param a the Any to extract from.
*/
public static String extract(Any a)
{
return a.extract_string();
}
/**
* Return an string alias typecode, named "FieldName".
*/
public static TypeCode type()
{
ORB orb = Restricted_ORB.Singleton;
return orb.create_alias_tc(id(), "FieldName", orb.create_string_tc(0));
}
/**
* Return the FieldName repository id.
* @return "IDL:omg.org/CORBA/FieldName:1.0", always.
*/
public static String id()
{
return "IDL:omg.org/CORBA/FieldName:1.0";
}
/**
* Calls [EMAIL PROTECTED] InputStream#read_string()}.
*
* @param istream the stream to read from.
*/
public static String read(InputStream istream)
{
return istream.read_string();
}
/**
* Calls [EMAIL PROTECTED] OutputStream#write_string()}.
*
* @param ostream the stream to write into.
* @param value the string (FieldName) value to write.
*/
public static void write(OutputStream ostream, String value)
{
ostream.write_string(value);
}
}/* IdentifierHelper.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package org.omg.CORBA;
import gnu.CORBA.Restricted_ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
/**
* A formal helper for the CORBA Identifier that is identical to the
* narrow string.
*
* @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
*/
public abstract class IdentifierHelper
{
/**
* Insert the Identifier into Any (uses [EMAIL PROTECTED] Any.insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
*/
public static void insert(Any a, String that)
{
a.insert_string(that);
}
/**
* Extract the Identifier from Any ((uses [EMAIL PROTECTED] Any.extract_string}).
*
* @param a the Any to extract from.
*/
public static String extract(Any a)
{
return a.extract_string();
}
/**
* Return an string alias typecode, named "Identifier".
*/
public static TypeCode type()
{
ORB orb = Restricted_ORB.Singleton;
return orb.create_alias_tc(id(), "Identifier", orb.create_string_tc(0));
}
/**
* Return the Identifier repository id.
* @return "IDL:omg.org/CORBA/Identifier:1.0", always.
*/
public static String id()
{
return "IDL:omg.org/CORBA/Identifier:1.0";
}
/**
* Calls [EMAIL PROTECTED] InputStream#read_string()}.
*
* @param istream the stream to read from.
*/
public static String read(InputStream istream)
{
return istream.read_string();
}
/**
* Calls [EMAIL PROTECTED] OutputStream#write_string()}.
*
* @param ostream the stream to write into.
* @param value the string (Identifier) value to write.
*/
public static void write(OutputStream ostream, String value)
{
ostream.write_string(value);
}
}/* ParameterMode.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
/* ParameterMode.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package org.omg.CORBA;
/**
* Defines the parameter modes (the ways in that a method parameter
* is used during invocation).
*
* In CORBA, a method parameter can pass the value (PARAM_IN),
* be used as a placeholder to return the value (PARAM_OUT) or
* both pass the data and be used as a placeholder to return the
* changed value (PARAM_INOUT).
*
* @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
*/
public class ParameterMode
{
/**
* This value means that the parameter is an IN parameter.
*/
public static int _PARAM_IN = 0;
/**
* This value means that the parameter is an OUT parameter.
*/
public static int _PARAM_OUT = 1;
/**
* This value means that the parameter is an INOUT parameter.
*/
public static int _PARAM_INOUT = 2;
/**
* This value means that the parameter is an IN parameter.
*/
public static ParameterMode PARAM_IN = new ParameterMode(_PARAM_IN);
/**
* This value means that the parameter is an OUT parameter.
*/
public static ParameterMode PARAM_OUT = new ParameterMode(_PARAM_OUT);
/**
* This value means that the parameter is an INOUT parameter.
*/
public static ParameterMode PARAM_INOUT = new ParameterMode(_PARAM_INOUT);
/**
* The value of this parameter mode instance.
*/
private final int value;
/**
* The conversion table.
*/
private static final ParameterMode[] table =
new ParameterMode[] { PARAM_IN, PARAM_OUT, PARAM_INOUT };
/**
* Create an instance of the parameter mode with the given value.
*/
protected ParameterMode(int a_value)
{
value = a_value;
}
/**
* Return the integer value code for the given parameter mode.
*
* @return 0 for PARAM_IN, 1 for PARAM_OUT, 3 for PARAM_INOUT.
*/
public int value()
{
return value;
}
/**
* Get a parameter mode instance for the integer parameter mode code.
*
* @param p_mode a parameter mode (0..2).
*
* @return a corresponding parameter mode instance.
*
* @throws BAD_PARAM for the invalid parameter mode code.
*/
public static ParameterMode from_int(int p_mode)
{
try
{
return table [ p_mode ];
}
catch (ArrayIndexOutOfBoundsException ex)
{
throw new BAD_PARAM("Invalid parameter mode: " + p_mode);
}
}
}/* ParameterModeHelper.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package org.omg.CORBA;
import gnu.CORBA.Restricted_ORB;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
/**
* A helper operations for a method parameter modes.
* A method parameter can pass the value (PARAM_IN), be used as a placeholder
* to return the value (PARAM_OUT) or both pass the data and be used as a
* placeholder to return the changed value (PARAM_INOUT).
*
* @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
*/
public abstract class ParameterModeHelper
{
/**
* The cached typecode value, computed only once.
*/
private static TypeCode typeCode;
/**
* Insert the parameter mode into the given Any.
*/
public static void insert(Any any, ParameterMode that)
{
any.insert_Streamable(new ParameterModeHolder(that));
}
/**
* Extract the parameter mode from the given Any.
*/
public static ParameterMode extract(Any any)
{
return ((ParameterModeHolder) any.extract_Streamable()).value;
}
/**
* Get the parameter mode typecode (enumeration, named "ParameterMode").
* The typecode states that the enumeration can obtain one of
* the following values: PARAM_IN ,PARAM_OUT ,PARAM_INOUT .
*/
public static TypeCode type()
{
if (typeCode == null)
{
String[] members =
new String[] { "PARAM_IN", "PARAM_OUT", "PARAM_INOUT" };
typeCode =
Restricted_ORB.Singleton.create_enum_tc(id(), "ParameterMode", members);
}
return typeCode;
}
/**
* Get the parameter mode repository id.
*
* @return "IDL:omg.org/CORBA/ParameterMode:1.0", always.
*/
public static String id()
{
return "IDL:omg.org/CORBA/ParameterMode:1.0";
}
/**
* Read the enumeration value (as int) from the CDR intput stream.
*
* @param istream a stream to read from.
*/
public static ParameterMode read(InputStream istream)
{
return ParameterMode.from_int(istream.read_long());
}
/**
* Write the enumeration value (as int) to the CDR output stream.
*
* @param ostream a stream to write into.
* @param value a value to write.
*/
public static void write(OutputStream ostream, ParameterMode value)
{
ostream.write_long(value.value());
}
}/* ParameterModeHolder.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package org.omg.CORBA;
/**
* The holder for ParameterMode.
*
* @author Audrius Meskauskas ([EMAIL PROTECTED])
*/
public class ParameterModeHolder
implements org.omg.CORBA.portable.Streamable
{
/**
* The stored ParameterMode value.
*/
public ParameterMode value;
/**
* Create the initialised instance.
* @param initialValue
*/
public ParameterModeHolder(ParameterMode initialValue)
{
value = initialValue;
}
/**
* Fill in the [EMAIL PROTECTED] value} by data from the CDR stream.
*/
public void _read(org.omg.CORBA.portable.InputStream in)
{
value = ParameterModeHelper.read(in);
}
/**
* Get the typecode of the ParameterMode.
*/
public org.omg.CORBA.TypeCode _type()
{
return ParameterModeHelper.type();
}
/**
* Write the stored value into the CDR stream.
*/
public void _write(org.omg.CORBA.portable.OutputStream out)
{
ParameterModeHelper.write(out, value);
}
}
/* RepositoryIdHelper.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package org.omg.CORBA;
import gnu.CORBA.Restricted_ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
/**
* A formal helper for the CORBA Repository Id that is identical to the
* narrow string.
*
* @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
*/
public abstract class RepositoryIdHelper
{
/**
* Insert the Repository Id into Any (uses [EMAIL PROTECTED] Any.insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
*/
public static void insert(Any a, String that)
{
a.insert_string(that);
}
/**
* Extract the Repository Id from Any ((uses [EMAIL PROTECTED] Any.extract_string}).
*
* @param a the Any to extract from.
*/
public static String extract(Any a)
{
return a.extract_string();
}
/**
* Return an string alias typecode, named "RepositoryId"
*/
public static TypeCode type()
{
ORB orb = Restricted_ORB.Singleton;
return orb.create_alias_tc(id(), "RepositoryId", orb.create_string_tc(0));
}
/**
* Return the Repository Id repository id.
* @return "IDL:omg.org/CORBA/RepositoryId:1.0", always.
*/
public static String id()
{
return "IDL:omg.org/CORBA/RepositoryId:1.0";
}
/**
* Calls [EMAIL PROTECTED] InputStream#read_string()}.
*
* @param istream the stream to read from.
*/
public static String read(InputStream istream)
{
return istream.read_string();
}
/**
* Calls [EMAIL PROTECTED] OutputStream#write_string()}.
*
* @param ostream the stream to write into.
* @param value the string (Repository Id) value to write.
*/
public static void write(OutputStream ostream, String value)
{
ostream.write_string(value);
}
}/* SetOverrideTypeHelper.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package org.omg.CORBA;
import gnu.CORBA.SetOverrideTypeHolder;
import gnu.CORBA.Restricted_ORB;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
/**
* A helper operations for the definition kind.
*
* @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
*/
public abstract class SetOverrideTypeHelper
{
/**
* The cached typecode value, computed only once.
*/
private static TypeCode typeCode;
/**
* Insert the definition kind into the given Any.
*/
public static void insert(Any any, SetOverrideType that)
{
any.insert_Streamable(new SetOverrideTypeHolder(that));
}
/**
* Extract the definition kind from the given Any.
*/
public static SetOverrideType extract(Any any)
{
return ((SetOverrideTypeHolder) any.extract_Streamable()).value;
}
/**
* Get the definition kind typecode (enumeration, named "SetOverrideType").
* The typecode states that the enumeration can obtain one of
* the following values: SET_OVERRIDE ,ADD_OVERRIDE .
*/
public static TypeCode type()
{
if (typeCode == null)
{
String[] members =
new String[]
{
"SET_OVERRIDE" ,"ADD_OVERRIDE"
};
typeCode =
Restricted_ORB.Singleton.create_enum_tc(id(), "SetOverrideType",
members
);
}
return typeCode;
}
/**
* Get the definition kind repository id.
*
* @return "IDL:omg.org/CORBA/SetOverrideType:1.0", always.
*/
public static String id()
{
return "IDL:omg.org/CORBA/SetOverrideType:1.0";
}
/**
* Read the enumeration value (as int) from the CDR intput stream.
*
* @param istream a stream to read from.*
*/
public static SetOverrideType read(InputStream istream)
{
return SetOverrideType.from_int(istream.read_long());
}
/**
* Write the enumeration value (as int) to the CDR output stream.
*
* @param ostream a stream to write into.
* @param value a value to write.
*/
public static void write(OutputStream ostream, SetOverrideType value)
{
ostream.write_long(value.value());
}
}
/* SetOverrideTypeHolder.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.CORBA;
import org.omg.CORBA.SetOverrideType;
import org.omg.CORBA.SetOverrideTypeHelper;
/**
* The holder for SetOverrideType.
*
* @author Audrius Meskauskas ([EMAIL PROTECTED])
*/
public class SetOverrideTypeHolder
implements org.omg.CORBA.portable.Streamable
{
/**
* The stored SetOverrideType value.
*/
public SetOverrideType value;
/**
* Create the initialised instance.
*
* @param initialValue the initial value.
*/
public SetOverrideTypeHolder(SetOverrideType initialValue)
{
value = initialValue;
}
/**
* Fill in the [EMAIL PROTECTED] value} by data from the CDR stream.
*/
public void _read(org.omg.CORBA.portable.InputStream in)
{
value = SetOverrideTypeHelper.read(in);
}
/**
* Get the typecode of the SetOverrideType.
*/
public org.omg.CORBA.TypeCode _type()
{
return SetOverrideTypeHelper.type();
}
/**
* Write the stored value into the CDR stream.
*/
public void _write(org.omg.CORBA.portable.OutputStream out)
{
SetOverrideTypeHelper.write(out, value);
}
}/* DefinitionKindHolder.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.CORBA;
import org.omg.CORBA.DefinitionKind;
import org.omg.CORBA.DefinitionKindHelper;
/**
* The definition kind holder. This class is not included in the original
* API specification, so we place it outside the org.omg namespace.
*
* @author Audrius Meskauskas ([EMAIL PROTECTED])
*/
public class DefinitionKindHolder
implements org.omg.CORBA.portable.Streamable
{
/**
* The stored value.
*/
public DefinitionKind value;
/**
* Create the initialised instance.
* @param initialValue
*/
public DefinitionKindHolder(DefinitionKind initialValue)
{
value = initialValue;
}
/**
* Read from the CDR stream.
*/
public void _read(org.omg.CORBA.portable.InputStream in)
{
value = DefinitionKindHelper.read(in);
}
/**
* Get the typecode.
*/
public org.omg.CORBA.TypeCode _type()
{
return DefinitionKindHelper.type();
}
/**
* Write into the CDR stream.
*/
public void _write(org.omg.CORBA.portable.OutputStream out)
{
DefinitionKindHelper.write(out, value);
}
}
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches