Merge pull request #224 from DOCGroup/jwillemsen-patch-1
[MPC.git] / modules / Depgen / ObjectGeneratorFactory.pm
blob6f2834a8525dce0a0f69d741f2846155f4f1b4af
1 package ObjectGeneratorFactory;
3 # ************************************************************
4 # Description : Create ObjectGenerator objects.
5 # Author : Chad Elliott
6 # Create Date : 5/23/2003
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use ObjectGenerator;
17 # ************************************************************
18 # Data Section
19 # ************************************************************
21 my $generators = {};
23 # ************************************************************
24 # Subroutine Section
25 # ************************************************************
27 sub register {
28 $generators = shift;
32 sub create {
33 return $$generators{$_[0]}->new() if (defined $$generators{$_[0]});
35 print STDERR "WARNING: Invalid object generator type: $_[0]\n";
36 return new ObjectGenerator();