[omniORB] Sequences/allocbuf/freebuf comment

Gary D. Duzan gdd0@gte.com
Thu, 15 Feb 2001 19:00:47 -0500


In Message <3A8C6A61.6A28EFE4@research.att.com> ,
   "Glenn A. Hochberg" <gah@research.att.com> wrote:

=>CSeq_var seq = new CSeq(n);    // allocates a sequence with enough room for n
=>elements
=>seq->length(n);    // set length
=>// initialize each member using accessor
=>for (CORBA::ULong i = 0; i < n; i++) {
=>    (*seq)[i].foo = a;
=>    (*seq)[i].bar = b;
=>    ...
=>}
=>return seq._retn();

   Actually, if I remember correctly, you can use:

      seq[i].foo = a;
      seq[i].bar = b;

when seq is a sequence_var, making it more readable.

					Gary Duzan
					Verizon Laboratories