23 #define private public
24 #define protected public
25 #include <omniORB4/CORBA.h>
26 #include <omniORB4/internal/typecode.h>
37 #include "SALOME_GenericObj.hh"
45 using namespace YACS::ENGINE;
50 CORBA::Object_var obj;
51 if(data >>= CORBA::Any::to_object(obj))
53 SALOME::GenericObj_var gobj;
56 gobj=SALOME::GenericObj::_narrow(obj);
58 catch(
const CORBA::SystemException& )
62 if(!CORBA::is_nil(gobj))
64 DEBTRACE(
"It's a SALOME::GenericObj");
68 DEBTRACE(
"It's a CORBA::Object but not a SALOME::GenericObj");
71 DEBTRACE(
"It's not a CORBA::Object");
76 CORBA::Object_var obj;
77 if(data >>= CORBA::Any::to_object(obj))
79 SALOME::GenericObj_var gobj;
82 gobj=SALOME::GenericObj::_narrow(obj);
84 catch(
const CORBA::SystemException& )
88 if(!CORBA::is_nil(gobj))
90 DEBTRACE(
"It's a SALOME::GenericObj");
94 DEBTRACE(
"It's a CORBA::Object but not a SALOME::GenericObj");
97 DEBTRACE(
"It's not a CORBA::Object");
141 put((CORBA::Any *)data);
146 CORBA::TypeCode_var tc=data->type();
149 case CORBA::tk_double:
167 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)data->pd_tc.in())->pd_ref_count);
183 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)_data.pd_tc.in())->pd_ref_count);
194 return (
void *)&
_data;
199 CORBA::TypeCode_var tc=
_data.type();
200 return tc->equivalent(CORBA::_tc_null);
212 CORBA::TypeCode_var tc=
getAny()->type();
213 if (!tc->equivalent(CORBA::_tc_null))
256 CORBA::TypeCode_var tc=
_data.type();
257 if (tc->equivalent(CORBA::_tc_null))
258 return "<value>nil</value>";
275 int isString = PyString_Check(
getPyObj());
276 PyObject *strPyObj = PyObject_Str(
getPyObj());
277 string val = PyString_AsString(strPyObj);
279 val =
"\"" + val +
"\"";
307 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)
_data.pd_tc.in())->pd_ref_count);
308 DEBTRACE(
"refcount CORBA tc_double: " << ((omni::TypeCode_base*)CORBA::_tc_double)->pd_ref_count);
314 put((CORBA::Any *)data);
324 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)data->pd_tc.in())->pd_ref_count);
327 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)_data.pd_tc.in())->pd_ref_count);
338 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)_data.pd_tc.in())->pd_ref_count);
342 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)data->pd_tc.in())->pd_ref_count);
345 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)_data.pd_tc.in())->pd_ref_count);
362 CORBA::Any*
a=
new CORBA::Any;
364 CORBA::TypeCode_var
t;
368 a->replace(CORBA::_tc_long, (
void*) 0);
372 a->replace(CORBA::_tc_string, (
void*) 0);
376 a->replace(CORBA::_tc_double, (
void*) 0);
381 a->replace(t, (
void*) 0);
386 a->replace(t, (
void*) 0);
392 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)t.in())->pd_ref_count);
394 a->replace(t, (
void*) 0);
396 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)t.in())->pd_ref_count);
399 else if(kind ==
Bool)
401 a->replace(CORBA::_tc_boolean, (
void*) 0);
403 else if(kind ==
NONE)
406 msg <<
"Cannot set Any Out for None" << __FILE__ <<
":" << __LINE__;
412 msg <<
"Cannot set Any Out for unknown type" << __FILE__
419 DEBTRACE(
"refcount CORBA : " << ((omni::TypeCode_base*)a->pd_tc.in())->pd_ref_count);
427 CORBA::TypeCode_var tc=
getAny()->type();
428 if (!tc->equivalent(CORBA::_tc_null))
448 CORBA::TypeCode_var tc=
_data.type();
449 if (tc->equivalent(CORBA::_tc_null))
450 return "<value>nil</value>";
460 os << p.
_name <<
" : " << l ;
468 PyObject *strPyObj = PyObject_Str(
getPyObj());
469 string val = PyString_AsString(strPyObj);