I'm working on a small IO library where the requirements for the interface are known, but the implementation is likely to change. The library is supposed to read and writes files into an archive format as well as store some metadata.
I though about using pimpl as it seems to be well suited for this task. My question is if the implementation can be split into two files like in the example below:
class Writer
{
private:
class WriterImpl; // Currently writes ZIP archives, but this can change
std::unique_ptr<WriterImpl> m_writerimpl;
class MetaImpl; // Currently uses XML
std::unique_ptr<MetaImpl> m_metaimpl;
}
Is that still using the pimpl pattern? Or would it be better to have a single pointer to WriterImpl class, which would then contain pointers to ZipWriter
and XMLWriter
?