class SomeCrap{public: virtual double GetSomeShit() const;protected: virtual double CalculateSomeShit() const; double GetShitValue() const { return m_shitValue; } // такой себе каноничныйъ геттеръprivate: double m_shitValue; };
class SomeCrap{public: virtual double GetSomeShit() const;protected: virtual double CalculateSomeShit() const; double m_shitValue; // поскольку нет смысла читать это значие извне - оно может жить здеть и без геттера.};
class SomeCrap{public: virtual double GetSomeShit() const;};class SomeNewCrap: public SomeCrap{public: double GetSomeShit() const;};
class SomeCrap{public: double GetSomeShit() const;};class SomeNewCrap: public SomeCrap{public: virtual double GetSomeShit() const;};
C++ (Qt)class SomeCrap{public: virtual double GetSomeShit() const = 0;}; class SomeConcreteCrap : public SomeCrap{private: virtual double GetSomeShit() const { return CalculateSomeShit(); } protected: virtual double CalculateSomeShit() const; double GetShitValue() const { return m_shitValue; } private: double m_shitValue; };