Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 154

Show
Ignore:
Timestamp:
06/10/06 20:10:45 (2 years ago)
Author:
kris
Message:

removed superfluous IBitBucket interface

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/example/FileBucket.d

    r131 r154  
    55private import  tango.io.Exception, 
    66                tango.io.FileConduit; 
    7  
    8 private import  tango.io.model.IBitBucket; 
    97 
    108/****************************************************************************** 
     
    2927        is a contrived example: 
    3028         
    31         @code 
     29        --- 
    3230        char[] text = "this is a test"; 
    3331 
    34         FileBucket bucket = new FileBucket (new FilePath("bucket.bin"), FileBucket.HalfK); 
     32        auto bucket = new FileBucket (new FilePath("bucket.bin"), FileBucket.HalfK); 
    3533 
    3634        // insert some data, and retrieve it again 
     
    3937 
    4038        assert (b == text); 
    41         bucket.close()
    42         @endcode 
     39        bucket.close
     40        --- 
    4341 
    4442******************************************************************************/ 
    4543 
    46 class FileBucket : IBitBucket 
     44class FileBucket 
    4745{ 
    4846        /********************************************************************** 
     
    7674 
    7775        // supported block sizes 
    78         static const BlockSize          EighthK  = {128-1}, 
     76        public static const BlockSize   EighthK  = {128-1}, 
    7977                                        HalfK    = {512-1}, 
    8078                                        OneK     = {1024*1-1}, 
     
    8684                                        SixtyFourK = {1024*64-1}; 
    8785 
     86 
     87        /********************************************************************** 
     88 
     89                Construct a FileBucket with the provided path and record- 
     90                size. Selecting a record size that roughly matches the  
     91                serialized content will limit 'thrashing'. 
     92 
     93        **********************************************************************/ 
     94 
     95        this (char[] path, BlockSize block) 
     96        { 
     97                this (new FilePath(path), block); 
     98        } 
     99 
    88100        /********************************************************************** 
    89101 
     
    206218                if (r is null) 
    207219                   { 
    208                    Record rr = new Record ()
     220                   auto rr = new Record
    209221                   map [key] =  rr; 
    210222                   r = &rr; 
     
    239251        **********************************************************************/ 
    240252 
    241         private class Record 
     253        private static class Record 
    242254        { 
    243255                private ulong           offset;