Language Mapping for Sequences
  • Each IDL sequence is mapped to a specific C++ class
    • All of these classes have a very similar interface
    • In fact, they could have been defined as a template class, but this is not mandated by the standard
    • Some implementations emit a unique C++ class definition for each sequence, others simply instantiate a template class
  • The sequence definition from the Auction system for a list of Items looks like:
      typedef sequence< Item > ItemList;
      
  • The C++ class for this sequence is shown in Code Sample 8
    • There are a fairly large number of member functions, but the class is really quite simple
      • It is a buffer with N slots
      • The number of slots can be queried or set
      • The [] operator is overloaded to allow setting/getting of each slot

Next Slide >>