stxxl::STACK_GENERATOR
class to generate an external stack type with stxxl::grow_shrink_stack
implementation, four blocks per page, block size 4096 bytes
00001 /*************************************************************************** 00002 * containers/test_many_stacks.cpp 00003 * 00004 * Part of the STXXL. See http://stxxl.sourceforge.net 00005 * 00006 * Copyright (C) 2003 Roman Dementiev <dementiev@mpi-sb.mpg.de> 00007 * 00008 * Distributed under the Boost Software License, Version 1.0. 00009 * (See accompanying file LICENSE_1_0.txt or copy at 00010 * http://www.boost.org/LICENSE_1_0.txt) 00011 **************************************************************************/ 00012 00018 00019 00020 #include <stxxl/stack> 00021 00022 00023 int main(int argc, char * argv[]) 00024 { 00025 typedef stxxl::STACK_GENERATOR<int, stxxl::external, stxxl::normal, 4, 4096>::result ext_stack_type; 00026 00027 if (argc < 2) 00028 { 00029 STXXL_MSG("Usage: " << argv[0] << " number_of_stacks"); 00030 return -1; 00031 } 00032 00033 char dum; 00034 STXXL_MSG("Enter a symbol:"); 00035 std::cin >> dum; 00036 00037 ext_stack_type * my_stacks = new ext_stack_type[atoi(argv[1])]; 00038 00039 STXXL_MSG("Enter a symbol:"); 00040 std::cin >> dum; 00041 00042 delete[] my_stacks; 00043 00044 STXXL_MSG("Enter a symbol:"); 00045 std::cin >> dum; 00046 00047 return 0; 00048 }