RE: [ROOT] CINT and STL vector of TH1F pointers

From: Philippe Canal (pcanal@fnal.gov)
Date: Mon Sep 30 2002 - 19:30:05 MEST


Hi,

You have to generate a dictionary for the class 'vector<TH1F*>'
Just doing '#include <vector>' at the CINT prompt will yield the wrong
result because the interpreted version of the vector (created by the
'#include <vector>') is different from the compiled version (uses in your
'myclass').

To create the dictionary using ACLiC just create a file with the name of
your macro minus the extension followed by '_linkdef.h':

myclass_linkdef.h:

#pragma link C++ class vector<TH1F*>;

Cheers,
Philippe

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of ZK
Sent: Sunday, September 29, 2002 11:19 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] CINT and STL vector of TH1F pointers


I have a class (compiled by ACLIC) with "vector<TH1F*>" as a member. I
cannot access the content of that member interactively in CINT:

root [4] myclass.histVector
(vector<TH1F*>)143707040
root [5] #include <vector>
root [6] vector<TH1F*> h = (vector<TH1F*>) myclass.histVector
root [7] h
(vector<TH1F*>)143707060
root [8] h[0]
Error: Can't call vector<TH1F*,__malloc_alloc_template<0>
>::operator[]((int)0) in current scope FILE:/tmp/fileJNLAeM_cint LINE:1
Possible candidates are...
filename       line:size busy function type and name  (in
vector<TH1F*,__malloc_alloc_template<0> >)
*** Interpreter error recovered ***

Is a limitation of CINT or I am doing something wrong here? If it is a CINT
limitation, what are the alternatives? (except for an array of pointers to
TH1F)

Thank you



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:12 MET