1ExtUtils::XSpp::Node::FUusnecrtiCoonn(t3r)ibuted Perl DoEcxutmUetnitlast:i:oXnSpp::Node::Function(3)
2
3
4

NAME

6       ExtUtils::XSpp::Node::Function - Node representing a function
7

DESCRIPTION

9       An ExtUtils::XSpp::Node subclass representing a single function
10       declaration such as
11
12         int foo();
13
14       More importantly, ExtUtils::XSpp::Node::Method inherits from this
15       class, so all in here equally applies to method nodes.
16

METHODS

18   new
19       Creates a new "ExtUtils::XSpp::Node::Function".
20
21       Named parameters: "cpp_name" indicating the C++ name of the function,
22       "perl_name" indicating the Perl name of the function (defaults to the
23       same as "cpp_name"), "arguments" can be a reference to an array of
24       "ExtUtils::XSpp::Node::Argument" objects and finally "ret_type"
25       indicates the (C++) return type of the function.
26
27       Additionally, there are several optional decorators for a function
28       declaration (see ExtUtils::XSpp for a list). These can be passed to the
29       constructor as "code", "cleanup", "postcall", and "catch". "catch" is
30       special in that it must be a reference to an array of class names.
31
32   resolve_typemaps
33       Fetches the ExtUtils::XSpp::Typemap object for the return type and the
34       arguments from the typemap registry and stores a reference to those
35       objects.
36
37   resolve_exceptions
38       Fetches the ExtUtils::XSpp::Exception object for the %catch directives
39       associated with this function.
40
41   add_exception_handlers
42       Adds a list of exception names to the list of exception handlers.  This
43       is mainly called by a class' "add_methods" method.  If the function is
44       hard-wired to have no exception handlers, any extra handlers from the
45       class are ignored.
46
47   print_declaration
48       Returns a string with a C++ method declaration for the node.
49
50   perl_function_name
51       Returns the name of the Perl function to generate.
52
53   is_method
54       Returns whether the object at hand is a method. Hard-wired to be false
55       for "ExtUtils::XSpp::Node::Function" object, but overridden in the
56       ExtUtils::XSpp::Node::Method sub-class.
57
58   has_argument_with_length
59       Returns true if the function has any argument that uses the XS length
60       feature.
61

ACCESSORS

63   cpp_name
64       Returns the C++ name of the function.
65
66   perl_name
67       Returns the Perl name of the function (defaults to same as C++).
68
69   set_perl_name
70       Sets the Perl name of the function.
71
72   arguments
73       Returns the internal array reference of ExtUtils::XSpp::Node::Argument
74       objects that represent the function arguments.
75
76   ret_type
77       Returns the C++ return type.
78
79   code
80       Returns the %code decorator if any.
81
82   set_code
83       Sets the implementation for the method call (equivalent to using
84       %code); takes the code as an array reference containing the lines.
85
86   cleanup
87       Returns the %cleanup decorator if any.
88
89   postcall
90       Returns the %postcall decorator if any.
91
92   catch
93       Returns the set of exception types that were associated with the
94       function via %catch. (array reference)
95
96   set_static
97       Sets the "static"-ness attribute of the function.  Can be either undef
98       (i.e. not static), "package_static", or "class_static".
99
100   package_static
101       Returns whether the function is package static.  A package static
102       function can be invoked as:
103
104           My::Package::Function( ... );
105
106   class_static
107       Returns whether the function is class static. A class static function
108       can be invoked as:
109
110           My::Package->Function( ... );
111
112
113
114perl v5.12.3                      2011-03-09 ExtUtils::XSpp::Node::Function(3)
Impressum