Tips for using template C++ classes and Cocoa
Tips for using template C++ classes and Cocoa
- Subject: Tips for using template C++ classes and Cocoa
- From: "Jan Hendrik Kruger" <email@hidden>
- Date: Tue, 02 Jul 2002 09:36:42 +0200
Hi there,
I am a relative newbie to Cocoa from C++. I am developing a utility app
to 1) teach me Cocoa, and 2) investigate the use of platform-independent
C++ classes in Cocoa. The app follows the MVC paradigm, with the view
and controller classes programmed in PB with Cocoa, and the model class
is a template C++ class. The template class has already been intensively
debugged in MS Visual Studio. I am using the Dec 2001 devtools distro.
At this stage, including the template class (with only a single
instantiation) in the controller class, compiles with Obj-C++; only
selected member functions are usable along with their relevant data
storage. (So I guess this implies that the object at least gets
instantiated somewhere?)
The problem:
Trying to use some heavy weight functions results in a EXC_BAD_ACCESS
fault. (Memory access?). Using the frame# I can track in which function
the fault occurs...but, it is a C++ member function; and all breakpoints
I set in the C++ source are ignored (even those in the correctly working
functions.
The function in question is of the form
static inline T myFunc(T arg1, T arg2);
...
template<class T>
T myClass::myFunc(T arg1, T arg2){}
The member functions that work only have int arguments; apparently the
T argument is part of the problem.
The question:
I have tried the #pragma interface and #pragma implementation
workarounds recommended for multiple template instantiations, but the
same fault persists in the same function.
What is the correct syntax/location/file extensions for template
instantiation (as Obj-C member variables?) and why can't I access my
breakpoints in the C++ file?
Thanks for helping!
Jan-Hendrik
-------------------------------------------------------------------------------------
Jan-Hendrik Kruger M.Ing(Meg)
Skool vir Meganiese en Materiaal Ingenieurswese
PU vir CHO
(018) 299 4026
email@hidden
-------------------------------------------------------------------------------------
Hierdie boodskap (en aanhangsels) is onderhewig aan beperkings en 'n
vrywaringsklousule. Volledige besonderhede beskikbaar by
http://www.puk.ac.za/itb/e-pos/disclaimer.html , of by
email@hidden
This message (and attachments) is subject to restrictions and a
disclaimer. Please refer to
http://www.puk.ac.za/itb/e-pos/disclaimer.html for full details, or at
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.