TPIE

2362a60
block.h
1 // -*- mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup"; -*-
2 // vi:set ts=4 sts=4 sw=4 noet cino+=(0 :
3 // Copyright 2014, The TPIE development team
4 //
5 // This file is part of TPIE.
6 //
7 // TPIE is free software: you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the
9 // Free Software Foundation, either version 3 of the License, or (at your
10 // option) any later version.
11 //
12 // TPIE is distributed in the hope that it will be useful, but WITHOUT ANY
13 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with TPIE. If not, see <http://www.gnu.org/licenses/>
19 
20 #ifndef _TPIE_BLOCKS_BLOCK_H
21 #define _TPIE_BLOCKS_BLOCK_H
22 
23 #include <tpie/tpie.h>
24 #include <tpie/array.h>
25 
26 namespace tpie {
27 
28 namespace blocks {
29 
30 typedef array<char> block;
31 
32 struct block_handle {
33  block_handle() : position(0), size(0) {}
34  block_handle(stream_size_type position, memory_size_type size) : position(position), size(size) {}
35 
36  stream_size_type position;
37  memory_size_type size;
38 
39  bool operator==(const block_handle & other) const {
40  return position == other.position && size == other.size;
41  }
42 };
43 
44 } // blocks namespace
45 
46 } // tpie namespace
47 
48 #endif // _TPIE_BLOCKS_BLOCK_H
tpie_init and tpie_finish.
Generic internal array with known memory requirements.