1 |
//$Id$ |
2 |
/* |
3 |
****************************************************************************** |
4 |
* * |
5 |
* COPYRIGHT ACcESS 2004 - All Rights Reserved * |
6 |
* * |
7 |
* This software is the property of ACcESS. No part of this code * |
8 |
* may be copied in any form or by any means without the expressed written * |
9 |
* consent of ACcESS. Copying, use or modification of this software * |
10 |
* by any unauthorised person is illegal unless that person has a software * |
11 |
* license agreement with ACcESS. * |
12 |
* * |
13 |
****************************************************************************** |
14 |
*/ |
15 |
|
16 |
#include "DataCached.h" |
17 |
#include "DataException.h" |
18 |
|
19 |
namespace escript { |
20 |
|
21 |
DataCached::DataCached() : |
22 |
DataAbstract(FunctionSpace()) |
23 |
{ |
24 |
resetPointDataView(); |
25 |
} |
26 |
|
27 |
DataCached::~DataCached() |
28 |
{ |
29 |
} |
30 |
|
31 |
std::string |
32 |
DataCached::toString() const |
33 |
{ |
34 |
return "(Cached Data)"; |
35 |
} |
36 |
|
37 |
DataArrayView::ValueType::size_type |
38 |
DataCached::getPointOffset(int sampleNo, |
39 |
int dataPointNo) const |
40 |
{ |
41 |
throwStandardException("getPointOffset"); |
42 |
return 0; |
43 |
} |
44 |
|
45 |
DataArrayView |
46 |
DataCached::getDataPoint(int sampleNo, |
47 |
int dataPointNo) |
48 |
{ |
49 |
throwStandardException("getDataPoint"); |
50 |
return getPointDataView(); |
51 |
} |
52 |
|
53 |
DataArrayView::ValueType::size_type |
54 |
DataCached::getLength() const |
55 |
{ |
56 |
return 0; |
57 |
} |
58 |
|
59 |
DataAbstract* |
60 |
DataCached::getSlice(const DataArrayView::RegionType& region) const |
61 |
{ |
62 |
throwStandardException("getSlice"); |
63 |
return 0; |
64 |
} |
65 |
|
66 |
void |
67 |
DataCached::setSlice(const DataAbstract* value, |
68 |
const DataArrayView::RegionType& region) |
69 |
{ |
70 |
throwStandardException("setSlice"); |
71 |
} |
72 |
|
73 |
void |
74 |
DataCached::reshapeDataPoint(const DataArrayView::ShapeType& shape) |
75 |
{ |
76 |
throwStandardException("reshapeDataPoint"); |
77 |
} |
78 |
|
79 |
void |
80 |
DataCached::throwStandardException(const std::string& functionName) const |
81 |
{ |
82 |
throw DataException("Error - "+functionName+" function call invalid for DataCached."); |
83 |
} |
84 |
|
85 |
} // end of namespace |