NAME

CORBA::Any - The void pointer of CORBA


SYNOPSIS

  my $any = new CORBA::Any();
  if (!$any->insert(88, 'unsigned long')) {
    print "Unable to insert an unsigned long for some reason.\n";
  }
  my $value;
  if ($any->extract(\$value, CORBA::_tc_ulong)) {
    print "This CORBA::Any contains $value\n";
  }


DESCRIPTION

The CORBA::Any can be used as a generic holder for various CORBA types as well as user defined types. This generic holder can be passed as parameters to or returned from IDL interface methods. In order to do this, the CORBA::Any moduled must be loaded before any IDL generated modules are loaded.


METHODS

insert - This method takes a value, the first paramter, and stores it. The second parameter determines the type (either a string representation or an actual CORBA::TypeCode) of the first paramter. If the second parameter is omitted, the value's type will be automatically determined (as well as possible, since scalar types do not have type information). It returns true if the insertion is successful.

The following types are currently supported:

  null - CORBA::_tc_null
  void - CORBA::_tc_void
  short - CORBA::_tc_short
  long - CORBA::_tc_long
  unsigned short - CORBA::_tc_ushort
  unsigned long - CORBA::_tc_ulong
  float - CORBA::_tc_float
  double - CORBA::_tc_double
  boolean - CORBA::_tc_boolean
  char - CORBA::_tc_char
  octet - CORBA::_tc_octet
  any - CORBA::_tc_any
  TypeCode - CORBA::_tc_TypeCode
  objref - CORBA::_tc_Object
  struct
  union
  enum
  string - CORBA::_tc_string
  string<bound>
  sequence
  array
  alias
  except
  long long - CORBA::_tc_longlong
  unsigned long long - CORBA::_tc_ulonglong
  long double - CORBA::_tc_longdouble
  local_interface
  wchar - CORBA::_tc_wchar
  wstring - CORBA::_tc_wstring

extract - This method takes a scalar reference as the first parameter and places the stored value into it. The second parameter, if provided, determines the desired type. It returns true if the second parameter is omitted or the desired type matches the stored type.

type - The CORBA::TypeCode of the stored type.