/usr/lib/perl5/ALTree/Site.pm is in altree 1.3.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | package ALTree::Site;
################################################################
################################################################
####################### Site ##########################
################################################################
################################################################
use base 'ALTree::Base';
use ALTree::Sens;
# Structure Site
# "site_nb" -> Integer
# "sens_struct" -> Hash of ('sens_label' -> SiteSens)
sub InitSite { # [obj] $site
my $self=shift;
my $site_nb=shift;
$self->_init("site_nb" => $site_nb, "sens_struct" => {});
$self->Debug("creating Site $site_nb\n");
}
sub GetSiteNb {
my $self=shift;
return $self->{"site_nb"};
}
sub HasSensIndex {
my $self=shift;
my $sens=shift;
return exists($self->{"sens_struct"}->{$sens->GetLabel()});
}
sub AddSens {
my $self=shift;
my $sens=shift;
my($ref_site_sens)=$self->NewSens($sens);
$self->{"sens_struct"}->{$sens->GetLabel()}=$ref_site_sens;
my $sensRev=ALTree::Sens->NewRev($sens);
my($ref_site_sens_rev)=$self->NewSens($sensRev);
$self->{"sens_struct"}->{$sensRev->GetLabel()}=$ref_site_sens_rev;
ALTree::SiteSens::LinkRev($ref_site_sens, $ref_site_sens_rev);
}
sub GetSens {
my $self=shift;
my $sens=shift;
return $self->{"sens_struct"}->{$sens->GetLabel()};
}
sub ProvideSens {
my $self=shift;
my $sens=shift;
if (not $self->HasSensIndex($sens)) {
$self->AddSens($sens);
} # creation du hash ref_site_sens et d'une ref dessus
return $self->GetSens($sens);
}
sub GetSensIndexList {
my $self=shift;
return keys(%{$self->{"sens_struct"}});
}
sub GetSensList {
my $self=shift;
return values(%{$self->{"sens_struct"}});
}
sub NewSens {
my $self=shift;
my $sens=shift;
die "This method needs to be overwriten\n";
}
1;
|