summaryrefslogtreecommitdiff
path: root/ACE/MPC/modules/Depgen/DependencyWriterFactory.pm
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/MPC/modules/Depgen/DependencyWriterFactory.pm')
-rw-r--r--ACE/MPC/modules/Depgen/DependencyWriterFactory.pm40
1 files changed, 40 insertions, 0 deletions
diff --git a/ACE/MPC/modules/Depgen/DependencyWriterFactory.pm b/ACE/MPC/modules/Depgen/DependencyWriterFactory.pm
new file mode 100644
index 00000000000..558793ea0a5
--- /dev/null
+++ b/ACE/MPC/modules/Depgen/DependencyWriterFactory.pm
@@ -0,0 +1,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;