We use plugins framework which heavily exploits macros. These macros may introduce new methods and fields in class definition. In this case sove VAX functionality fails for methods of this class. I cannot navigate with Alt+G from method declaration to method definition and Create Implementation of a method generates stub as a global function,without MyClass:: prefix. If I comment out our macros, everything immediately works right.
Here is the code:
class MyClass : public msa::IObject, private msa::ObjectImpl {
public:
...
// These lines are confusing:
MSA_BEGIN_IMPLEMENT_IOBJECT;
MSA_END_IMPLEMENT_IOBJECT;
...
}
That's how macros are defined:
#define MSA_BEGIN_IMPLEMENT_IOBJECTBASE\ private:\ msa::internal::Counter m_counter;\ \ public:\ virtual int AddRef() const\ {\ return m_counter.AddRef();\ }\ \ virtual int Release() const\ {\ int iLocalCounter = m_counter.Release();\ if (iLocalCounter == 0) delete this;\ return iLocalCounter;\ }\ \ virtual msa::Status QueryInterface(const char* in_IID, const void** out_ppObject) const\ {\ return msa::internal::RemoveConst(this)->QueryInterface(in_IID, const_cast<void**>(out_ppObject));\ }\ \ virtual msa::Status QueryInterface(const char* in_IID, void** out_ppObject)\ {\ msa::Status result;
#define MSA_END_IMPLEMENT_IOBJECTBASE\ return msa::STATUS_ENOINTERFACE;\ }
#define MSA_BEGIN_IMPLEMENT_IOBJECT \ MSA_BEGIN_IMPLEMENT_IOBJECTBASE
#define MSA_END_IMPLEMENT_IOBJECT \ MSA_END_IMPLEMENT_IOBJECTBASE \ void RegisterDeleteTracker(msa::INotifiable3* in_pObject,void* in_pParam)\ {\ msa::ObjectImpl::RegisterDeleteTracker(in_pObject, in_pParam);\ }\ void UnregisterDeleteTracked(msa::INotifiable3* in_pObject)\ {\ msa::ObjectImpl::UnregisterDeleteTracker(in_pObject);\ }\ virtual unsigned long GetThreadAffinity()\ {\ return msa::ObjectImpl::GetThreadAffinity();\ }\ virtual msa::Status MoveToThread(unsigned long in_ulThread)\ {\ return msa::ObjectImpl::MoveToThread(in_ulThread);\ }