| Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Moose/Meta/Method/Constructor.pm |
| Statements | Executed 25 statements in 307µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 8µs | 35µs | Moose::Meta::Method::Constructor::BEGIN@14 |
| 1 | 1 | 1 | 8µs | 8µs | Moose::Meta::Method::Constructor::BEGIN@3 |
| 1 | 1 | 1 | 8µs | 39µs | Moose::Meta::Method::Constructor::BEGIN@16 |
| 1 | 1 | 1 | 7µs | 16µs | Moose::Meta::Method::Constructor::BEGIN@11 |
| 1 | 1 | 1 | 7µs | 9µs | Moose::Meta::Method::Constructor::BEGIN@10 |
| 1 | 1 | 1 | 6µs | 40µs | Moose::Meta::Method::Constructor::BEGIN@15 |
| 1 | 1 | 1 | 6µs | 109µs | Moose::Meta::Method::Constructor::BEGIN@18 |
| 1 | 1 | 1 | 3µs | 3µs | Moose::Meta::Method::Constructor::BEGIN@13 |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Constructor::_initialize_body |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Constructor::new |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | package Moose::Meta::Method::Constructor; | ||||
| 3 | # spent 8µs within Moose::Meta::Method::Constructor::BEGIN@3 which was called:
# once (8µs+0s) by Moose::Meta::Class::BEGIN@25 at line 5 | ||||
| 4 | 1 | 4µs | $Moose::Meta::Method::Constructor::AUTHORITY = 'cpan:STEVAN'; | ||
| 5 | 1 | 22µs | 1 | 8µs | } # spent 8µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@3 |
| 6 | { | ||||
| 7 | 2 | 1µs | $Moose::Meta::Method::Constructor::VERSION = '2.0602'; | ||
| 8 | } | ||||
| 9 | |||||
| 10 | 3 | 20µs | 2 | 11µs | # spent 9µs (7+2) within Moose::Meta::Method::Constructor::BEGIN@10 which was called:
# once (7µs+2µs) by Moose::Meta::Class::BEGIN@25 at line 10 # spent 9µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@10
# spent 2µs making 1 call to strict::import |
| 11 | 3 | 16µs | 2 | 24µs | # spent 16µs (7+8) within Moose::Meta::Method::Constructor::BEGIN@11 which was called:
# once (7µs+8µs) by Moose::Meta::Class::BEGIN@25 at line 11 # spent 16µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@11
# spent 8µs making 1 call to warnings::import |
| 12 | |||||
| 13 | 3 | 20µs | 1 | 3µs | # spent 3µs within Moose::Meta::Method::Constructor::BEGIN@13 which was called:
# once (3µs+0s) by Moose::Meta::Class::BEGIN@25 at line 13 # spent 3µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@13 |
| 14 | 3 | 25µs | 2 | 62µs | # spent 35µs (8+27) within Moose::Meta::Method::Constructor::BEGIN@14 which was called:
# once (8µs+27µs) by Moose::Meta::Class::BEGIN@25 at line 14 # spent 35µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@14
# spent 27µs making 1 call to Exporter::import |
| 15 | 3 | 17µs | 2 | 74µs | # spent 40µs (6+34) within Moose::Meta::Method::Constructor::BEGIN@15 which was called:
# once (6µs+34µs) by Moose::Meta::Class::BEGIN@25 at line 15 # spent 40µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@15
# spent 34µs making 1 call to Exporter::import |
| 16 | 3 | 20µs | 2 | 70µs | # spent 39µs (8+31) within Moose::Meta::Method::Constructor::BEGIN@16 which was called:
# once (8µs+31µs) by Moose::Meta::Class::BEGIN@25 at line 16 # spent 39µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@16
# spent 31µs making 1 call to Exporter::import |
| 17 | |||||
| 18 | 1 | 4µs | 1 | 103µs | # spent 109µs (6+103) within Moose::Meta::Method::Constructor::BEGIN@18 which was called:
# once (6µs+103µs) by Moose::Meta::Class::BEGIN@25 at line 19 # spent 103µs making 1 call to base::import |
| 19 | 2 | 156µs | 1 | 109µs | 'Class::MOP::Method::Constructor'; # spent 109µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@18 |
| 20 | |||||
| 21 | sub new { | ||||
| 22 | my $class = shift; | ||||
| 23 | my %options = @_; | ||||
| 24 | |||||
| 25 | my $meta = $options{metaclass}; | ||||
| 26 | |||||
| 27 | (ref $options{options} eq 'HASH') | ||||
| 28 | || $class->throw_error("You must pass a hash of options", data => $options{options}); | ||||
| 29 | |||||
| 30 | ($options{package_name} && $options{name}) | ||||
| 31 | || $class->throw_error("You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT"); | ||||
| 32 | |||||
| 33 | my $self = bless { | ||||
| 34 | 'body' => undef, | ||||
| 35 | 'package_name' => $options{package_name}, | ||||
| 36 | 'name' => $options{name}, | ||||
| 37 | 'options' => $options{options}, | ||||
| 38 | 'associated_metaclass' => $meta, | ||||
| 39 | 'definition_context' => $options{definition_context}, | ||||
| 40 | '_expected_method_class' => $options{_expected_method_class} || 'Moose::Object', | ||||
| 41 | } => $class; | ||||
| 42 | |||||
| 43 | # we don't want this creating | ||||
| 44 | # a cycle in the code, if not | ||||
| 45 | # needed | ||||
| 46 | weaken($self->{'associated_metaclass'}); | ||||
| 47 | |||||
| 48 | $self->_initialize_body; | ||||
| 49 | |||||
| 50 | return $self; | ||||
| 51 | } | ||||
| 52 | |||||
| 53 | ## method | ||||
| 54 | |||||
| 55 | sub _initialize_body { | ||||
| 56 | my $self = shift; | ||||
| 57 | $self->{'body'} = $self->_generate_constructor_method_inline; | ||||
| 58 | } | ||||
| 59 | |||||
| 60 | 1 | 2µs | 1; | ||
| 61 | |||||
| 62 | # ABSTRACT: Method Meta Object for constructors | ||||
| 63 | |||||
| - - | |||||
| 66 | =pod | ||||
| 67 | |||||
| 68 | =head1 NAME | ||||
| 69 | |||||
| 70 | Moose::Meta::Method::Constructor - Method Meta Object for constructors | ||||
| 71 | |||||
| 72 | =head1 VERSION | ||||
| 73 | |||||
| 74 | version 2.0602 | ||||
| 75 | |||||
| 76 | =head1 DESCRIPTION | ||||
| 77 | |||||
| 78 | This class is a subclass of L<Class::MOP::Method::Constructor> that | ||||
| 79 | provides additional Moose-specific functionality | ||||
| 80 | |||||
| 81 | To understand this class, you should read the the | ||||
| 82 | L<Class::MOP::Method::Constructor> documentation as well. | ||||
| 83 | |||||
| 84 | =head1 INHERITANCE | ||||
| 85 | |||||
| 86 | C<Moose::Meta::Method::Constructor> is a subclass of | ||||
| 87 | L<Moose::Meta::Method> I<and> L<Class::MOP::Method::Constructor>. | ||||
| 88 | |||||
| 89 | =head1 BUGS | ||||
| 90 | |||||
| 91 | See L<Moose/BUGS> for details on reporting bugs. | ||||
| 92 | |||||
| 93 | =head1 AUTHOR | ||||
| 94 | |||||
| 95 | Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details. | ||||
| 96 | |||||
| 97 | =head1 COPYRIGHT AND LICENSE | ||||
| 98 | |||||
| 99 | This software is copyright (c) 2012 by Infinity Interactive, Inc.. | ||||
| 100 | |||||
| 101 | This is free software; you can redistribute it and/or modify it under | ||||
| 102 | the same terms as the Perl 5 programming language system itself. | ||||
| 103 | |||||
| 104 | =cut | ||||
| 105 | |||||
| 106 | |||||
| 107 | __END__ |