I have really never made use of namespaces, and am considering them at the moment.
My situation. I have a class Reverb
. It contains as members instances of other classes, declared in the same header file, above it. Now there are appearing more and more data structures, relevant to the Reverb
class e.g. 3 different representations of the user settings.
So I made a class Settings, that contains 3 sub-classes for the 3 representations and some methods to convert between them.
My question is where to place that?
- Put it inside
Reverb
? Then theReverb
API becomes quite bloated and scroll-heavy. - Put it in file scope? Any user of the header will be unpleasantly surprised to find a class
Settings
, that actually meansReverbSettings
. - Create a
namespace Reverb
and put everything in it? Then what to do with theclass Reverb
? It would be strange to ask forReverb::Reverb
. - Any better solution?
Settings
toReverbSettings
?Reverb::Settings::GuiCommand::validate()
.