00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00015 #include <iostream>
00016 #include <stxxl/mng>
00017 #include <stxxl/bits/mng/prefetch_pool.h>
00018
00019 #define BLOCK_SIZE (1024 * 512)
00020
00021 struct MyType
00022 {
00023 int integer;
00024 char chars[5];
00025 };
00026
00027 typedef stxxl::typed_block<BLOCK_SIZE, MyType> block_type;
00028
00029 int main()
00030 {
00031 stxxl::prefetch_pool<block_type> pool(2);
00032 pool.resize(10);
00033 pool.resize(5);
00034 block_type * blk = new block_type;
00035 block_type::bid_type bid;
00036 stxxl::block_manager::get_instance()->new_blocks(stxxl::single_disk(), &bid, (&bid) + 1);
00037 pool.hint(bid);
00038 pool.read(blk, bid)->wait();
00039 delete blk;
00040 }