[Scummvm-devel] Namespaces

David Eriksson david at scummvm.org
Fri Oct 3 03:59:04 CEST 2003

On Thu, 2003-10-02 at 19:19, Max Horn wrote:
> Hi folks,
> I was thinking about making more use of namespaces in ScummVM. In 
> particular, I'd like to propose that each engine module (scumm, simon, 
> sky, sword2, queen) shall put (most of) its classes etc. into a unique 
> namespace (Scumm, Simon, Sky, Sword2, Queen).
> Right now, we use the old "prefix" approach to avoid name clashes. For 
> example, in scumm/ we have class Sound, and the others have SimonSound, 
> SkySound, BaseSound. Using namespaces for this IMHO is simply much more 
> elegant. Also, if we strictly adhere to using a unique namespace for 
> each project, we avoid any name clashes (and the problems caused by 
> this, esp. if they are 'silent') right from the start.
> The current "ScummVM" namespace (used by some stuff in common) then 
> would be renamed ot something like "Common" to avoid mixing it up with 
> the "Scumm" namespace.
> I really see no negative point about this, only positive. I am willing 
> to do most of the needed work, which essentially amount to adding some 
> "namespace FOO { }" and "using namespace FOO" in our header&source 
> files.
> Still, wanted to ask what people think about it before I touch most of 
> our files :-)

Very good idea!

David Eriksson <david at scummvm.org>

More information about the Scummvm-devel mailing list