Re: std::map and root

From: Sebastien Binet <binet_at_cern.ch>
Date: Sun, 13 Nov 2011 12:38:49 +0100


Marc,

On Sun, Nov 13, 2011 at 12:01 PM, Marc Escalier <escalier_at_lal.in2p3.fr> wrote:
> also "first" and "second" seem not to work :
>
> indeed :
>
> root [5] hiter(const class map<string,TH1*,less<string>,allocator<pair<const
> string,TH1*> > >::const_iterator)538905152
>
> -->proof that hiter was defined

hiter was actually defined on-the-fly, but doesn't carry all the needed information.

IIRC, we usually disable this feature in Athena (so we have "hard crashes" earlier on)

you need to create a dictionary (CINT or Reflex) for the map<K,V>::const_iterator class and for the comparator function.

in Atlas, we have this helper template metafunction to define the comparison operators:
http://alxr.usatlas.bnl.gov/lxr/source/atlas/Control/RootUtils/RootUtils/PyROOTIteratorFuncs.h#042

used like this:
http://alxr.usatlas.bnl.gov/lxr/source/atlas/Database/AthenaPOOL/DBDataModel/DBDataModel/DBDataModelDict.h#012 http://alxr.usatlas.bnl.gov/lxr/source/atlas/Database/AthenaPOOL/DBDataModel/DBDataModel/selection.xml#010

(so, for Reflex, as that's what ATLAS and CMS rely on instead of CINT...)

-s Received on Sun Nov 13 2011 - 12:38:57 CET

This archive was generated by hypermail 2.2.0 : Sun Nov 13 2011 - 17:50:01 CET