Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

wx::xsp::xspp(3) [osx man page]

build::Wx::XSP::XSpp(3) 				User Contributed Perl Documentation				   build::Wx::XSP::XSpp(3)

NAME
XSpp - XS for C++ SYNOPSIS
In Foo.xs (all in one line): INCLUDE: perl -S wxperl_xspp --typemap=typemap.xsp Foo.xsp | OVERVIEW
XS++ is just a thin layer over plain XS, hence to use it you are supposed to know, at the very least, C++ and XS. This means that you will need typemaps for both xsubpp and xsubppp. TYPEMAPS
There is nothing special about typemap files (i.e. you can put typemaps directly in your .xsp file), but it is handy to have common typemaps in a separate file, to avoid duplication. %typemap{<C++ type>}{simple}; Just let XS++ that this is a valid type, the type will be passed unchanged to XS code except that any "const" qualifiers will be stripped. %typemap{<C++ type 1>}{parsed}{%<C++ type 2>%}; When "C++ type 1" is used, replace it with "C++ type 2" in the generated XS code. %typemap{<C++ reference type>}{reference}; Handle C++ references: the XS variable will be declared as a pointer, and it will be explicitly dereferenced in the function call. If it is used in the return value, the function will create copy of the returned value using a copy constructor. DESCRIPTION
Anything that does not look like a XS++ directive or a class declaration is passed verbatim to XS. If you want XS++ to ignore code that looks like a XS++ directive or class declaration, simply surround it with a raw block delimiter like this: %{ XS++ won't interpret this %} %code See under Classes. %file %file{file/path.h}; ... %file{file/path2}; ... %file{-} By default XS++ output goes to standard output; to change this, use the %file directive; use "-" for standard output. %module %module{Module__Name}; Will be used to generate the "MODULE=Module__Name" XS directives. %name %name{Perl::Class} class MyClass { ... }; %name{Perl::Func} int foo(); Specifies the perl name under which the C++ class/function will be accessible. %typemap See TYPEMAPS above. Classes %name{My::Class} class MyClass { // can be called in Perl as My::Class->new( ... ); MyClass( int arg ); // My::Class->newMyClass( ... ); %name{newMyClass} MyClass( const char* str, int arg ); // standard DESTROY method ~MyClass(); int GetInt(); void SetValue( int arg = -1 ); %name{SetString} void SetValue( const char* string = NULL ); // Supply a C<CODE:> or C<CLEANUP:> block for the XS int MyMethod( int a, int b ) %code{% RETVAL = a + b; %} %cleanup{% /* do something */ %}; }; perl v5.10.0 2008-01-21 build::Wx::XSP::XSpp(3)

Check Out this Related Man Page

ExtUtils::XSpp::Node::Class(3pm)			User Contributed Perl Documentation			  ExtUtils::XSpp::Node::Class(3pm)

NAME
ExtUtils::XSpp::Node::Class - A class (inherits from Package). DESCRIPTION
An ExtUtils::XSpp::Node::Package sub-class representing a class declaration such as %name{PerlClassName} class MyClass : public BaseClass { ... } The Perl-level class name and the C++ class name attributes are inherited from the ExtUtils::XSpp::Node::Package class. METHODS
new Creates a new "ExtUtils::XSpp::Node::Class" object. Optional named parameters: "methods" can be a reference to an array of methods (ExtUtils::XSpp::Node::Method) of the class, and "base_classes", a reference to an array of base classes ("ExtUtils::XSpp::Node::Class" objects). "catch" may be a list of exception names that all methods in the class handle. add_methods Adds new methods to the class. By default, their scope is "public". Takes arbitrary number of arguments which are processed in order. If an argument is an ExtUtils::XSpp::Node::Access, the current method scope is changed accordingly for all following methods. If an argument is an ExtUtils::XSpp::Node::Method it is added to the list of methods of the class. The method's class name is set to the current class and its scope is set to the current method scope. ACCESSORS
methods Returns the internal reference to the array of methods in this class. Each of the methods is an "ExtUtils::XSpp::Node::Method" base_classes Returns the internal reference to the array of base classes of this class. If the base classes have been defined in the same file, these are the complete class objects including method definitions, otherwise only the C++ and Perl name of the class are available as attributes. perl v5.14.2 2011-12-20 ExtUtils::XSpp::Node::Class(3pm)
Man Page