Beispiel #1
0
static PyObject *
pycorba_orb_string_to_object(PyCORBA_ORB *self, PyObject *args)
{
    CORBA_Object objref;
    CORBA_Environment ev;
    gchar *ior;
    PyObject *py_objref;

    if (!PyArg_ParseTuple(args, "s:CORBA.ORB.string_to_object", &ior))
	return NULL;
    
    CORBA_exception_init(&ev);
    objref = CORBA_ORB_string_to_object(self->orb, ior, &ev);
    if (pymatecorba_check_ex(&ev))
	return NULL;
    py_objref = pycorba_object_new(objref);
    CORBA_Object_release(objref, NULL);
    return py_objref;
}
Beispiel #2
0
static PyObject *
pycorba_orb_resolve_initial_references(PyCORBA_ORB *self, PyObject *args)
{
    CORBA_Object objref;
    CORBA_Environment ev;
    gchar *identifier;
    PyObject *py_objref;

    if (!PyArg_ParseTuple(args, "s:CORBA.ORB.resolve_initial_references",
			  &identifier))
	return NULL;
    
    CORBA_exception_init(&ev);
    objref = CORBA_ORB_resolve_initial_references(self->orb, identifier, &ev);
    if (pymatecorba_check_ex(&ev))
	return NULL;
    /* PortableServer::POA isn't a real CORBA object */
    if (!strcmp(identifier, "RootPOA")) {
	return pymatecorba_poa_new((PortableServer_POA)objref);
    }
    py_objref = pycorba_object_new(objref);
    CORBA_Object_release(objref, NULL);
    return py_objref;
}
Beispiel #3
0
static PyObject *
pyorbit_poa_servant_to_reference(PyCORBA_Object *self, PyObject *args)
{
    CORBA_Environment ev;
    PyPortableServer_Servant *pyservant;
    PortableServer_ServantBase *servant;
    CORBA_Object reference;
    PyObject *py_reference;

    if (!PyArg_ParseTuple(args, "O!:POA.servant_to_reference",
			  &PyPortableServer_Servant_Type, &pyservant))
	return NULL;
    servant = PYSERVANT_TO_SERVANT(pyservant);

    CORBA_exception_init(&ev);
    reference = PortableServer_POA_servant_to_reference((PortableServer_POA)self->objref,
							servant, &ev);
    if (pyorbit_check_ex(&ev))
	return NULL;

    py_reference = pycorba_object_new(reference);
    CORBA_Object_release(reference, NULL);
    return py_reference;
}
static PyObject *
pymatecomponent_corbaobject_from_value(const GValue *value)
{
    return pycorba_object_new((CORBA_Object)g_value_get_boxed(value));
}