← 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:14 2021

Filename/usr/local/lib/perl5/site_perl/Mail/AuthenticationResults/Header/Group.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sMail::AuthenticationResults::Header::Group::::BEGIN@11Mail::AuthenticationResults::Header::Group::BEGIN@11
0000s0sMail::AuthenticationResults::Header::Group::::BEGIN@5Mail::AuthenticationResults::Header::Group::BEGIN@5
0000s0sMail::AuthenticationResults::Header::Group::::BEGIN@6Mail::AuthenticationResults::Header::Group::BEGIN@6
0000s0sMail::AuthenticationResults::Header::Group::::BEGIN@8Mail::AuthenticationResults::Header::Group::BEGIN@8
0000s0sMail::AuthenticationResults::Header::Group::::BEGIN@9Mail::AuthenticationResults::Header::Group::BEGIN@9
0000s0sMail::AuthenticationResults::Header::Group::::_ALLOWED_CHILDRENMail::AuthenticationResults::Header::Group::_ALLOWED_CHILDREN
0000s0sMail::AuthenticationResults::Header::Group::::_HAS_CHILDRENMail::AuthenticationResults::Header::Group::_HAS_CHILDREN
0000s0sMail::AuthenticationResults::Header::Group::::add_childMail::AuthenticationResults::Header::Group::add_child
0000s0sMail::AuthenticationResults::Header::Group::::build_stringMail::AuthenticationResults::Header::Group::build_string
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Mail::AuthenticationResults::Header::Group;
2# ABSTRACT: Class modelling Groups of Authentication Results Header parts
3
4require 5.008;
5use strict;
6use warnings;
7our $VERSION = '2.20210112'; # VERSION
8use Scalar::Util qw{ refaddr };
9use Carp;
10
11use base 'Mail::AuthenticationResults::Header::Base';
12
13
14sub _HAS_CHILDREN{ return 1; }
15
16sub _ALLOWED_CHILDREN {
17 my ( $self, $child ) = @_;
18 return 1 if ref $child eq 'Mail::AuthenticationResults::Header';
19 return 1 if ref $child eq 'Mail::AuthenticationResults::Header::AuthServID';
20 return 1 if ref $child eq 'Mail::AuthenticationResults::Header::Comment';
21 return 1 if ref $child eq 'Mail::AuthenticationResults::Header::Entry';
22 return 1 if ref $child eq 'Mail::AuthenticationResults::Header::Group';
23 return 1 if ref $child eq 'Mail::AuthenticationResults::Header::SubEntry';
24 return 1 if ref $child eq 'Mail::AuthenticationResults::Header::Version';
25 return 0;
26}
27
28sub add_child {
29 my ( $self, $child ) = @_;
30 croak 'Cannot add child' if ! $self->_ALLOWED_CHILDREN( $child );
31 croak 'Cannot add a class as its own parent' if refaddr $self == refaddr $child;
32
33 if ( ref $child eq 'Mail::AuthenticationResults::Header::Group' ) {
34 foreach my $subchild ( @{ $child->children() } ) {
35 $self->add_child( $subchild );
36 }
37 ## ToDo what to return in this case?
38 }
39 else {
40 foreach my $current_child ( @{ $self->children() } ) {
41 if ( $current_child == $child ) {
42 return $child;
43 }
44 }
45 $self->SUPER::add_child( $child );
46 }
47
48 return $child;
49}
50
51sub build_string {
52 my ( $self, $header ) = @_;
53
54 my $sep = 0;
55 foreach my $child ( @{ $self->children() } ) {
56 $header->separator( ';' ) if $sep;
57 $header->space( "\n" ) if $sep;
58 $sep = 1;
59 $child->build_string( $header );
60 }
61
62 return;
63}
64
651;
66
67__END__