=head1 NAME

XS::Framework::Manual::SVAPI - XS::Framework C++ typemap API reference


The SVAPI is I<C++ perl API> makes it convenient to write C++ XS-code. Out of
the box Perl offers only C API for Perl interpreter, SVAPI tries to fill that

We assume that all SVAPI belongs to C<xs> namespace so we omit C<xs::> name
resolution, i.e.

    using namespace xs;

=head2 CLASS HIERARCHY & Overview

=begin HTML

  <img src="uml.png" style="max-width:100%;">

=end HTML

The type hierarhcy reflects C-type hirerachy defined by Perl. The most generic
class is L<XS::Framework::Manual::SVAPI::Sv>, which owns underlying Perl C<SV*>.
The direct descedant classes are L<XS::Framework::Manual::SVAPI::Sub> (callable
Perl subroutine), L<XS::Framework::Manual::SVAPI::Array>,
L<XS::Framework::Manual::SVAPI::Hash>, L<XS::Framework::Manual::SVAPI::Object>
and L<XS::Framework::Manual::SVAPI::Scalar>. The L<XS::Framework::Manual::SVAPI::List>
is defined as descendant of L<XS::Framework::Manual::SVAPI::Array>; the
L<XS::Framework::Manual::SVAPI::Stash> (Perl package names resolver, symbol table)
is L<XS::Framework::Manual::SVAPI::Hash>'s child.

The L<XS::Framework::Manual::SVAPI::Scalar> is artificial type defined by
L<XS::Framework>, which represents a value which can be placed in scalar
context, as opposite to all other types above.

The L<XS::Framework::Manual::SVAPI::Ref> is child class of C<Scalar>, which is
able to point to any other Perl value (array, hash, object, glob, simple scalar
or other reference).

The L<XS::Framework::Manual::SVAPI::Simple> object is intendent to present
Perl primitive values, i.e. string or numbers.

L<XS::Framework::Manual::SVAPI::Glob> object holds a GLOB containing a scalar, an array, a hash etc. and usually can be found in C<Stash>'es.

L<XS::Framework::Manual::SVAPI::Io> object holds IO.

L<XS::Framework::Manual::SVAPI::Scope> contains scope utils.

The rule of thumb for wrappers creation (i.e. constructor, assignment): if
the incorrect underlying C<SV*> is supplied (e.g. C<SV*> holding a number
is supplied for C<Object>), then exception is thrown. If C<NULL> / C<nullptr>
is provided, then a wrapper will be empty (no exception is thrown); if an
C<SV*> with C<undef> a wrapper also will be empty, unless C<undef> is acceptable
value (e.g. for C<Scalar>).

C<create> vs constructor difference: the C<create> methods for appropriate
type create underlying C<SV*> in I<Perl itself> and return wrapper for it. The
constructors just create an wrapper around already exsisting Perl <SV*>.

See also















The L<XS::Framework> supports L<threaded perl | XS::Framework::Manual::SVAPI::threads>.

It is possible to use custom C++ L<XS::Framework::Manual::SVAPI::exceptions>
as well as custom exception handler to pass them through into the Perl.

If you need custom C++ hook on Perl destruction, please refer