1 | package AbstractPlugin;
|
---|
2 |
|
---|
3 | use PrintInfo;
|
---|
4 |
|
---|
5 | use strict;
|
---|
6 | no strict 'subs';
|
---|
7 |
|
---|
8 | sub BEGIN {
|
---|
9 | @AbstractPlugin::ISA = ( 'PrintInfo' );
|
---|
10 | }
|
---|
11 |
|
---|
12 | my $arguments = [];
|
---|
13 |
|
---|
14 |
|
---|
15 | my $options = { 'name' => "AbstractPlugin",
|
---|
16 | 'desc' => "{AbstractPlugin.desc}",
|
---|
17 | 'abstract' => "yes",
|
---|
18 | 'inherits' => "yes",
|
---|
19 | 'args' => $arguments };
|
---|
20 |
|
---|
21 |
|
---|
22 | sub new
|
---|
23 | {
|
---|
24 | my $class = shift (@_);
|
---|
25 | my ($pluginlist,$inputargs,$hashArgOptLists) = @_;
|
---|
26 | my $plugin_name = (defined $pluginlist->[0]) ? $pluginlist->[0] : $class;
|
---|
27 |
|
---|
28 | if ($plugin_name eq $class) {
|
---|
29 | push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
|
---|
30 | push(@{$hashArgOptLists->{"OptList"}},$options);
|
---|
31 | }
|
---|
32 |
|
---|
33 | my $self = new PrintInfo($pluginlist, $inputargs, $hashArgOptLists);
|
---|
34 |
|
---|
35 |
|
---|
36 | $self->{'num_processed'} = 0;
|
---|
37 | $self->{'num_not_processed'} = 0;
|
---|
38 | $self->{'num_blocked'} = 0;
|
---|
39 | $self->{'num_archives'} = 0;
|
---|
40 |
|
---|
41 | return bless $self, $class;
|
---|
42 | }
|
---|
43 |
|
---|
44 |
|
---|
45 | # here are some more methods which we want at a lower level that BasePlugin.
|
---|
46 | # but should we have a new class for these?
|
---|
47 | # Rec and Arc plugs use these
|
---|
48 | sub set_incremental {
|
---|
49 | my $self = shift(@_);
|
---|
50 | my ($incremental) = @_;
|
---|
51 |
|
---|
52 | $self->{'incremental'} = $incremental;
|
---|
53 | }
|
---|
54 |
|
---|
55 | sub init {
|
---|
56 | my $self = shift (@_);
|
---|
57 | my ($verbosity, $outhandle, $failhandle) = @_;
|
---|
58 |
|
---|
59 | # verbosity is passed through from the processor
|
---|
60 | $self->{'verbosity'} = $verbosity;
|
---|
61 |
|
---|
62 | # as are the outhandle and failhandle
|
---|
63 | $self->{'outhandle'} = $outhandle if defined $outhandle;
|
---|
64 | $self->{'failhandle'} = $failhandle;
|
---|
65 |
|
---|
66 | }
|
---|
67 |
|
---|
68 | sub begin {
|
---|
69 |
|
---|
70 | }
|
---|
71 |
|
---|
72 | sub end {
|
---|
73 |
|
---|
74 | }
|
---|
75 |
|
---|
76 | sub deinit {
|
---|
77 |
|
---|
78 | }
|
---|
79 |
|
---|
80 | sub compile_stats {
|
---|
81 |
|
---|
82 | }
|
---|
83 |
|
---|
84 | sub metadata_read {
|
---|
85 | return undef;
|
---|
86 | }
|
---|
87 |
|
---|