logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

ExtUtils::Typemaps::ObjectMap - A set of typemaps for opaque C/C++ objects

Author

       The module was written by Steffen Mueller <smueller@cpan.org>, but the important bit, the typemap, was
       written by Dean Roehrich.

Description

       "ExtUtils::Typemaps::ObjectMap" is an "ExtUtils::Typemaps" subclass that provides a set of mappings for
       using pointers to C/C++ objects as opaque objects from Perl.

       These mappings are taken verbatim from Dean Roehrich's "perlobject.map".  They are:

         # "perlobject.map"  Dean Roehrich, version 19960302
         #
         # TYPEMAPs
         #
         # HV *                -> unblessed Perl HV object.
         # AV *                -> unblessed Perl AV object.
         #
         # INPUT/OUTPUT maps
         #
         # O_*         -> opaque blessed objects
         # T_*         -> opaque blessed or unblessed objects
         #
         # O_OBJECT    -> link an opaque C or C++ object to a blessed Perl object.
         # T_OBJECT    -> link an opaque C or C++ object to an unblessed Perl object.
         # O_HvRV      -> a blessed Perl HV object.
         # T_HvRV      -> an unblessed Perl HV object.
         # O_AvRV      -> a blessed Perl AV object.
         # T_AvRV      -> an unblessed Perl AV object.

Methods

       These are the overridden methods:

   new
       Creates a new "ExtUtils::Typemaps::ObjectMap" object.  It acts as any other "ExtUtils::Typemaps" object,
       except that it has the object maps initialized.

Name

       ExtUtils::Typemaps::ObjectMap - A set of typemaps for opaque C/C++ objects

See Also

       ExtUtils::Typemaps, ExtUtils::Typemaps::Default, ExtUtils::Typemaps::STL::String

Synopsis

         use ExtUtils::Typemaps::ObjectMap;
         # First, read my own type maps:
         my $private_map = ExtUtils::Typemaps->new(file => 'my.map');

         # Then, get the object map set and merge it into my maps
         $private_map->merge(typemap => ExtUtils::Typemaps::ObjectMap->new);

         # Now, write the combined map to an output file
         $private_map->write(file => 'typemap');

See Also