Escript
Revision_4320
Main Page
Namespaces
Classes
Files
File List
File Members
escript
src
DataReady.h
Go to the documentation of this file.
1
2
/*****************************************************************************
3
*
4
* Copyright (c) 2003-2013 by University of Queensland
5
* http://www.uq.edu.au
6
*
7
* Primary Business: Queensland, Australia
8
* Licensed under the Open Software License version 3.0
9
* http://www.opensource.org/licenses/osl-3.0.php
10
*
11
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12
* Development since 2012 by School of Earth Sciences
13
*
14
*****************************************************************************/
15
16
17
#if !defined escript_DataReady_20081008_H
18
#define escript_DataReady_20081008_H
19
#include "
system_dep.h
"
20
21
#include "
DataAbstract.h
"
22
23
namespace
escript {
24
25
// Anything which requires getVector should be moved down here
26
27
28
34
class
DataReady
:
public
DataAbstract
35
{
36
typedef
DataAbstract
parent
;
37
public
:
38
DataReady
(
const
FunctionSpace
& what,
const
ShapeType
& shape,
bool
isDataEmpty=
false
);
39
~DataReady
(){};
40
41
42
47
ESCRIPT_DLL_API
48
double
*
49
getSampleDataRW
(
ValueType::size_type
sampleNo);
50
51
ESCRIPT_DLL_API
52
const
double
*
53
getSampleDataRO
(
ValueType::size_type
sampleNo)
const
;
54
59
ESCRIPT_DLL_API
60
virtual
DataTypes::ValueType
&
61
getVectorRW
()=0;
62
63
64
ESCRIPT_DLL_API
65
virtual
const
DataTypes::ValueType
&
66
getVectorRO
()
const
=0;
67
73
ESCRIPT_DLL_API
74
virtual
bool
75
hasNaN
()
const
=0;
76
84
ESCRIPT_DLL_API
85
virtual
86
void
87
setSlice
(
const
DataAbstract
* value,
88
const
DataTypes::RegionType
& region) = 0;
89
90
94
ESCRIPT_DLL_API
95
DataTypes::ValueType::const_reference
96
getDataAtOffsetRO
(
DataTypes::ValueType::size_type
i)
const
;
97
98
99
ESCRIPT_DLL_API
100
DataTypes::ValueType::reference
101
getDataAtOffsetRW
(
DataTypes::ValueType::size_type
i);
102
103
ESCRIPT_DLL_API
104
DataReady_ptr
105
resolve
();
106
107
};
108
109
110
inline
111
DataAbstract::ValueType::value_type
*
112
DataReady::getSampleDataRW
(
ValueType::size_type
sampleNo)
113
{
114
return
&(
getVectorRW
()[
getPointOffset
(sampleNo,0)]);
// exclusive write checks will be done in getVectorRW()
115
}
116
117
inline
const
double
*
118
DataReady::getSampleDataRO
(
ValueType::size_type
sampleNo)
const
119
{
120
return
&(
getVectorRO
()[
getPointOffset
(sampleNo,0)]);
121
}
122
123
124
inline
125
DataTypes::ValueType::const_reference
126
DataReady::getDataAtOffsetRO
(
DataTypes::ValueType::size_type
i)
const
127
{
128
return
getVectorRO
()[i];
129
}
130
131
inline
132
DataTypes::ValueType::reference
133
DataReady::getDataAtOffsetRW
(
DataTypes::ValueType::size_type
i)
// exclusive write checks will be done in getVectorRW()
134
{
135
return
getVectorRW
()[i];
136
}
137
138
139
140
}
141
142
#endif
Generated on Fri Mar 15 2013 14:07:50 for Escript by
1.8.1.2