line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SLOOPS::Tut::Vehicule ; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
948
|
use base qw/Class::AutoAccess/ ; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
149
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $PERSIST = { |
6
|
|
|
|
|
|
|
'fields' => { |
7
|
|
|
|
|
|
|
'nbDoors' => [ 'INT' , 0 ], # Here we use the possibility to control how the attribut will be |
8
|
|
|
|
|
|
|
# stored and what is its default value |
9
|
|
|
|
|
|
|
'nbWheels' => [ 'INT' , 1 ] |
10
|
|
|
|
|
|
|
}, |
11
|
|
|
|
|
|
|
'references' => { |
12
|
|
|
|
|
|
|
'owner' => 'SLOOPS::Tut::Person' # Owner will be a reference on a person !! |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
}; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new{ |
17
|
0
|
|
|
0
|
0
|
|
my ($class) = @_ ; |
18
|
0
|
|
|
|
|
|
my $self = { |
19
|
|
|
|
|
|
|
'nbDoors' => undef , |
20
|
|
|
|
|
|
|
'nbWheels' => undef, |
21
|
|
|
|
|
|
|
'owner' => undef |
22
|
|
|
|
|
|
|
}; |
23
|
0
|
|
|
|
|
|
return bless $self, $class ; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |