Refactored Sector:: out from under Engine:: and into its own area
[dbsrgits/DBM-Deep.git] / lib / DBM / Deep / Sector / File / Data.pm
diff --git a/lib/DBM/Deep/Sector/File/Data.pm b/lib/DBM/Deep/Sector/File/Data.pm
new file mode 100644 (file)
index 0000000..fa9b43f
--- /dev/null
@@ -0,0 +1,24 @@
+package DBM::Deep::Sector::File::Data;
+
+use 5.006_000;
+
+use strict;
+use warnings FATAL => 'all';
+
+use base qw( DBM::Deep::Sector::File );
+
+# This is in bytes
+sub size { $_[0]{engine}->data_sector_size }
+sub free_meth { return '_add_free_data_sector' }
+
+sub clone {
+    my $self = shift;
+    return ref($self)->new({
+        engine => $self->engine,
+        type   => $self->type,
+        data   => $self->data,
+    });
+}
+
+1;
+__END__