On Nov 4, 2005, at 12:25 AM, Dr. Adam D. Bradley wrote:
I've re-worked the name registry to be as un-global-y as possible,
and would appreciate a sanity check.
Basically, any module (plugin, app, etc) that needs event name
resolution has to call csEventNameRegistry::Register(object_reg)
with a valid iObjectRegistry pointer. After this, they call the
(static) method csEventNameRegsitry::GetID("whatever.string") and
are routed to the name registry associated with the current object
registry (which is also stored using the STATIC_CLASSVAR mechanism).
class CS_CRYSTALSPACE_EXPORT csEventNameRegistry : public iBase {
static void Register (iObjectRegistry*);
CS_CONST_METHOD static csEventID GetID (const char *name);
This seems a bit round-about and also somewhat inconsistent with the
typical CS idiom for "global" objects. It might be simpler and more
idiomatic to create an iEventNameRegistry interface which declares
GetID(), etc., and have csEventNameRegistry implement that interface.
Next, either have csInitializer::CreateEventQueue() also instantiate
a new csEventNameRegistry and place it in the iObjectRegistry, or add
a new csInitializer method to perform this task. Once this is done,
clients can query the object registry for iEventNameRegistry, just as
they would query for iEventQueue or any other "global" object when
needed.
-- ES
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]