On 29.10.2005 10:05, Adam D. Bradley wrote: > Am I missing something? Am I not using the macros correctly? It might be good to know that those static variables are not as global as you may think or expect. Specifically, they are global to a *module* - that is, for a given plugin (or also application module), there is one copy of that variable, however, different modules don't share it and have their own distinct copies of it.
Then we should probably fix the docs in cssysdef.h, which call it a global without blushing:
/**\def CS_IMPLEMENT_STATIC_VAR(getterFunc,Type,initParam,kill_how)
* Create a global variable thats created on demand. Create a Getter function
* to access the variable and a destruction function. The Getter function will
* register the destruction function on first invocation. Example:
* <pre>
* CS_IMPLEMENT_STATIC_VAR (GetVertexPool, csVertexPool,)
* </pre>
* This will give you a global function GetVertexPool that returns a pointer to
* a static variable.
*/
To get a truly global data storage, the best way is to put some "keeper" object(s) into the object registry.
Reasonable enough. I'm going to guess that there's no easy way to get a pointer to the "current" iObjectRegistry without having to pass it around as an argument (what does "current" mean, anyway)... so I suppose I'll need to add a csEventNameRegistry::Initialize(iObjectRegistry *) to get this all set up properly.
Adam
|
-- Adam D. Bradley <[EMAIL PROTECTED]> Boston University Dept. of Computer Science |
signature.asc
Description: This is a digitally signed message part
