← Index
NYTProf Performance Profile   « line view »
For /usr/local/libexec/sympa/task_manager-debug.pl
  Run on Tue Jun 1 22:32:51 2021
Reported on Tue Jun 1 22:35:05 2021

Filename/usr/local/lib/perl5/site_perl/Specio/Constraint/Parameterized.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sSpecio::Constraint::Parameterized::::BEGIN@10Specio::Constraint::Parameterized::BEGIN@10
0000s0sSpecio::Constraint::Parameterized::::BEGIN@12Specio::Constraint::Parameterized::BEGIN@12
0000s0sSpecio::Constraint::Parameterized::::BEGIN@3Specio::Constraint::Parameterized::BEGIN@3
0000s0sSpecio::Constraint::Parameterized::::BEGIN@4Specio::Constraint::Parameterized::BEGIN@4
0000s0sSpecio::Constraint::Parameterized::::BEGIN@8Specio::Constraint::Parameterized::BEGIN@8
0000s0sSpecio::Constraint::Parameterized::::BEGIN@9Specio::Constraint::Parameterized::BEGIN@9
0000s0sSpecio::Constraint::Parameterized::::__ANON__Specio::Constraint::Parameterized::__ANON__ (xsub)
0000s0sSpecio::Constraint::Parameterized::::_attrsSpecio::Constraint::Parameterized::_attrs
0000s0sSpecio::Constraint::Parameterized::::_build_nameSpecio::Constraint::Parameterized::_build_name
0000s0sSpecio::Constraint::Parameterized::::_has_nameSpecio::Constraint::Parameterized::_has_name
0000s0sSpecio::Constraint::Parameterized::::can_be_inlinedSpecio::Constraint::Parameterized::can_be_inlined
0000s0sSpecio::Constraint::Parameterized::::type_parameterSpecio::Constraint::Parameterized::type_parameter
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Specio::Constraint::Parameterized;
2
3use strict;
4use warnings;
5
6our $VERSION = '0.47';
7
8use Role::Tiny::With;
9use Specio::OO;
10use Storable qw( dclone );
11
12use Specio::Constraint::Role::Interface;
13with 'Specio::Constraint::Role::Interface';
14
15{
16 ## no critic (Subroutines::ProtectPrivateSubs)
17 my $attrs = dclone( Specio::Constraint::Role::Interface::_attrs() );
18 ## use critic
19
20 $attrs->{parent}{isa} = 'Specio::Constraint::Parameterizable';
21 $attrs->{parent}{required} = 1;
22
23 delete $attrs->{name}{predicate};
24 $attrs->{name}{lazy} = 1;
25 $attrs->{name}{builder} = '_build_name';
26
27 $attrs->{parameter} = {
28 does => 'Specio::Constraint::Role::Interface',
29 required => 1,
30 };
31
32 ## no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
33 sub _attrs {
34 return $attrs;
35 }
36}
37
38sub _has_name {
39 my $self = shift;
40 return defined $self->name;
41}
42
43sub _build_name {
44 my $self = shift;
45
46 ## no critic (Subroutines::ProtectPrivateSubs)
47 return unless $self->parent->_has_name && $self->parameter->_has_name;
48 return $self->parent->name . '[' . $self->parameter->name . ']';
49}
50
51sub can_be_inlined {
52 my $self = shift;
53
54 return $self->_has_inline_generator
55 && $self->parameter->can_be_inlined;
56}
57
58# Moose compatibility methods - these exist as a temporary hack to make Specio
59# work with Moose.
60
61sub type_parameter {
62 shift->parameter;
63}
64
65__PACKAGE__->_ooify;
66
671;
68
69# ABSTRACT: A class which represents parameterized constraints
70
71__END__