line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## Class Generic - ~/lib/Class/Promise.pm |
3
|
|
|
|
|
|
|
## Version v0.1.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2022 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2022/03/08 |
7
|
|
|
|
|
|
|
## Modified 2022/03/08 |
8
|
|
|
|
|
|
|
## All rights reserved |
9
|
|
|
|
|
|
|
## |
10
|
|
|
|
|
|
|
## This program is free software; you can redistribute it and/or modify it |
11
|
|
|
|
|
|
|
## under the same terms as Perl itself. |
12
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
13
|
|
|
|
|
|
|
BEGIN |
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
use strict; |
16
|
7
|
|
|
7
|
|
156828009
|
use warnings; |
|
7
|
|
|
|
|
50
|
|
|
7
|
|
|
|
|
206
|
|
17
|
7
|
|
|
7
|
|
34
|
use warnings::register; |
|
7
|
|
|
|
|
7
|
|
|
7
|
|
|
|
|
185
|
|
18
|
7
|
|
|
7
|
|
30
|
use parent qw( Promise::Me ); |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
1105
|
|
19
|
7
|
|
|
7
|
|
38
|
our @EXPORT_OK = @Promise::Me::EXPORT_OK; |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
50
|
|
20
|
7
|
|
|
7
|
|
39594385
|
our %EXPORT_TAGS = %Promise::Me::EXPORT_TAGS; |
21
|
7
|
|
|
|
|
53
|
our @EXPORT = @Promise::Me::EXPORT; |
22
|
7
|
|
|
|
|
28
|
our $VERSION = 'v0.1.0'; |
23
|
7
|
|
|
0
|
|
2060
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
{ |
26
|
|
|
|
|
|
|
my $class = shift( @_ ); |
27
|
|
|
|
|
|
|
my $hash = {}; |
28
|
7
|
|
|
7
|
|
103
|
for( my $i = 0; $i < scalar( @_ ); $i++ ) |
29
|
7
|
|
|
|
|
14
|
{ |
30
|
7
|
|
|
|
|
35
|
if( $_[$i] eq 'debug' || |
31
|
|
|
|
|
|
|
$_[$i] eq 'debug_code' || |
32
|
6
|
50
|
33
|
|
|
96
|
$_[$i] eq 'debug_file' || |
|
|
|
33
|
|
|
|
|
|
|
|
33
|
|
|
|
|
33
|
|
|
|
|
|
|
$_[$i] eq 'no_filter' ) |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
$hash->{ $_[$i] } = $_[$i+1]; |
36
|
|
|
|
|
|
|
CORE::splice( @_, $i, 2 ); |
37
|
0
|
|
|
|
|
0
|
$i--; |
38
|
0
|
|
|
|
|
0
|
} |
39
|
0
|
|
|
|
|
0
|
} |
40
|
|
|
|
|
|
|
# $class->export_to_level( 1, @_ ); |
41
|
|
|
|
|
|
|
Promise::Me->export_to_level( 1, @_ ); |
42
|
|
|
|
|
|
|
#local $Exporter::ExportLevel = 1; |
43
|
7
|
|
|
|
|
710
|
$class->SUPER::import( @_ ); |
44
|
|
|
|
|
|
|
#Promise::Me->SUPER::import( @_ ); |
45
|
7
|
|
|
|
|
50
|
# $class->export_to_level( 1, @_ ); |
46
|
|
|
|
|
|
|
$hash->{debug} = 0 if( !CORE::exists( $hash->{debug} ) ); |
47
|
|
|
|
|
|
|
$hash->{no_filter} = 0 if( !CORE::exists( $hash->{no_filter} ) ); |
48
|
7
|
50
|
|
|
|
1131
|
$hash->{debug_code} = 0 if( !CORE::exists( $hash->{debug_code} ) ); |
49
|
7
|
50
|
|
|
|
27
|
Filter::Util::Call::filter_add( bless( $hash => ( ref( $class ) || $class ) ) ); |
50
|
7
|
50
|
|
|
|
20
|
my $caller = caller; |
51
|
7
|
|
33
|
|
|
50
|
my $pm = 'Promise::Me'; |
52
|
7
|
|
|
|
|
111
|
for( qw( ARRAY HASH SCALAR ) ) |
53
|
7
|
|
|
|
|
14
|
{ |
54
|
7
|
|
|
|
|
8
|
*{"${caller}\::MODIFY_${_}_ATTRIBUTES"} = sub |
55
|
|
|
|
|
|
|
{ |
56
|
21
|
|
|
|
|
187
|
my( $pack, $ref, $attr ) = @_; |
57
|
|
|
|
|
|
|
{ |
58
|
3
|
|
|
3
|
|
516936
|
if( $attr eq 'Promise_shared' ) |
59
|
|
|
|
|
|
|
{ |
60
|
3
|
50
|
|
|
|
33
|
my $type = lc( ref( $ref ) ); |
|
3
|
|
|
|
|
42
|
|
61
|
|
|
|
|
|
|
if( $type !~ /^(array|hash|scalar)$/ ) |
62
|
3
|
|
|
|
|
18
|
{ |
63
|
3
|
50
|
|
|
|
96
|
warnings::warn( "Unsupported variable type '$type': '$ref'\n" ) if( warnings::enabled() || $DEBUG ); |
64
|
|
|
|
|
|
|
return; |
65
|
0
|
0
|
0
|
|
|
0
|
} |
66
|
0
|
|
|
|
|
0
|
&{"${pm}\::share"}( $ref ); |
67
|
|
|
|
|
|
|
} |
68
|
3
|
|
|
|
|
195
|
} |
|
3
|
|
|
|
|
234
|
|
69
|
|
|
|
|
|
|
return; |
70
|
|
|
|
|
|
|
}; |
71
|
3
|
|
|
|
|
27165
|
} |
72
|
21
|
|
|
|
|
87
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=encoding utf-8 |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 NAME |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Class::Promise - Class Generic |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SYNOPSIS |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
use Class::Promise; |
86
|
|
|
|
|
|
|
my $this = Class::Promise->new || die( Class::Promise->error, "\n" ); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 VERSION |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
v0.1.0 |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 DESCRIPTION |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 METHODS |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 AUTHOR |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SEE ALSO |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
L<perl> |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Copyright(c) 2022 DEGUEST Pte. Ltd. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
All rights reserved |
109
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |