ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ObjectUtilities/StorableObject.pm
Revision: 1.1
Committed: Fri Dec 17 10:55:21 1999 UTC (25 years, 4 months ago) by williamc
Content type: text/plain
Branch: MAIN
Log Message:
working

File Contents

# User Rev Content
1 williamc 1.1 #
2     # StorableObject.pm
3     #
4     # Originally Written by Christopher Williams
5     #
6     # Description
7     #
8     # Interface
9     # ---------
10     # new(ObjectStore) : A new object
11     # openfile(filename) : return a filhandle object opened on the file filename
12     # ObjectStore() : Get/Set ObjectStore object
13     # sequencenumber() : return the sequence number
14    
15     package ObjectUtilities::StorableObject;
16     require 5.004;
17    
18     sub new {
19     my $class=shift;
20     my $Os=shift;
21     $self={};
22     bless $self, $class;
23     $self->{ObjectStore}=$Os;
24     $self->_init();
25     return $self;
26     }
27    
28     sub openfile {
29     my $self=shift;
30     my $filename=shift;
31    
32     local $fh=FileHandle->new();
33     open ( $fh, $filename) or die "Unable to open $filename\n $!\n";
34     return $fh;
35     }
36    
37     sub ObjectStore {
38     my $self=shift;
39     @_ ? $self->{ObjectStore}=shift
40     : $self->{ObjectStore};
41     }
42    
43     sub _init {
44     # dummy - override
45     }