Commit | Line | Data |
2c70efe1 |
1 | package DBM::Deep::Sector; |
2 | |
3 | use 5.006_000; |
4 | |
5 | use strict; |
6 | use warnings FATAL => 'all'; |
7 | |
8 | use Scalar::Util (); |
9 | |
10 | sub new { |
11 | my $self = bless $_[1], $_[0]; |
12 | Scalar::Util::weaken( $self->{engine} ); |
13 | $self->_init; |
14 | return $self; |
15 | } |
16 | |
17 | sub _init {} |
417f635b |
18 | |
641aa32d |
19 | sub clone { |
20 | my $self = shift; |
21 | return ref($self)->new({ |
22 | engine => $self->engine, |
23 | type => $self->type, |
24 | data => $self->data, |
25 | }); |
26 | } |
27 | |
2c70efe1 |
28 | |
29 | sub engine { $_[0]{engine} } |
30 | sub offset { $_[0]{offset} } |
31 | sub type { $_[0]{type} } |
d3aaaf5e |
32 | sub staleness { $_[0]{staleness} } |
2c70efe1 |
33 | |
34 | sub load { die "load must be implemented in a child class" } |
35 | |
36 | 1; |
37 | __END__ |