GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » Bug in sigleton classes in fairbase/base
Re: Bug in sigleton classes in fairbase/base [message #9630 is a reply to message #9629] Tue, 27 October 2009 15:27 Go to previous message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *
Hi Bertram,

As I said before, it is nicer to have the ctor privet, but it is not a really a bug that change behavior of the singleton. in the compiled code you always use the instance and this is working, all these singleton classes are some kind of managers that have to be created from the macro (RunAna and RunSim) or by the framework itself (IO manager) and then the user uses the instance.


But exactly this should be avoided in a singleton. The only way to get access to a singleton object should be possible via a static instance function. The singleton itself has to take care of calling its own ctor.
Therefore I would prefer to follow the recommendations of object oriented design patterns.

The design pattern book is simply some recommendations for implementations, and does not present the object oriented standard, even C++ itself is not 100% object oriented (and this make it usable in contrary to JAVA or smaltalk) . Anyway when I have time I will change it, but not now.


Read Message
Read Message
Read Message
Read Message
Previous Topic: Problems with integer FairTrackPar charge
Next Topic: Can't run Geane
Goto Forum:

Current Time: Mon Jun 17 21:18:13 CEST 2024

Total time taken to generate the page: 0.01086 seconds