Inside the class definition:
CS_DECLARE_STATIC_CLASSVAR(parentage,getParentageMap,csParentageMap);
CS_DECLARE_STATIC_CLASSVAR(eventNames,getEventNames,csStringSet);
In the implementation file:
CS_IMPLEMENT_STATIC_CLASSVAR(csEventNameRegistry,parentage,getParentageMap,csEventNameRegistry::csParentageMap,());
CS_IMPLEMENT_STATIC_CLASSVAR(csEventNameRegistry,eventNames,getEventNames,csStringSet,());
There is one bottleneck method that sets the static using the creator. Unfortunately, it looks like "parentage" is taking on different values in different contexts...
(gdb) where
#0 csEventNameRegistry::GetID (name=0xb722d4dc "crystalspace.application.open") at libs/csutil/eventnames.cpp:32
(gdb) list
29 csEventID csEventNameRegistry::GetID (const char *name)
30 {
31 if (parentage == 0) {
32 parentage = getParentageMap();
33 eventNames = getEventNames();
34 }
35
(gdb) print parentage
$19 = (csHash<csEventID,csEventID> *) 0x8126ca0
(gdb) call getParentageMap()
$20 = (csHash<csEventID,csEventID> *) 0x8134be8
(gdb) print eventNames
$21 = (csStringSet *) 0x8125f60
(gdb) print getEventNames()
$22 = (csStringSet *) 0x8134be8
All of them ($19, $20, $21, $22) are properly initialized objects. One batch of calls (from core CS code, csKeybaordDriver) use $19 and $21, while a latter call from a plugin seems to be using $20 and $22. Yuck.
Am I missing something? Am I not using the macros correctly?
Adam
|
-- Adam D. Bradley <[EMAIL PROTECTED]> Boston University Dept. of Computer Science |
signature.asc
Description: This is a digitally signed message part
