[omniORB] recursive typecodes

Renzo Tomaselli renzo.tomaselli at tecnotp.it
Wed Apr 6 19:14:21 BST 2005


Hi all,
    I have some problems while building a recursive typecode 
dynamically, while everythings works file from standard idl (e.g. 
static) usage.
Let's consider the canonical binary tree example (pasting from my idl):

typedef sequence<JobNode, 2> JobNodeList;
struct JobNode {
    JobNodeList next;
};

In a dynamic building procedure, we would have:

CORBA::TypeCode_var tcNode = orb->create_recursive_tc("IDL:/JobNode:1.0");
CORBA::TypeCode_var tcSeq = orb->create_sequence_tc(2, tcNode);
CORBA::TypeCode_var tcAlias = 
orb->create_alias_tc("IDL:/JobNodeList:1.0", "JobNodeList", tcSeq);
...
the last statement throws an exception from method NP_resolved(), since 
it tries to match JobNodeList vs. Node, failing of course.
Indeed JobNode would be resolved one step out. I guess a nested 
definition would work as a workaround (I'll try it later), however I 
feel this behavior fighting against the correct beehavior while derived 
from static idl.
Any suggestion ? Thanks,

Renzo Tomaselli







More information about the omniORB-list mailing list