ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/BuildClass.pm
Revision: 1.3
Committed: Fri Dec 10 14:05:52 2004 UTC (20 years, 5 months ago) by sashby
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -0 lines
State: FILE REMOVED
Error occurred while calculating annotation data.
Log Message:
*** empty log message ***

File Contents

# Content
1 #
2 # BuildClass.pm
3 #
4 # Originally Written by Christopher Williams
5 #
6 # Description
7 #
8 # Interface
9 # ---------
10 # new() : A new BuildClass object
11 # child() : return a new object that is a copy of the object
12 # paramupdate($hashref) : update variable hash according to provided hashref
13 # paramlist() : return a list of all params that have been set
14 # param(name) : return value of given param - undef if undefined
15
16 package BuildSystem::BuildClass;
17 require 5.004;
18
19 sub new {
20 my $class=shift;
21 my $type=ref($class) || $class;
22 my $self={};
23 bless $self, $type;
24 return $self;
25 }
26
27 sub child {
28 my $self=shift;
29 my $child=$self->new();
30 $child->paramupdate($self->{vars});
31 return $child;
32 }
33
34 sub paramlist {
35 my $self=shift;
36 return (keys %{$self->{vars}});
37 }
38
39 sub param {
40 my $self=shift;
41 my $name=shift;
42
43 my $rv=undef;
44 if ( exists $self->{vars}{$name} ) {
45 $rv=$self->{vars}{$name};
46 }
47 return $rv;
48 }
49
50 sub paramupdate {
51 my $self=shift;
52 my $hashref=shift;
53
54 foreach $key ( keys %$hashref ) {
55 $self->{vars}{$key}=$$hashref{$key};
56 }
57 }