ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ObjectUtilities/StorableObject.pm
Revision: 1.2
Committed: Thu Jan 20 18:26:06 2000 UTC (25 years, 3 months ago) by williamc
Content type: text/plain
Branch: MAIN
Changes since 1.1: +18 -0 lines
Log Message:
status work - Helsnki end

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 williamc 1.2 # meta() : return a descriptive string of the object
15     # store(location)
16     # restore(location)
17 williamc 1.1
18     package ObjectUtilities::StorableObject;
19     require 5.004;
20    
21     sub new {
22     my $class=shift;
23     my $Os=shift;
24     $self={};
25     bless $self, $class;
26     $self->{ObjectStore}=$Os;
27     $self->_init();
28     return $self;
29     }
30    
31     sub openfile {
32     my $self=shift;
33     my $filename=shift;
34    
35     local $fh=FileHandle->new();
36     open ( $fh, $filename) or die "Unable to open $filename\n $!\n";
37     return $fh;
38     }
39    
40     sub ObjectStore {
41     my $self=shift;
42     @_ ? $self->{ObjectStore}=shift
43     : $self->{ObjectStore};
44     }
45    
46     sub _init {
47     # dummy - override
48 williamc 1.2 }
49    
50     sub store {
51     print "Store Dummy not overridden"
52     }
53    
54     sub restore {
55     print "restore Dummy not overridden"
56     }
57    
58     sub meta {
59     my $self=shift;
60    
61     # by default just the class type
62     return ref($self);
63 williamc 1.1 }