Re: [ROOT] STL strings at the CINT / Compiled code boundary

From: Radovan CHYTRACEK (Radovan.Chytracek@cern.ch)
Date: Thu Aug 02 2001 - 11:46:46 MEST


Robert Hatcher wrote:
> 
> My system:  ROOT 3.01/06+ (CVS as of Jul 27), Linux RH6.2
>   (attempted with different machines having egcs and gcc2.95)
> 
> I have some compiled classes that use STL strings as args and return
> values.  I'd like to interact with these from within a CINT macro.
> But neither of these seems to work.  In passing a CINT string
> to a compiled routine it complains about a signature mismatch.
> In the reverse it tends to fill the CINT string with garbage
> that generally leads to unhappiness (SEGV or random characters
> that change the terminal's character set).
> 
> ... snipped

I think problem is due to CINT's own version of STL containers.
In order to succefully pass a data between CINT and compiled code you can
try the

const char*
const char*& or const char**

depending on what you want to do. Inside the functions I expect one must
be able to initialize STL strings with these char pointers.

I remember from Gaudi-ROOT excercises that the pointer reference ( e.g.
const void*& ) had some problem in CINT but I think it has been fixed
since the time.

Good luck

Radovan




This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:54 MET