[omniORB] CORBA::Any_var

Duncan Grisby dgrisby@uk.research.att.com
Fri, 11 Jan 2002 10:49:19 +0000


On Friday 11 January, =?iso-8859-1?Q?Andr=E9n_Clas?= wrote:

> I've got a CORBA::Any_var stored as a member variable and in my
> application I want to test if this CORBA::Any_var has been supplied a
> value (for example new CORBA::Any()). For this case, does CORBA offer
> any method similar to the CORBA::is_nil() method for NULL testing a _ptr
> variable ????

There's no nice function to do it, but you can use a side-effect of
the Any_var mapping:

  CORBA::Any_var a;

  if (a.operator->() == 0) {
    cout << "The Any_var has not been initialised" << endl;

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --