T
Tony Johansson
Hello!
Assume I have a class definition of CSpaceship below.
Here you have the macro definition of
#define METHOD_PROLOGUE(theClass, localClass) \
theClass* pThis = \
((theClass*)((BYTE*)this - offsetof(theClass, m_x##localClass)));
If I have the following statement METHOD_PROLOGUE(CSpaceship, XMotion)
within class XMotion in method GetPosition.what will the result of pThis be.
I also wonder what is this here?
class CSpaceship
{
protected:
int m_nPosition, m_nAcceleration
public:
Cspaceship(){m_nPosition = m_nAcceleration =0;}
ClassXMotion : public Imotion
{
Xmotion(){}
virtual void Fly();
virtual int& GetPosition();
}m_xMotion;
friend class Xmotion*;
};
//Tony
Assume I have a class definition of CSpaceship below.
Here you have the macro definition of
#define METHOD_PROLOGUE(theClass, localClass) \
theClass* pThis = \
((theClass*)((BYTE*)this - offsetof(theClass, m_x##localClass)));
If I have the following statement METHOD_PROLOGUE(CSpaceship, XMotion)
within class XMotion in method GetPosition.what will the result of pThis be.
I also wonder what is this here?
class CSpaceship
{
protected:
int m_nPosition, m_nAcceleration
public:
Cspaceship(){m_nPosition = m_nAcceleration =0;}
ClassXMotion : public Imotion
{
Xmotion(){}
virtual void Fly();
virtual int& GetPosition();
}m_xMotion;
friend class Xmotion*;
};
//Tony