[orbitcpp-list] A bit of a problem
Status: Beta
Brought to you by:
philipd
|
From: John L. <jk...@lu...> - 2000-11-12 09:34:57
|
I have been working quite a bit with sequences and Anys.. Everything in
the current CVS works, except for proper sequence packing/unpacking.
However, when testing exceptions with sequences, I came across a bitch
of a problem. The problem is that every sequence needs "spec code" that
is triggered by a Typedef that issues a job that is run when outside of
an interface (class). This is basically fine but what about this:
interface Test {
typedef sequence<long> LongSeq;
exception Fail { LongSeq theProblem; };
};
Well the spec is written after the class Test, but there is an
instantiation in the exception, before the spec code. Only one spec is
needed for each unique C++ type of template (ie two typedef
sequence<long>s produce one spec). To this end there is a list that is
put in the compiler state that keeps track of seqs and arrays. when the
spec job is about to be queued, it is checked. Since we can't predict
when this situation is going to occur, it seems like the only thing is
to build the unique sequence list during the gather pass and then the
first thing during the translate pass is to output those sequence specs.
Of course there is put the specs in another file solution, but I think
that is too unwieldy.
Your thoughts?
John Luebs
|