SOOT::API - Perl interface to Perl-ROOT wrapper internals
use SOOT::API qw(type cproto); my $cproto = cproto("blah"); print "$cproto\n"; # prints 'char*'
This package exposes some of the internals of the Perl-ROOT wrapper to Perl. All functions are to be considered experimental, mostly for internal use only, and certainly subject to change. If you need a stable API, contact the author(s).
None by default.
You may chose to import individual functions (see below) or all exported functions. You can import all functions with
use SOOT::API ':all';
Tries to guess the SOOT type of its argument and returns a string such as "INTEGER".
"INTEGER"
Tries to guess the SOOT type of its argument and returns a string such as "int" or "TGraph".
"int"
"TGraph"
Manually marks a given Perl object as not responsible for freeing the underlying ROOT object. If this is necessary, that's a bug in SOOT. This is a natural cause of memory leaks...
Prints the full state of the SOOT-internal garbage collection pointer table.
Returns true of the given two Perl objects point to the same underlying TObject. Note that this function may produce segmentation faults if you pass in non-TObjects. Instead, you can use the overloaded nature of TObject wrappers and compare to objects with
$obj1 == $obj2
for the same effect, but without the fragility.
Returns a boolean indicating whether the given class has been initialized as a SOOT class. If not, you can do so manually with
SOOT->Load($className)
SOOT::API::ClassIterator is a very simple iterator class that lets you iterate over all wrapped ROOT class names:
SOOT::API::ClassIterator
my $iter = SOOT::API::ClassIterator->new; while (defined(my $class = $iter->next)) { # use $class }
SOOT::Struct provides an interface to defining and accessing C-structs from Perl. Example:
my $struct = SOOT::Struct->new( name => 'person_t', fields => { 'name' => 'Char_t[20]', 'age' => 'UInt_t', }, ); $struct->compile; my $person = person_t->new; $person->name("Steffen"); # stores in struct via SOOT print $person->name(), "\n"; # fetches via SOOT
SOOT
http://root.cern.ch
Steffen Mueller, <smueller@cpan.org>
Copyright (C) 2010 by Steffen Mueller
SOOT, the Perl-ROOT wrapper, is free software; you can redistribute it and/or modify it under the same terms as ROOT itself, that is, the GNU Lesser General Public License. A copy of the full license text is available from the distribution as the LICENSE file.
To install SOOT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SOOT
CPAN shell
perl -MCPAN -e shell install SOOT
For more information on module installation, please visit the detailed CPAN module installation guide.