.
, , .
struct AConfig1 { int a; int b; };
struct AConfig2 { int a; std::map<int,int> b; }
b, , :
class AConfig1 { public: int getA() const; int getB() const; };
class AConfig2 { public: int getA() const; int getB(int key = 0) const; };
, .
, PIMPL.
namespace details { class AConfigurationImpl; }
class AConfiguration {
public:
int getA() const;
int getB() const;
private:
AConfigurationImpl* m_impl;
};
, , .
, :
VISIDLE ( ).
, . AConfigurationImpl - , .
The more code means: constructor, copy constructor, assignment operator and destructor, which is a sufficient sum and, of course, getters and setters. Also note that these methods can no longer be inlined since their implementation is defined in the source file.
Regardless of whether it suits you, you decide.
source
share