Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Pimpl Idiom - Find References

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
hammonjj Posted - Jan 22 2014 : 5:10:24 PM
I apologize for placing this in the Bug Reports forums as I didn't see a help forum (http://forum.wholetomato.com/forum/default.asp?CAT_ID=5). Whenever I try to "Find References" on a member variable of a private implementation class, it doesn't find anything. I assume because it is looking for m_nSomeInteger where, instead, it is cPrivateData->m_nSomeInteger.

Now, I'm still a VAX n00b, so I'm assuming it is with how I have things setup. If that's the case, can someone tell me how to fix this? If not, please take this as a bug report :)

Thanks
James
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jan 24 2014 : 6:06:18 PM
In this code sample, when you trigger Find References on the two references to "m_pDevice" in "CPOMSCTE104DeviceCOMHandler::CPrivateData" how many references are found? For me VA is returning 3 references in both cases.

I am getting the same 3 references when I run Find References on "m_pDevice" in:

CPOMSCTE104DeviceCOMHandler::~CPOMSCTE104DeviceCOMHandler()

I am running all of these tests on the code in the cpp file. I assume you are getting different results?
hammonjj Posted - Jan 23 2014 : 4:48:34 PM
Hi Feline

I've included an example below. It seems that in many files, if I right click on m_pDevice from within the definition of CPrivateData (the CPP file), that VAX will not find instances where m_pDevice is used. However, if I right click on m_pDevice from the destructor of CPOMSCTE104DeviceCOMHandler, then it will find references properly.

Thoughts?

POMSCTE104DeviceCOMHandler.h

class CPOMSCTE104DeviceCOMHandler : public QObject
{
	Q_OBJECT
public:
CPOMSCTE104DeviceCOMHandler(CPBSSCTE104DeviceServer* pDevice);
~CPOMSCTE104DeviceCOMHandler();

private:
class CPrivateData;
std::auto_ptr<CPrivateData> m_cPrivateData;
friend class CPrivateData;
};


POMSCTE104DeviceCOMHandler.cpp

class CPOMSCTE104DeviceCOMHandler::CPrivateData
{
public:
CPrivateData(CPBSSCTE104DeviceServer* pDevice) : m_pDevice(pDevice) {}

CPBSSCTE104DeviceServer* m_pDevice;
};

//////////////////////////////////////////////////////////////////////////////////////////////////
CPOMSCTE104DeviceCOMHandler::CPOMSCTE104DeviceCOMHandler(CPBSSCTE104DeviceServer* pDevice) :
	m_cPrivateData(PBS_NEW CPrivateData(pDevice))
{
}

CPOMSCTE104DeviceCOMHandler::~CPOMSCTE104DeviceCOMHandler()
{
     m_cPrivateData->m_pDevice->destroySteam();
}
feline Posted - Jan 22 2014 : 9:46:33 PM
What do you mean by a private implementation class? Can you post a simple code sample to explain what you are seeing?

If you run Find References on the class name, does VA return any references? If VA is not aware that you are ever using the class, then it won't find any class members.

If you go to a line of code where the member variable is being used, and place the caret into the member variable and press Alt-G, what happens, if anything? In theory VA should jump to the declaration of the member variable, in the class declaration. But if this is not happening it would suggest VA is having problems understanding your code for some reason.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000