line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: Set.pm,v 1.11 2003/06/06 18:45:02 unimlo Exp $ |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Net::ACL::Set; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
52
|
|
8
|
2
|
|
|
2
|
|
11
|
use Exporter; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
74
|
|
9
|
2
|
|
|
2
|
|
8
|
use vars qw( $VERSION @ISA ); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
95
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
## Inheritance and Versioning ## |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
@ISA = qw( Exporter ); |
14
|
|
|
|
|
|
|
$VERSION = '0.07'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
## Module Imports ## |
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
2
|
|
10
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
469
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
## Public Class Methods ## |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new |
23
|
|
|
|
|
|
|
{ |
24
|
0
|
|
|
0
|
1
|
|
my $proto = shift; |
25
|
0
|
|
0
|
|
|
|
my $class = ref $proto || $proto; |
26
|
0
|
0
|
|
|
|
|
croak 'Cannot construct object of abstract class Net::ACL::Set' |
27
|
|
|
|
|
|
|
if $class eq 'Net::ACL::Set'; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
## Public Object Methods ## |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub set |
33
|
|
|
|
|
|
|
{ |
34
|
0
|
|
|
0
|
1
|
|
my $this = shift; |
35
|
0
|
|
0
|
|
|
|
my $class = ref $this || $this; |
36
|
0
|
0
|
|
|
|
|
croak 'Net::ACL::Set objects cannot set!' |
37
|
|
|
|
|
|
|
if $class eq 'Net::ACL::Set'; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
croak "$class should reimplement the set method inhireted from Net::ACL::Set"; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub index |
43
|
|
|
|
|
|
|
{ |
44
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
45
|
0
|
0
|
|
|
|
|
$this->{_index} = @_ ? shift : $this->{_index}; |
46
|
0
|
|
|
|
|
|
return $this->{_index}; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
## POD ## |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=pod |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 NAME |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Net::ACL::Set - Abstract parent class of Set-classes |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 SYNOPSIS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
package Net::ACL::SetMyPackage; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
use Net::ACL::Set; |
62
|
|
|
|
|
|
|
@ISA = qw( Net::ACL::Set ); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub new { ... }; |
65
|
|
|
|
|
|
|
sub set { ... }; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
package main; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# Construction |
71
|
|
|
|
|
|
|
my $set = new Net::ACL::SetMyPackage($args); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Accessor Methods |
74
|
|
|
|
|
|
|
@data = $set->set(@data); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 DESCRIPTION |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This is an abstract parent class for all Net::ACL::Set* |
79
|
|
|
|
|
|
|
classes. It is used by the Net::ACL::Rule object. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
It only has a constructor new() and a method set(). Both should be |
82
|
|
|
|
|
|
|
replaced in any ancestor object. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=over 4 |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item 4 new() - Constructor of Net::ACL::Set* objects |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
my $set = new Net::ACL::SetMyPackage($args); |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This is the constructor for Net::ACL::Set::* objects. |
93
|
|
|
|
|
|
|
It returns a reference to the newly created object. |
94
|
|
|
|
|
|
|
It takes one argument, which should describe what to set. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=back |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 ACCESSOR METHODS |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=over 4 |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item set() |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
This function should modify the data given as arguments (one or more) with |
105
|
|
|
|
|
|
|
the data passed to the constructor and return the modified data. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=back |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 SEE ALSO |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Net::ACL::Rule, Net::ACL, |
112
|
|
|
|
|
|
|
Net::ACL::Set::Scalar, Net::ACL::Set::Union, Net::ACL::Set::Add |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 AUTHOR |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Martin Lorensen |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=cut |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
## End Package Net::ACL::Set ## |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
1; |