line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# vim:ts=4 sw=4
|
2
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------------------------
|
3
|
|
|
|
|
|
|
# Name : Class::STL::ClassMembers::Constructor.pm
|
4
|
|
|
|
|
|
|
# Created : 8 May 2006
|
5
|
|
|
|
|
|
|
# Author : Mario Gaffiero (gaffie)
|
6
|
|
|
|
|
|
|
#
|
7
|
|
|
|
|
|
|
# Copyright 2006-2007 Mario Gaffiero.
|
8
|
|
|
|
|
|
|
#
|
9
|
|
|
|
|
|
|
# This file is part of Class::STL::Containers(TM).
|
10
|
|
|
|
|
|
|
#
|
11
|
|
|
|
|
|
|
# Class::STL::Containers is free software; you can redistribute it and/or modify
|
12
|
|
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
13
|
|
|
|
|
|
|
# the Free Software Foundation; version 2 of the License.
|
14
|
|
|
|
|
|
|
#
|
15
|
|
|
|
|
|
|
# Class::STL::Containers is distributed in the hope that it will be useful,
|
16
|
|
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
|
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18
|
|
|
|
|
|
|
# GNU General Public License for more details.
|
19
|
|
|
|
|
|
|
#
|
20
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
21
|
|
|
|
|
|
|
# along with Class::STL::Containers; if not, write to the Free Software
|
22
|
|
|
|
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
23
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------------------------
|
24
|
|
|
|
|
|
|
# Modification History
|
25
|
|
|
|
|
|
|
# When Version Who What
|
26
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------------------------
|
27
|
|
|
|
|
|
|
# TO DO:
|
28
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------------------------
|
29
|
|
|
|
|
|
|
require 5.005_62;
|
30
|
11
|
|
|
11
|
|
73
|
use strict;
|
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
927
|
|
31
|
11
|
|
|
11
|
|
130
|
use warnings;
|
|
11
|
|
|
|
|
31
|
|
|
11
|
|
|
|
|
895
|
|
32
|
11
|
|
|
11
|
|
65
|
use vars qw($VERSION $BUILD);
|
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
1057
|
|
33
|
|
|
|
|
|
|
$VERSION = '0.27';
|
34
|
|
|
|
|
|
|
$BUILD = 'Tuesday May 16 23:08:34 GMT 2006';
|
35
|
11
|
|
|
11
|
|
63
|
use Class::STL::ClassMembers::DataMember;
|
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
699
|
|
36
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------------------------
|
37
|
|
|
|
|
|
|
{
|
38
|
|
|
|
|
|
|
package Class::STL::ClassMembers::Constructor;
|
39
|
11
|
|
|
|
|
783
|
use Class::STL::ClassMembers qw( _caller _trace ),
|
40
|
|
|
|
|
|
|
Class::STL::ClassMembers::DataMember->new(name => 'debug_on', default => 0),
|
41
|
|
|
|
|
|
|
Class::STL::ClassMembers::DataMember->new(name => 'singleton', default => 0),
|
42
|
11
|
|
|
11
|
|
733
|
Class::STL::ClassMembers::DataMember->new(name => 'ctor_name', default => 'new'); # OBSOLETE
|
|
11
|
|
|
|
|
28
|
|
43
|
11
|
|
|
11
|
|
68
|
use Carp qw(confess);
|
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
1122
|
|
44
|
9
|
|
|
9
|
|
54
|
use Class::STL::Trace;
|
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
434
|
|
45
|
|
|
|
|
|
|
sub import
|
46
|
|
|
|
|
|
|
{
|
47
|
142
|
|
|
142
|
|
651
|
my $proto = shift;
|
48
|
142
|
|
33
|
|
|
943
|
my $class = ref($proto) || $proto;
|
49
|
142
|
|
|
|
|
403
|
my $self = {};
|
50
|
142
|
|
|
|
|
475
|
bless($self, $class);
|
51
|
142
|
|
|
|
|
5883
|
$self->members_init(@_, _caller => (caller())[0]);
|
52
|
142
|
|
|
|
|
791
|
$self->_trace(Class::STL::Trace->new());
|
53
|
142
|
50
|
|
|
|
4960
|
$self->_trace()->debug_on($self->debug_on()) if ($self->debug_on());
|
54
|
9
|
0
|
0
|
9
|
0
|
53
|
eval($self->code(@_));
|
|
9
|
0
|
0
|
9
|
|
14
|
|
|
9
|
0
|
0
|
9
|
|
1601
|
|
|
9
|
0
|
0
|
7
|
|
55
|
|
|
9
|
0
|
0
|
7
|
|
15
|
|
|
9
|
0
|
0
|
7
|
|
1676
|
|
|
9
|
0
|
0
|
7
|
|
51
|
|
|
9
|
0
|
0
|
7
|
|
17
|
|
|
9
|
0
|
0
|
7
|
|
1404
|
|
|
7
|
0
|
0
|
7
|
|
36
|
|
|
7
|
0
|
0
|
7
|
|
38
|
|
|
7
|
0
|
0
|
7
|
|
1179
|
|
|
7
|
0
|
0
|
7
|
|
40
|
|
|
7
|
0
|
0
|
7
|
|
19
|
|
|
7
|
0
|
0
|
7
|
|
1312
|
|
|
7
|
0
|
0
|
7
|
|
40
|
|
|
7
|
0
|
0
|
7
|
|
13
|
|
|
7
|
0
|
0
|
7
|
|
1324
|
|
|
7
|
0
|
0
|
7
|
|
45
|
|
|
7
|
0
|
0
|
7
|
|
12
|
|
|
7
|
0
|
0
|
7
|
|
1259
|
|
|
7
|
0
|
0
|
7
|
|
112
|
|
|
7
|
0
|
0
|
7
|
|
14
|
|
|
7
|
0
|
0
|
7
|
|
1120
|
|
|
7
|
0
|
0
|
7
|
|
39
|
|
|
7
|
0
|
0
|
7
|
|
16
|
|
|
7
|
0
|
0
|
7
|
|
1730
|
|
|
7
|
0
|
0
|
7
|
|
44
|
|
|
7
|
0
|
0
|
7
|
|
14
|
|
|
7
|
0
|
0
|
7
|
|
1022
|
|
|
7
|
0
|
0
|
7
|
|
41
|
|
|
7
|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|
|
|
28
|
|
|
7
|
|
|
|
|
61
|
|
|
7
|
|
|
|
|
167
|
|
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
296
|
|
|
7
|
|
|
|
|
34
|
|
|
7
|
|
|
|
|
200
|
|
55
|
142
|
50
|
|
|
|
678
|
confess "**Error in eval for @{[ $self->_caller() ]} FunctionMember constructor function creation:\n$@" if ($@);
|
|
0
|
|
|
|
|
0
|
|
56
|
142
|
|
|
|
|
51278
|
return $self;
|
57
|
|
|
|
|
|
|
}
|
58
|
|
|
|
|
|
|
sub code
|
59
|
|
|
|
|
|
|
{
|
60
|
142
|
|
|
142
|
0
|
341
|
my $self = shift;
|
61
|
142
|
|
|
|
|
270
|
my $tab = ' ' x 4;
|
62
|
142
|
|
|
|
|
193
|
my $code;
|
63
|
142
|
|
|
|
|
4745
|
my $c = $self->_caller();
|
64
|
|
|
|
|
|
|
# new(void);
|
65
|
|
|
|
|
|
|
# new(element_ref); -- copy ctor
|
66
|
|
|
|
|
|
|
# new(raw_data);
|
67
|
|
|
|
|
|
|
# new(option-pairs list);
|
68
|
|
|
|
|
|
|
|
69
|
142
|
|
|
|
|
289
|
my $sname = 'self';
|
70
|
142
|
100
|
|
|
|
5294
|
if ($self->singleton()) {
|
71
|
1
|
|
|
|
|
4
|
$sname = '__' . lc($c);
|
72
|
1
|
|
|
|
|
4
|
$sname =~ s/:+/_/g;
|
73
|
|
|
|
|
|
|
}
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# Extract named parameter/value pairs and pass on...
|
76
|
142
|
|
|
|
|
236
|
my @p;
|
77
|
142
|
50
|
33
|
|
|
453
|
while (@_) { my $p=shift; push(@p, $p, shift) if (!ref($p) && @_); }
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
26
|
|
78
|
142
|
|
|
|
|
444
|
my %p = @p;
|
79
|
|
|
|
|
|
|
|
80
|
142
|
|
|
|
|
381
|
$code = "{\npackage $c;\n";
|
81
|
142
|
|
|
|
|
317
|
$code .= "sub _@{[ $self->ctor_name() ]}\n";
|
|
142
|
|
|
|
|
4434
|
|
82
|
142
|
|
|
|
|
2328
|
$code .= "{\n";
|
83
|
142
|
100
|
|
|
|
5974
|
if ($self->singleton()) {
|
84
|
1
|
|
|
|
|
4
|
$code .= "${tab}our \$$sname;\n";
|
85
|
1
|
|
|
|
|
4
|
$code .= "${tab}return \$$sname if (defined(\$$sname));\n";
|
86
|
|
|
|
|
|
|
}
|
87
|
142
|
|
|
|
|
3883
|
$code .= "${tab}use vars qw(\@ISA);\n";
|
88
|
142
|
|
|
|
|
269
|
$code .= "${tab}my \$proto = shift;\n";
|
89
|
142
|
|
|
|
|
257
|
$code .= "${tab}return \$_[0]->_clone() if (ref(\$_[0]) && \$_[0]->isa(__PACKAGE__));\n";
|
90
|
142
|
|
|
|
|
1673
|
$code .= "${tab}my \$class = ref(\$proto) || \$proto;\n";
|
91
|
143
|
100
|
|
|
|
5639
|
$code .= "${tab}my " unless($self->singleton());
|
92
|
143
|
|
|
|
|
2028
|
$code .= "${tab}\$$sname = int(\@ISA) ? \$class->SUPER::_@{[ $self->ctor_name() ]}(\@_) : {};\n";
|
|
143
|
|
|
|
|
4151
|
|
93
|
143
|
|
|
|
|
571
|
$code .= "${tab}bless(\$$sname, \$class);\n";
|
94
|
143
|
100
|
|
|
|
339
|
$code .= "${tab}\$$sname->members_init(@{[ @p ? join(', ', '@_', map(qq/'$_'/, %p)) : '@_' ]});\n";
|
|
143
|
|
|
|
|
689
|
|
95
|
143
|
|
|
|
|
370
|
$code .= "${tab}return \$$sname;\n";
|
96
|
143
|
|
|
|
|
278
|
$code .= "}\n";
|
97
|
143
|
|
|
|
|
272
|
$code .= "}\n";
|
98
|
|
|
|
|
|
|
|
99
|
143
|
|
|
|
|
292
|
$code .= "{\npackage $c;\n";
|
100
|
143
|
|
|
|
|
237
|
$code .= "sub @{[ $self->ctor_name() ]}\n";
|
|
143
|
|
|
|
|
4435
|
|
101
|
143
|
|
|
|
|
299
|
$code .= "{\n";
|
102
|
143
|
100
|
|
|
|
4605
|
if ($self->singleton()) {
|
103
|
2
|
|
|
|
|
11
|
$code .= "${tab}our \$$sname;\n";
|
104
|
2
|
|
|
|
|
9
|
$code .= "${tab}return \$$sname if (defined(\$$sname));\n";
|
105
|
|
|
|
|
|
|
}
|
106
|
142
|
|
|
|
|
356
|
$code .= "${tab}use vars qw(\@ISA);\n";
|
107
|
142
|
|
|
|
|
261
|
$code .= "${tab}my \$proto = shift;\n";
|
108
|
142
|
|
|
|
|
361
|
$code .= "${tab}return \$_[0]->clone() if (ref(\$_[0]) && \$_[0]->isa(__PACKAGE__));\n";
|
109
|
142
|
|
|
|
|
403
|
$code .= "${tab}my \$class = ref(\$proto) || \$proto;\n";
|
110
|
142
|
100
|
|
|
|
4307
|
$code .= "${tab}my " unless($self->singleton());
|
111
|
142
|
|
|
|
|
10135
|
$code .= "${tab}\$$sname = int(\@ISA) ? \$class->SUPER::@{[ $self->ctor_name() ]}(\@_) : {};\n";
|
|
142
|
|
|
|
|
4086
|
|
112
|
142
|
|
|
|
|
610
|
$code .= "${tab}bless(\$$sname, \$class);\n";
|
113
|
142
|
100
|
|
|
|
384
|
$code .= "${tab}\$$sname->members_init(@{[ @p ? join(', ', '@_', map(qq/'$_'/, %p)) : '@_' ]});\n";
|
|
142
|
|
|
|
|
581
|
|
114
|
142
|
100
|
|
|
|
432
|
$code .= "${tab}$c\::new_extra(\$$sname, @{[ @p ? join(', ', '@_', map(qq/'$_'/, %p)) : '@_' ]})\n"; #--> CREATE
|
|
142
|
|
|
|
|
510
|
|
115
|
142
|
|
|
|
|
491
|
$code .= "${tab}${tab}if (defined(&$c\::new_extra));\n";
|
116
|
142
|
|
|
|
|
280
|
$code .= "${tab}return \$$sname;\n";
|
117
|
142
|
|
|
|
|
204
|
$code .= "}\n";
|
118
|
142
|
|
|
|
|
200
|
$code .= "}\n";
|
119
|
142
|
50
|
|
|
|
15579
|
$self->_trace()->print($c, $code) if ($self->_trace()->debug_on());
|
120
|
142
|
|
|
|
|
22174
|
return $code;
|
121
|
|
|
|
|
|
|
}
|
122
|
|
|
|
|
|
|
}
|
123
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------------------------
|
124
|
|
|
|
|
|
|
1;
|