Hide a private static variable.

This is so-called Scott Mayers' singleton pattern.
This commit is contained in:
Tsuda Kageyu 2015-11-23 01:32:12 +09:00
parent e44de9f37f
commit 25ffbcb4b9
2 changed files with 2 additions and 5 deletions

View File

@ -71,14 +71,13 @@ public:
}
};
FrameFactory FrameFactory::factory;
////////////////////////////////////////////////////////////////////////////////
// public members
////////////////////////////////////////////////////////////////////////////////
FrameFactory *FrameFactory::instance()
{
static FrameFactory factory;
return &factory;
}
@ -519,5 +518,4 @@ void FrameFactory::updateGenre(TextIdentificationFrame *frame) const
fields.append(String());
frame->setText(newfields);
}

View File

@ -66,6 +66,7 @@ namespace TagLib {
{
public:
static FrameFactory *instance();
/*!
* Create a frame based on \a data. \a synchSafeInts should only be set
* false if we are parsing an old tag (v2.3 or older) that does not support
@ -162,8 +163,6 @@ namespace TagLib {
void updateGenre(TextIdentificationFrame *frame) const;
static FrameFactory factory;
class FrameFactoryPrivate;
FrameFactoryPrivate *d;
};