| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package CAE::Nastran::Nasmod; |
|
2
|
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
42544
|
use strict; |
|
|
4
|
|
|
|
|
11
|
|
|
|
4
|
|
|
|
|
151
|
|
|
4
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
134
|
|
|
5
|
4
|
|
|
4
|
|
2745
|
use CAE::Nastran::Nasmod::Entity; |
|
|
4
|
|
|
|
|
12
|
|
|
|
4
|
|
|
|
|
131
|
|
|
6
|
4
|
|
|
4
|
|
24
|
use vars qw($VERSION $ABSTRACT $DATE); |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
6184
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
$VERSION = '0.26'; |
|
9
|
|
|
|
|
|
|
$DATE = 'Fri Apr 25 13:17:31 2014'; |
|
10
|
|
|
|
|
|
|
$ABSTRACT = 'basic access to nastran models'; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new |
|
13
|
|
|
|
|
|
|
{ |
|
14
|
32
|
|
|
32
|
1
|
2479
|
my $this = shift; |
|
15
|
32
|
|
33
|
|
|
222
|
my $class = ref($this) || $this; |
|
16
|
32
|
|
|
|
|
52
|
my $self={}; |
|
17
|
|
|
|
|
|
|
|
|
18
|
32
|
|
|
|
|
181
|
$self = |
|
19
|
|
|
|
|
|
|
{ |
|
20
|
|
|
|
|
|
|
"bulk" => [], |
|
21
|
|
|
|
|
|
|
"tmp" => [], |
|
22
|
|
|
|
|
|
|
}; |
|
23
|
|
|
|
|
|
|
|
|
24
|
32
|
|
|
|
|
89
|
bless ($self, $class); |
|
25
|
32
|
|
|
|
|
83
|
return $self; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#--------------------- |
|
29
|
|
|
|
|
|
|
# prints the whole model to STDOUT or a file |
|
30
|
|
|
|
|
|
|
# print() |
|
31
|
|
|
|
|
|
|
# return: 0 | 1 |
|
32
|
|
|
|
|
|
|
#--------------------- |
|
33
|
|
|
|
|
|
|
sub print |
|
34
|
|
|
|
|
|
|
{ |
|
35
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
|
36
|
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
3
|
my $outfile = undef; |
|
38
|
1
|
50
|
|
|
|
5
|
if (@_) |
|
39
|
|
|
|
|
|
|
{ |
|
40
|
1
|
|
|
|
|
3
|
$outfile = shift(@_); |
|
41
|
1
|
50
|
|
|
|
84
|
if (stat $outfile) |
|
42
|
|
|
|
|
|
|
{ |
|
43
|
0
|
|
|
|
|
0
|
print("error: file does already exist. " . $outfile . "\n"); |
|
44
|
0
|
|
|
|
|
0
|
return 0; |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# if an outfile has been defined, redirect STDOUT to this file |
|
49
|
1
|
50
|
|
|
|
5
|
if($outfile) |
|
50
|
|
|
|
|
|
|
{ |
|
51
|
1
|
50
|
|
|
|
42
|
open (SAVE, ">&STDOUT") or die "can't save STDOUT $!\n"; |
|
52
|
1
|
50
|
|
|
|
134
|
open (STDOUT, '>', $outfile) or die "can't redirect STDOUT to " . $outfile . ": $!"; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# print "WOOOOOPP\n"; |
|
56
|
|
|
|
|
|
|
# print "anzahl der entities: " . scalar(@{$self->{'bulk'}}) . "\n"; |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# print each entity |
|
59
|
1
|
|
|
|
|
4
|
foreach my $entity (@{$self->{'bulk'}}) |
|
|
1
|
|
|
|
|
3
|
|
|
60
|
|
|
|
|
|
|
{ |
|
61
|
6
|
|
|
|
|
29
|
$entity->print(); |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# remove redirection of STDOUT |
|
65
|
1
|
50
|
|
|
|
6
|
if($outfile) |
|
66
|
|
|
|
|
|
|
{ |
|
67
|
1
|
|
|
|
|
15
|
close STDOUT; |
|
68
|
1
|
50
|
|
|
|
21
|
open (STDOUT, ">&SAVE") or die "can't restore STDOUT $!\n"; |
|
69
|
1
|
|
|
|
|
5
|
close SAVE; |
|
70
|
|
|
|
|
|
|
} |
|
71
|
|
|
|
|
|
|
|
|
72
|
1
|
|
|
|
|
4
|
return 1; |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
#--------------------- |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
#--------------------- |
|
77
|
|
|
|
|
|
|
# imports data from a nastran file |
|
78
|
|
|
|
|
|
|
# optional filtering possible |
|
79
|
|
|
|
|
|
|
#--------------------- |
|
80
|
|
|
|
|
|
|
sub importBulk |
|
81
|
|
|
|
|
|
|
{ |
|
82
|
21
|
|
|
21
|
0
|
224
|
my $self = shift; |
|
83
|
21
|
|
|
|
|
36
|
my $path = shift; |
|
84
|
21
|
|
|
|
|
27
|
my $refh_options; |
|
85
|
|
|
|
|
|
|
|
|
86
|
21
|
100
|
|
|
|
103
|
if(@_) |
|
87
|
|
|
|
|
|
|
{ |
|
88
|
9
|
|
|
|
|
16
|
$refh_options = shift; |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
|
|
91
|
21
|
50
|
|
|
|
934
|
if (!open (MODEL, "<$path")) {die "cannot read $path"} |
|
|
0
|
|
|
|
|
0
|
|
|
92
|
|
|
|
|
|
|
|
|
93
|
21
|
|
|
|
|
1086
|
my @model = ; |
|
94
|
21
|
|
|
|
|
64
|
chomp @model; |
|
95
|
21
|
|
|
|
|
265
|
close MODEL; |
|
96
|
|
|
|
|
|
|
|
|
97
|
21
|
|
|
|
|
72
|
$self->{'tmp'} = \@model; |
|
98
|
|
|
|
|
|
|
|
|
99
|
21
|
100
|
|
|
|
60
|
if ($refh_options) |
|
100
|
|
|
|
|
|
|
{ |
|
101
|
9
|
|
|
|
|
29
|
$self->parse($refh_options); |
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
else |
|
104
|
|
|
|
|
|
|
{ |
|
105
|
12
|
|
|
|
|
38
|
$self->parse(); |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
} |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
#--------------------- |
|
110
|
|
|
|
|
|
|
# parse bulkdata and store entity-objects in show |
|
111
|
|
|
|
|
|
|
#--------------------- |
|
112
|
|
|
|
|
|
|
sub parse |
|
113
|
|
|
|
|
|
|
{ |
|
114
|
21
|
|
|
21
|
0
|
89
|
my $self = shift; |
|
115
|
|
|
|
|
|
|
|
|
116
|
21
|
|
|
|
|
29
|
my $maxoccur; |
|
117
|
21
|
|
|
|
|
30
|
my $occur = 0; |
|
118
|
|
|
|
|
|
|
|
|
119
|
21
|
|
|
|
|
27
|
my $cards; |
|
120
|
|
|
|
|
|
|
my $refa_filter; |
|
121
|
|
|
|
|
|
|
|
|
122
|
21
|
100
|
|
|
|
53
|
if (@_) |
|
123
|
|
|
|
|
|
|
{ |
|
124
|
9
|
|
|
|
|
15
|
my $refh_options = shift; |
|
125
|
9
|
|
|
|
|
34
|
my %OPTIONS = %$refh_options; |
|
126
|
9
|
100
|
|
|
|
377
|
if (defined $OPTIONS{'cards'}) |
|
127
|
|
|
|
|
|
|
{ |
|
128
|
6
|
|
|
|
|
10
|
$cards = join("|", @{$OPTIONS{'cards'}}); |
|
|
6
|
|
|
|
|
19
|
|
|
129
|
|
|
|
|
|
|
} |
|
130
|
9
|
100
|
|
|
|
25
|
if (defined $OPTIONS{'filter'}) |
|
131
|
|
|
|
|
|
|
{ |
|
132
|
7
|
|
|
|
|
8
|
$refa_filter = $OPTIONS{'filter'}; |
|
133
|
|
|
|
|
|
|
} |
|
134
|
9
|
100
|
|
|
|
27
|
if (defined $OPTIONS{'maxoccur'}) |
|
135
|
|
|
|
|
|
|
{ |
|
136
|
1
|
|
|
|
|
3
|
$maxoccur = $OPTIONS{'maxoccur'}; |
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
|
|
140
|
21
|
|
|
|
|
25
|
my $entity; |
|
141
|
|
|
|
|
|
|
my @comment; |
|
142
|
|
|
|
|
|
|
|
|
143
|
21
|
|
|
|
|
30
|
my $just_skipped = 0; |
|
144
|
|
|
|
|
|
|
|
|
145
|
21
|
|
|
|
|
26
|
my $folgezeile = 0; |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
# each line of bulk |
|
148
|
21
|
|
|
|
|
88
|
foreach my $line (@{$self->{tmp}}) |
|
|
21
|
|
|
|
|
54
|
|
|
149
|
|
|
|
|
|
|
{ |
|
150
|
|
|
|
|
|
|
# if its a comment |
|
151
|
184
|
100
|
|
|
|
521
|
if ($line =~ m/^\$/) |
|
152
|
|
|
|
|
|
|
{ |
|
153
|
41
|
|
|
|
|
303
|
push @comment, $line; |
|
154
|
|
|
|
|
|
|
# print "-----\n"; |
|
155
|
|
|
|
|
|
|
# print "COMMENT: $line\n"; |
|
156
|
|
|
|
|
|
|
} |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
# if its an entity |
|
159
|
|
|
|
|
|
|
else |
|
160
|
|
|
|
|
|
|
{ |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
# sofort ueberpruefen ob die karte ueberhaupt eingelesen werden soll |
|
163
|
143
|
100
|
100
|
|
|
821
|
if (($cards) && ($line =~ m/^\w+/) && ($line !~ m/^$cards/)) |
|
|
|
|
100
|
|
|
|
|
|
164
|
|
|
|
|
|
|
{ |
|
165
|
9
|
|
|
|
|
11
|
$just_skipped = 1; |
|
166
|
9
|
|
|
|
|
112
|
undef @comment; |
|
167
|
9
|
|
|
|
|
18
|
next; |
|
168
|
|
|
|
|
|
|
} |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
# zeile zerteilen |
|
171
|
134
|
|
|
|
|
274
|
my @line = &split8($line); |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
# handelt es sich um die erste Zeile einer Karte? |
|
174
|
134
|
100
|
|
|
|
426
|
if ($line =~ m/^\w+/) |
|
|
|
50
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
{ |
|
176
|
114
|
|
|
|
|
120
|
$just_skipped = 0; |
|
177
|
114
|
|
|
|
|
295
|
$folgezeile = 0; |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
# first store previous entity-object if available and if matches the filter |
|
180
|
114
|
100
|
|
|
|
246
|
if ($entity) |
|
181
|
|
|
|
|
|
|
{ |
|
182
|
|
|
|
|
|
|
# greift der filter? dann ablegen | ist $maxoccur erreicht? dann abbrechen |
|
183
|
93
|
100
|
|
|
|
448
|
if($entity->match($refa_filter)) |
|
184
|
|
|
|
|
|
|
{ |
|
185
|
|
|
|
|
|
|
# print "FILTER GREIFT fuer Zeile: $line\n"; |
|
186
|
74
|
|
|
|
|
315
|
$self->addEntity($entity); |
|
187
|
74
|
|
|
|
|
88
|
$occur++; |
|
188
|
74
|
100
|
100
|
|
|
194
|
if( ($maxoccur) && ($maxoccur <= $occur) ) |
|
189
|
|
|
|
|
|
|
{ |
|
190
|
1
|
|
|
|
|
7
|
return; |
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
} |
|
193
|
|
|
|
|
|
|
} |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
# ein neues entity anlegen |
|
196
|
113
|
|
|
|
|
437
|
$entity = CAE::Nastran::Nasmod::Entity->new(); |
|
197
|
113
|
|
|
|
|
440
|
$entity->setComment(@comment); |
|
198
|
113
|
|
|
|
|
153
|
undef(@comment); |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
# die zerhackte zeile durchgehen und in einem entity ablegen |
|
201
|
113
|
|
|
|
|
300
|
for(my $x=0, my $col=1; $x<@line; $x++, $col++) |
|
202
|
|
|
|
|
|
|
{ |
|
203
|
693
|
|
|
|
|
1824
|
$entity->setCol($col, $line[$x]); |
|
204
|
|
|
|
|
|
|
} |
|
205
|
|
|
|
|
|
|
} |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
# wenn kein kommentar und keine schluesselzeile, dann handelt es sich um eine folgezeile. |
|
208
|
|
|
|
|
|
|
# diese soll nur dann beruecksichtigt werden, wenn die schluesselzeile nicht aussortiert wurde |
|
209
|
|
|
|
|
|
|
elsif (!($just_skipped)) |
|
210
|
|
|
|
|
|
|
{ |
|
211
|
20
|
|
|
|
|
25
|
$folgezeile++; |
|
212
|
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
# die zerhackte zeile durchgehen und in einem entity ablegen |
|
214
|
20
|
|
|
|
|
147
|
for(my $x=0, my $col=(1+($folgezeile * 10)); $x<@line; $x++, $col++) |
|
215
|
|
|
|
|
|
|
{ |
|
216
|
40
|
|
|
|
|
113
|
$entity->setCol($col, $line[$x]); |
|
217
|
|
|
|
|
|
|
} |
|
218
|
|
|
|
|
|
|
} |
|
219
|
|
|
|
|
|
|
} |
|
220
|
|
|
|
|
|
|
} |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
# zum schluss die letzte entity ablegen |
|
223
|
20
|
50
|
|
|
|
105
|
if ($entity) |
|
224
|
|
|
|
|
|
|
{ |
|
225
|
20
|
100
|
|
|
|
122
|
if ($entity->match($refa_filter)) |
|
226
|
|
|
|
|
|
|
{ |
|
227
|
16
|
|
|
|
|
38
|
$self->addEntity($entity); |
|
228
|
|
|
|
|
|
|
} |
|
229
|
|
|
|
|
|
|
} |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
} |
|
232
|
|
|
|
|
|
|
#--------------------- |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
#--------------------- |
|
235
|
|
|
|
|
|
|
# split a string in chunks of 8 characters |
|
236
|
|
|
|
|
|
|
#--------------------- |
|
237
|
|
|
|
|
|
|
sub split8 |
|
238
|
|
|
|
|
|
|
{ |
|
239
|
134
|
|
|
134
|
0
|
559
|
my $string = shift; |
|
240
|
134
|
|
|
|
|
222
|
my @strings; |
|
241
|
134
|
|
|
|
|
334
|
for (my $x=0; ($x*8) < length($string); $x++) |
|
242
|
|
|
|
|
|
|
{ |
|
243
|
739
|
|
|
|
|
1136
|
my $substring = substr $string, ($x*8), 8; |
|
244
|
739
|
|
|
|
|
2363
|
$substring =~ s/^\s+//; |
|
245
|
739
|
|
|
|
|
1363
|
$substring =~ s/\s+$//; |
|
246
|
739
|
|
|
|
|
2634
|
push @strings, $substring; |
|
247
|
|
|
|
|
|
|
} |
|
248
|
134
|
|
|
|
|
797
|
return @strings; |
|
249
|
|
|
|
|
|
|
} |
|
250
|
|
|
|
|
|
|
#--------------------- |
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
#--------------------- |
|
253
|
|
|
|
|
|
|
# adds an entity to show |
|
254
|
|
|
|
|
|
|
# addEntity(@entities) |
|
255
|
|
|
|
|
|
|
# return: - |
|
256
|
|
|
|
|
|
|
#--------------------- |
|
257
|
|
|
|
|
|
|
sub addEntity |
|
258
|
|
|
|
|
|
|
{ |
|
259
|
113
|
|
|
113
|
1
|
208
|
my $self = shift; |
|
260
|
113
|
|
|
|
|
240
|
push @{$self->{bulk}}, @_; |
|
|
113
|
|
|
|
|
789
|
|
|
261
|
|
|
|
|
|
|
} |
|
262
|
|
|
|
|
|
|
#--------------------- |
|
263
|
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
#--------------------- |
|
265
|
|
|
|
|
|
|
# gets the entities that match the filter. if no filter is given, returns all entities |
|
266
|
|
|
|
|
|
|
# getEntity(\@filter) |
|
267
|
|
|
|
|
|
|
# return: @allEntitiesThatMatch |
|
268
|
|
|
|
|
|
|
#--------------------- |
|
269
|
|
|
|
|
|
|
sub getEntity |
|
270
|
|
|
|
|
|
|
{ |
|
271
|
8
|
|
|
8
|
1
|
18
|
my $self = shift; |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
# if a filter is given |
|
274
|
8
|
100
|
|
|
|
33
|
if(@_) |
|
275
|
|
|
|
|
|
|
{ |
|
276
|
4
|
|
|
|
|
5
|
my $refh_filter = shift; |
|
277
|
4
|
|
|
|
|
12
|
my $newModel = $self->filter($refh_filter); |
|
278
|
4
|
|
|
|
|
15
|
return $newModel->getEntity(); |
|
279
|
|
|
|
|
|
|
} |
|
280
|
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
# if no filter is given |
|
282
|
|
|
|
|
|
|
else |
|
283
|
|
|
|
|
|
|
{ |
|
284
|
4
|
|
|
|
|
11
|
return @{$self->{bulk}}; |
|
|
4
|
|
|
|
|
36
|
|
|
285
|
|
|
|
|
|
|
} |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
} |
|
288
|
|
|
|
|
|
|
#--------------------- |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
#--------------------- |
|
291
|
|
|
|
|
|
|
# filter model |
|
292
|
|
|
|
|
|
|
# return a model |
|
293
|
|
|
|
|
|
|
# filter array: |
|
294
|
|
|
|
|
|
|
# $[0]: pattern for matching the comment |
|
295
|
|
|
|
|
|
|
# $[1]: pattern for matching the row1 of entity |
|
296
|
|
|
|
|
|
|
# $[2]: pattern for matching the row2 of entity |
|
297
|
|
|
|
|
|
|
# an entity matches when every pattern of the given filter is found in entity at the given place. |
|
298
|
|
|
|
|
|
|
#--------------------- |
|
299
|
|
|
|
|
|
|
sub filter |
|
300
|
|
|
|
|
|
|
{ |
|
301
|
11
|
|
|
11
|
1
|
73
|
my $self = shift; |
|
302
|
11
|
|
|
|
|
18
|
my $refa_filter = shift; |
|
303
|
11
|
|
|
|
|
600
|
my $refh_param; |
|
304
|
|
|
|
|
|
|
|
|
305
|
11
|
50
|
|
|
|
53
|
if (@_) |
|
306
|
|
|
|
|
|
|
{ |
|
307
|
0
|
|
|
|
|
0
|
$refh_param = shift; |
|
308
|
|
|
|
|
|
|
} |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
# ein neues objekt erzeugen |
|
311
|
11
|
|
|
|
|
43
|
my $filtered_model = CAE::Nastran::Nasmod->new(); |
|
312
|
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
# alle entities durchgehen |
|
314
|
11
|
|
|
|
|
16
|
foreach my $entity (@{$self->{'bulk'}}) |
|
|
11
|
|
|
|
|
26
|
|
|
315
|
|
|
|
|
|
|
{ |
|
316
|
72
|
100
|
|
|
|
174
|
if ($entity->match($refa_filter)) |
|
317
|
|
|
|
|
|
|
{ |
|
318
|
21
|
|
|
|
|
42
|
$filtered_model->addEntity($entity); |
|
319
|
21
|
50
|
|
|
|
59
|
if ($refh_param->{'firstonly'}) |
|
320
|
|
|
|
|
|
|
{ |
|
321
|
0
|
|
|
|
|
0
|
return $filtered_model; |
|
322
|
|
|
|
|
|
|
} |
|
323
|
|
|
|
|
|
|
} |
|
324
|
|
|
|
|
|
|
} |
|
325
|
11
|
|
|
|
|
29
|
return $filtered_model; |
|
326
|
|
|
|
|
|
|
} |
|
327
|
|
|
|
|
|
|
#--------------------- |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
#--------------------- |
|
330
|
|
|
|
|
|
|
# getrow |
|
331
|
|
|
|
|
|
|
sub getCol |
|
332
|
|
|
|
|
|
|
{ |
|
333
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
334
|
0
|
|
|
|
|
0
|
my $row = shift; |
|
335
|
0
|
|
|
|
|
0
|
my @return; |
|
336
|
0
|
|
|
|
|
0
|
foreach my $entity (@{$self->{'bulk'}}) |
|
|
0
|
|
|
|
|
0
|
|
|
337
|
|
|
|
|
|
|
{ |
|
338
|
0
|
|
|
|
|
0
|
push @return, $entity->getrow($row); |
|
339
|
|
|
|
|
|
|
} |
|
340
|
0
|
|
|
|
|
0
|
return @return; |
|
341
|
|
|
|
|
|
|
} |
|
342
|
|
|
|
|
|
|
#--------------------- |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
#--------------------- |
|
345
|
|
|
|
|
|
|
# merges models to this model |
|
346
|
|
|
|
|
|
|
# merge(Nasmod, Nasmod, ...) |
|
347
|
|
|
|
|
|
|
# return: - |
|
348
|
|
|
|
|
|
|
#--------------------- |
|
349
|
|
|
|
|
|
|
sub merge |
|
350
|
|
|
|
|
|
|
{ |
|
351
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
|
352
|
1
|
|
|
|
|
3
|
foreach my $model (@_) |
|
353
|
|
|
|
|
|
|
{ |
|
354
|
1
|
|
|
|
|
2
|
push @{$self->{'bulk'}}, @{$model->{'bulk'}}; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
4
|
|
|
355
|
|
|
|
|
|
|
} |
|
356
|
|
|
|
|
|
|
} |
|
357
|
|
|
|
|
|
|
#--------------------- |
|
358
|
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
#--------------------- |
|
360
|
|
|
|
|
|
|
# count_entities |
|
361
|
|
|
|
|
|
|
# count() |
|
362
|
|
|
|
|
|
|
# return: int |
|
363
|
|
|
|
|
|
|
#--------------------- |
|
364
|
|
|
|
|
|
|
sub count |
|
365
|
|
|
|
|
|
|
{ |
|
366
|
24
|
|
|
24
|
1
|
98
|
my $self = shift; |
|
367
|
|
|
|
|
|
|
|
|
368
|
24
|
|
|
|
|
33
|
return scalar(@{$self->{'bulk'}}); |
|
|
24
|
|
|
|
|
127
|
|
|
369
|
|
|
|
|
|
|
} |
|
370
|
|
|
|
|
|
|
#--------------------- |
|
371
|
|
|
|
|
|
|
1; |
|
372
|
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
__END__ |