More on GNCIdType..

Derek Atkins warlord@MIT.EDU
24 Nov 2001 15:50:06 -0500


Lots of code has:

  switch (id_type) {
  case GNC_ID_FOO:
     do stuff;
     break;
  }

Changing to strings will most certainly cause problems, or at
least performance slowdowns.  Most of these switch statements
appear to be in event processing.  How often does event processing
happen?

An alternative to using strings is to allow modules to create
arbitrary 32-bit numbers to be used for the Id..  That would
at least still allow us to keep the integral switch() statements,
but it would also mean that modules would have to be a bit more
aware of what "Id" they chose.  Then again, they have to be
aware of what string they choose, so perhaps it isn't as big
a deal.

Suggestions?  Comments?

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available