I'm not a C++ expert but looks like the tStatus C++ class needs its own wrapper in
Eiffel and when the signature of a C++ expects the tStatus & it means passing the
pointer to the memory area allocated for an instance of the tStatus class.
So in Eiffel, you will need to have a class which has `item: POINTER' available.
This is `item' that you will pass to your C++ code `cpp_create' or `c_get_nxt'.
For `cpp_create', I believe you could simplify it to be just:
cpp_create (bt: BOOLEAN; a_timeout: INTEGER; a_status: POINTER): POINTER
-- Call the C external to create an iNXTIterator
-- "The NXT iterator can be used to find all NXTs that are
connected (USB)
-- or in range (Bluetooth). The NXT iterator is not created if the
specified
-- status is fatal. The returned NXT iterator object should be
destroyed using
-- the iNXT::destroyNXTIterator method."
external
"C++ inline use %"iNXT.h%""
alias
"[
nFANTOM100::iNXTIterator* it;
it = nFANTOM100::iNXT::createNXTIterator (
(ViBoolean) $bt,
(ViUInt32) $a_timeout,
(nFANTOM100::tStatus &) $a_status);
if (((nFANTOM100::tStatus &) $a_status).isNotFatal()) {
return (EIF_POINTER) it;
} else {
return (EIF_POINTER) 0;
}
]"
end
The code you had for `c_get_nxt' seem just fine.
Regards,
Manu
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/eiffel_software/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/eiffel_software/join
(Yahoo! ID required)
<*> To change settings via email:
eiffel_soft...@yahoogroups.com
eiffel_softwar...@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
eiffel_softwa...@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/