summaryrefslogtreecommitdiff
path: root/ACE/MPC/modules/WorkspaceHelper.pm
diff options
context:
space:
mode:
authorAbdullah Sowayan <sowayan@users.noreply.github.com>2010-02-24 20:20:21 +0000
committerAbdullah Sowayan <sowayan@users.noreply.github.com>2010-02-24 20:20:21 +0000
commit035b47c1a6985e2b884182ab0f3bb1afa714a48f (patch)
tree48d75721f242b7a0eb4398a65b672a152bdaa37f /ACE/MPC/modules/WorkspaceHelper.pm
parenta3894e5127aa8cf1892e717ab30f02e053cdb482 (diff)
downloadATCD-035b47c1a6985e2b884182ab0f3bb1afa714a48f.tar.gz
Diffstat (limited to 'ACE/MPC/modules/WorkspaceHelper.pm')
-rw-r--r--ACE/MPC/modules/WorkspaceHelper.pm88
1 files changed, 88 insertions, 0 deletions
diff --git a/ACE/MPC/modules/WorkspaceHelper.pm b/ACE/MPC/modules/WorkspaceHelper.pm
new file mode 100644
index 00000000000..58ff37efdd5
--- /dev/null
+++ b/ACE/MPC/modules/WorkspaceHelper.pm
@@ -0,0 +1,88 @@
+package WorkspaceHelper;
+
+# ************************************************************
+# Description : Base class and factory for all workspace helpers
+# Author : Chad Elliott
+# Create Date : 9/01/2004
+# ************************************************************
+
+# ************************************************************
+# Pragmas
+# ************************************************************
+
+use strict;
+
+# ************************************************************
+# Data Section
+# ************************************************************
+
+my %required;
+
+# ************************************************************
+# Subroutine Section
+# ************************************************************
+
+sub get {
+ my $type = shift;
+
+ ## Create the helper name
+ $type =~ s/Creator/Helper/;
+ $type =~ s/=HASH.*//;
+
+ ## If we can find a helper with this name, we will
+ ## create a singleton of that type and return it.
+ if (!$required{$type}) {
+ foreach my $inc (@INC) {
+ if (-r "$inc/$type.pm") {
+ require "$type.pm";
+ $required{$type} = $type->new();
+ last;
+ }
+ }
+
+ ## If we can't find the helper, we just create an
+ ## empty helper and return that.
+ $required{$type} = new WorkspaceHelper() if (!$required{$type});
+ }
+
+ return $required{$type};
+}
+
+
+sub new {
+ my $class = shift;
+ return bless {}, $class;
+}
+
+
+sub modify_value {
+ my($self, $name, $value) = @_;
+ return $value;
+}
+
+
+sub modify_libpath {
+ #my $self = shift;
+ #my $str = shift;
+ #my $reldir = shift;
+ #my $libname = shift;
+ return undef;
+}
+
+
+sub write_settings {
+ #my $self = shift;
+ #my $fh = shift;
+ #my @locals = @_;
+ return 1, undef;
+}
+
+
+sub perform_custom_processing {
+ #my $self = shift;
+ #my $fh = shift;
+ #my $creator = shift;
+ #my $toplevel = shift;
+}
+
+1;