File: Module.pm

package info (click to toggle)
libextutils-xspp-perl 0.1800-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 996 kB
  • ctags: 1,861
  • sloc: perl: 8,324; cpp: 125; makefile: 2
file content (59 lines) | stat: -rw-r--r-- 1,064 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package ExtUtils::XSpp::Node::Module;
use strict;
use warnings;
use base 'ExtUtils::XSpp::Node';

=head1 NAME

ExtUtils::XSpp::Node::Module - Node representing an XS++/XS MODULE declaration

=head1 DESCRIPTION

An L<ExtUtils::XSpp::Node> subclass representing a module declaration.
For example, this XS++

  %module{Some::Perl::Namespace}

would turn into this XS:

MODULE=Some::Perl::Namespace

See also: L<ExtUtils::XSpp::Node::Package>.

In a nutshell, the module that your XS++/XS code belongs to is
the main Perl package of your wrapper. A single module can (and usually does)
have several packages (respectively C++ classes).

=head1 METHODS

=head2 new

Creates a new C<ExtUtils::XSpp::Node::Module>.

Named parameters: C<module> indicating the name
of the module.

=cut

sub init {
  my $this = shift;
  my %args = @_;

  $this->{MODULE} = $args{module};
}

sub to_string { 'MODULE=' . $_[0]->module }

sub print { return $_[0]->to_string . "\n" }

=head1 ACCESSORS

=head2 module

Returns the name of the module.

=cut

sub module { $_[0]->{MODULE} }

1;