summaryrefslogtreecommitdiff
path: root/ACE/MPC/modules/Depgen/DependencyWriterFactory.pm
blob: 558793ea0a53c4ed87368e75252991c589b4d76f (plain)
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
package DependencyWriterFactory;

# ************************************************************
# Description   : Create DependencyWriter objects.
# Author        : Chad Elliott
# Create Date   : 5/23/2003
# ************************************************************

# ************************************************************
# Pragmas
# ************************************************************

use strict;

use DependencyWriter;

# ************************************************************
# Data Section
# ************************************************************

my $writers = {};

# ************************************************************
# Subroutine Section
# ************************************************************

sub register {
  $writers = shift;
}


sub create {
  return $$writers{$_[0]}->new() if (defined $$writers{$_[0]});

  print STDERR "WARNING: Invalid dependency writer type: $_[0]\n";
  return new DependencyWriter();
}


1;