class CFoobar
{
private:
// Public member variables are bad, mmkay?
int m_iFoo;
RGB m_rgbBar;
double m_dBaz;
public:
// Encapsulation is good, mmkay?
// I'm so clever, using a pointer to avoid both a get AND a set for each member variable!
int *GetFoo() { return &m_iFoo; }
RGB *GetBar() { return &m_rgbBar; }
// (Repeat for every member of CFoobar)
};
void frobnicate()
{
CFoobar *foo = new CFoobar();
// Wow! This is much easer than writing foo->setFoo(foo->getFoo()+7);
*foo->GetFoo() = *foo->GetFoo()+7;
double thing = *foo->GetBaz();
// etc...
delete foo;
}
Yup. Complete with the Microsoft bastardization of the Hungarian notation and the ever-so-important C-prefix on the class names so you always when you're using a class and when you're using a struct.Guuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu.