.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "ExtUtils::XSpp::Node::Function 3pm" .TH ExtUtils::XSpp::Node::Function 3pm "2015-05-31" "perl v5.20.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" ExtUtils::XSpp::Node::Function \- Node representing a function .SH "DESCRIPTION" .IX Header "DESCRIPTION" An ExtUtils::XSpp::Node subclass representing a single function declaration such as .PP .Vb 1 \& int foo(); .Ve .PP More importantly, ExtUtils::XSpp::Node::Method inherits from this class, so all in here equally applies to method nodes. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" Creates a new \f(CW\*(C`ExtUtils::XSpp::Node::Function\*(C'\fR. .PP Named parameters: \f(CW\*(C`cpp_name\*(C'\fR indicating the \*(C+ name of the function, \&\f(CW\*(C`perl_name\*(C'\fR indicating the Perl name of the function (defaults to the same as \f(CW\*(C`cpp_name\*(C'\fR), \f(CW\*(C`arguments\*(C'\fR can be a reference to an array of \f(CW\*(C`ExtUtils::XSpp::Node::Argument\*(C'\fR objects and finally \&\f(CW\*(C`ret_type\*(C'\fR indicates the (\*(C+) return type of the function. .PP Additionally, there are several optional decorators for a function declaration (see ExtUtils::XSpp for a list). These can be passed to the constructor as \f(CW\*(C`code\*(C'\fR, \f(CW\*(C`cleanup\*(C'\fR, \f(CW\*(C`postcall\*(C'\fR, and \f(CW\*(C`catch\*(C'\fR. \f(CW\*(C`catch\*(C'\fR is special in that it must be a reference to an array of class names. .SS "resolve_typemaps" .IX Subsection "resolve_typemaps" Fetches the ExtUtils::XSpp::Typemap object for the return type and the arguments from the typemap registry and stores a reference to those objects. .SS "resolve_exceptions" .IX Subsection "resolve_exceptions" Fetches the ExtUtils::XSpp::Exception object for the \f(CW%catch\fR directives associated with this function. .SS "add_exception_handlers" .IX Subsection "add_exception_handlers" Adds a list of exception names to the list of exception handlers. This is mainly called by a class' \f(CW\*(C`add_methods\*(C'\fR method. If the function is hard-wired to have no exception handlers, any extra handlers from the class are ignored. .SS "print_declaration" .IX Subsection "print_declaration" Returns a string with a \*(C+ method declaration for the node. .SS "perl_function_name" .IX Subsection "perl_function_name" Returns the name of the Perl function to generate. .SS "is_method" .IX Subsection "is_method" Returns whether the object at hand is a method. Hard-wired to be false for \f(CW\*(C`ExtUtils::XSpp::Node::Function\*(C'\fR object, but overridden in the ExtUtils::XSpp::Node::Method sub-class. .SS "has_argument_with_length" .IX Subsection "has_argument_with_length" Returns true if the function has any argument that uses the \s-1XS\s0 length feature. .SH "ACCESSORS" .IX Header "ACCESSORS" .SS "cpp_name" .IX Subsection "cpp_name" Returns the \*(C+ name of the function. .SS "perl_name" .IX Subsection "perl_name" Returns the Perl name of the function (defaults to same as \*(C+). .SS "set_perl_name" .IX Subsection "set_perl_name" Sets the Perl name of the function. .SS "arguments" .IX Subsection "arguments" Returns the internal array reference of ExtUtils::XSpp::Node::Argument objects that represent the function arguments. .SS "ret_type" .IX Subsection "ret_type" Returns the \*(C+ return type. .SS "code" .IX Subsection "code" Returns the \f(CW%code\fR decorator if any. .SS "set_code" .IX Subsection "set_code" Sets the implementation for the method call (equivalent to using \&\f(CW%code\fR); takes the code as an array reference containing the lines. .SS "cleanup" .IX Subsection "cleanup" Returns the \f(CW%cleanup\fR decorator if any. .SS "postcall" .IX Subsection "postcall" Returns the \f(CW%postcall\fR decorator if any. .SS "catch" .IX Subsection "catch" Returns the set of exception types that were associated with the function via \f(CW%catch\fR. (array reference) .SS "aliases" .IX Subsection "aliases" Returns a hashref of \f(CW\*(C`name => position\*(C'\fR function name aliases (see \f(CW%alias\fR and perlxs \s-1ALIAS\s0 keyword). Does not include the main function name. .SS "set_static" .IX Subsection "set_static" Sets the \f(CW\*(C`static\*(C'\fR\-ness attribute of the function. Can be either undef (i.e. not static), \f(CW"package_static"\fR, or \f(CW"class_static"\fR. .SS "package_static" .IX Subsection "package_static" Returns whether the function is package static. A package static function can be invoked as: .PP .Vb 1 \& My::Package::Function( ... ); .Ve .SS "class_static" .IX Subsection "class_static" Returns whether the function is class static. A class static function can be invoked as: .PP .Vb 1 \& My::Package\->Function( ... ); .Ve .SS "ret_typemap" .IX Subsection "ret_typemap" Returns the typemap for the return value of the function. .SS "set_ret_typemap( typemap )" .IX Subsection "set_ret_typemap( typemap )" Sets the typemap for the return value of the function. .SS "arg_typemap( index )" .IX Subsection "arg_typemap( index )" Returns the typemap for one function arguments. .SS "set_arg_typemap( index, typemap )" .IX Subsection "set_arg_typemap( index, typemap )" Sets the typemap for one function argument.