Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Question on the managers

(1/1)

jmccay:
   I understand that the template Mgr is basically a Singleton pattern base class template for all the managers.  Mgr includes code to insure that another instance is not created when it is shutting down.  The class Manager appears to manage all the various managers.  It has similar code implementing the Singleton pattern, but it doesn't include the code to insure it is not created when shutting down.  How come?  Also, why are there two versions of Get in Manager?  What is the purpose of the second one (the one with the argument)?  Get() appears to be the one called most often.

Also, what was the rational for using the managers?  Was it to provide one location for the plug-ins to get various resources?  Or was there another rational?  I am just trying to understand the Code::Blocks code.  Thanks.
jmccay

thomas:

--- Quote ---The class Manager [...] doesn't include the code to insure it is not created when shutting down.  How come?
--- End quote ---
Because that's not what the code you're talking about does. Mgr does not re-create a Mgr-derived class once this particular class has been told to shut down.
Manger does not need such functionality. It exists from early in the application's lifetime until the very end.


--- Quote ---Also, why are there two versions of Get in Manager?  What is the purpose of the second one (the one with the argument)?
--- End quote ---
There is no second version. Use Get(), nothing else.


--- Quote ---Also, what was the rational for using the managers?  Was it to provide one location for the plug-ins to get various resources?
--- End quote ---
The rationale was to have a set of resources/features that are "just there" when some component needs them.

Navigation

[0] Message Index

Go to full version