RE: [ROOT] CINT and namespaces

From: Philippe Canal (pcanal@fnal.gov)
Date: Thu Apr 24 2003 - 17:19:57 MEST


Hi Stefano,

> Does CINT has to be made aware of foo_nspace ? How ? Can I avoid building
the
> dictionary for foo_nspace ?

There are several ways you could.  However the simpliest way is to indeed
generate a dictionary for the namespace foo_nspace but not for its content.
This would let root/cint know that this is indeed a bona-fide namespace.
The cost of generating the dictionary entry just for the namespace is very
small.  To do so just add:

	#pragma link C++ namespace foo_nspace;

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Stefano Argiro'
Sent: Thursday, April 24, 2003 5:05 AM
To: roottalk@pcroot.cern.ch
Cc: auger-offline-devel@auger.unam.mx
Subject: [ROOT] CINT and namespaces


Hi,

I am having troubles getting the following scheme to work.

In the Auger framework which is being developed, we would like
to have separate namespaces for classes which interact with the
ROOT system and for classes that don't.

Example: namespace foo_nspace does not know about ROOT, while io_nspace
is made of TObject-derived classes which have a dictionary.

namespace foo_nspace{

class Bar{

  ...

};

}

namespace io_nspace {

class TEvent: public TObject{

  ...

  public:
    Somefunction( foo_nspace::Bar * foobar);

  ClassDef(TEvent,1)

};

}

The dictionary is built for classes of namespace io_nspace and not for
classes
of foo_nspace. As you see, class TEvent refers to
a class of foo_nspace in a function argument, but never as a data member.

The thing compiles, but when I try to stream an object of class TEvent
I get:

Error: class,struct,union or type  foo_nspace  not defined FILE: LINE:0

and SIGSEGV.


Does CINT has to be made aware of foo_nspace ? How ? Can I avoid building
the
dictionary for foo_nspace ?

Many thanks
	Stefano



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET