ESyS-Particle
2.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
nt_block.h
Go to the documentation of this file.
1
2
// //
3
// Copyright (c) 2003-2013 by The University of Queensland //
4
// Earth Systems Science Computational Centre (ESSCC) //
5
// http://www.uq.edu.au/esscc //
6
// //
7
// Primary Business: Brisbane, Queensland, Australia //
8
// Licensed under the Open Software License version 3.0 //
9
// http://www.opensource.org/licenses/osl-3.0.php //
10
// //
12
13
#ifndef __NT_BLOCK_H
14
#define __NT_BLOCK_H
15
16
//--- project includes ---
17
#include "
ntable/src/ntb_iter.h
"
18
#include "
ntable/src/ntable.h
"
19
20
//--- forward decls ---
21
template
<
typename
T>
22
class
NTBlock
;
23
24
template
<
typename
T>
bool
operator==
(
const
NTBlock<T>
&,
const
NTBlock<T>
&);
25
template
<
typename
T>
bool
operator!=
(
const
NTBlock<T>
&,
const
NTBlock<T>
&);
26
template
<
typename
T> ostream& operator<<(ostream &, const NTBlock<T>&);
31
template
<
typename
T>
32
class
NTBlock
33
{
34
public
:
// types
35
typedef
NTBlock_iter<T>
iterator
;
36
typedef
NTBlock_iter<T>
const_iterator
;
// dodgy
37
typedef
T
value_type
;
38
39
private
:
40
NeighborTable<T>
*
m_table
;
41
int
m_xmin
,
m_xmax
,
m_ymin
,
m_ymax
,
m_zmin
,
m_zmax
;
42
43
public
:
44
NTBlock
();
45
NTBlock
(
NeighborTable<T>
*,
int
,
int
,
int
,
int
,
int
,
int
);
46
47
unsigned
int
size
();
48
49
// begin and end iterators
50
iterator
begin
();
51
iterator
end
();
52
53
/* iterator rbegin(); */
54
/* iterator rend(); */
55
57
unsigned
int
nparts_at_gridpoint
(
int
x,
int
y,
int
z)
const
{
return
m_table
->nparts_at_gridpoint(
m_table
->index(x,y,z));};
58
59
// access ops
60
T*
ptr
(
int
,
int
,
int
,
int
);
61
T&
ref
(
int
,
int
,
int
,
int
);
62
63
//comparison
64
friend
bool
operator== <>(
const
NTBlock
&,
const
NTBlock
&);
65
friend
bool
operator!= <>(
const
NTBlock
&,
const
NTBlock
&);
66
67
friend
ostream& operator<< <>(ostream &,
const
NTBlock
&);
68
69
friend
class
NTBlock_iter
<T>;
70
};
71
72
#include "
ntable/src/nt_block.hpp
"
73
74
#endif //__NT_BLOCK_H
ntable
src
nt_block.h
Generated on Mon May 6 2013 23:26:30 for ESyS-Particle by
1.8.3.1