/[escript]/branches/numpy/escript/src/DataEmpty.cpp
ViewVC logotype

Contents of /branches/numpy/escript/src/DataEmpty.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2396 - (show annotations)
Thu Apr 23 23:58:29 2009 UTC (10 years ago) by jfenwick
File size: 2278 byte(s)
Branching to port escript to use numpy rather than numarray

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 #include "DataEmpty.h"
16 #include "DataException.h"
17
18
19 namespace {
20
21
22 inline
23 void
24 throwStandardException(const std::string& functionName)
25 {
26 throw escript::DataException("Error - "+functionName+" function call invalid for DataEmpty.");
27 }
28
29
30 escript::DataTypes::ValueType dummy;
31
32 }
33
34 namespace escript {
35
36 DataEmpty::DataEmpty() :
37 parent(FunctionSpace(),DataTypes::scalarShape, true)
38 {
39
40 }
41
42 DataEmpty::~DataEmpty()
43 {
44 }
45
46 std::string
47 DataEmpty::toString() const
48 {
49 return "(Empty Data)";
50 }
51
52
53 DataAbstract*
54 DataEmpty::deepCopy()
55 {
56 return new DataEmpty();
57 }
58
59 DataTypes::ValueType::size_type
60 DataEmpty::getPointOffset(int sampleNo,
61 int dataPointNo) const
62 {
63 throwStandardException("getPointOffset");
64 return 0;
65 }
66
67 DataTypes::ValueType::size_type
68 DataEmpty::getPointOffset(int sampleNo,
69 int dataPointNo)
70 {
71 throwStandardException("getPointOffset");
72 return 0;
73 }
74
75 DataTypes::ValueType::size_type
76 DataEmpty::getLength() const
77 {
78 return 0;
79 }
80
81 DataAbstract*
82 DataEmpty::getSlice(const DataTypes::RegionType& region) const
83 {
84 throwStandardException("getSlice");
85 return 0;
86 }
87
88 void
89 DataEmpty::setSlice(const DataAbstract* value,
90 const DataTypes::RegionType& region)
91 {
92 throwStandardException("setSlice");
93 }
94
95
96
97 DataTypes::ValueType&
98 DataEmpty::getVectorRW()
99 {
100 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
101 return dummy; // dead code to stop the compiler complaining
102 }
103
104 const DataTypes::ValueType&
105 DataEmpty::getVectorRO() const
106 {
107 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
108 return dummy; // dead code to stop the compiler complaining
109 }
110
111
112 void
113 DataEmpty::dump(const std::string fileName) const
114 {
115 throw DataException("Error - Cannot dump() a DataEmpty object.");
116 }
117
118 } // end of namespace

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26