Hi Arsen,
that's a very good question - I doubt we have ever specified this completely :-) I'll give it a try.
A ROOT macro is a C++ source file that could usually (i.e. without CINT) be compiled and put into a library. This also means it should _not_ contain a function named main. Its file name should end on ".C", ".cxx", ".cpp", or ".cc" and have no spaces.
A ROOT macro used with CINT, i.e. not with ACLiC (".L MyMacro.C+"), can make
use of a few extra features:
* it does not need to specify #includes for classes with a dictionary (e.g. all
of ROOT's classes)
* it does not need the libraries it uses to be loaded before the first use, as
long as the library containing the class has a rootmap file,
* it can be written as an unnamed macro (though I would discourage anyone from
doing so), where the file starts with a "{" and ends with a "}" with no
function definitions in between,
* it can use an extended version of C++, e.g. 12**2 to calculate the power of a
number, . instead of -> for pointer access.
The whole idea of CINT is to ease the use of C++ and to make it trivial to convert scripted files to compiled ones. You can see that these two motivations collide when talking about things like "." vs. "->": it's just invalid C++ and no compiler will ever accept it. So my recommendation is to _not_ make use of the CINT extensions.
Let me know if you need more details.
Cheers, Axel.
On 2008-10-16 13:27, Arsen Hayrapetyan wrote:
> Hello,
>
> Can anybody give the exact definition of what is the "ROOT macro"?
>
> For example, the definition of the class Quad in
> $ROOTSYS/quadp/Quad.cxx, is it also called macro in ROOT?
>
> And what is the difference between macro and C++ program from the point
> of view of ROOT?
>
> Thanks in advance,
> Arsen.
>
>
Received on Mon Oct 20 2008 - 10:10:49 CEST
This archive was generated by hypermail 2.2.0 : Mon Oct 20 2008 - 17:50:02 CEST