/[escript]/trunk/escript/src/DataEmpty.cpp
ViewVC logotype

Annotation of /trunk/escript/src/DataEmpty.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2005 - (hide annotations)
Mon Nov 10 01:21:39 2008 UTC (10 years, 11 months ago) by jfenwick
File size: 2274 byte(s)
Bringing all changes across from schroedinger.
(Note this does not mean development is done, just that it will happen
on the trunk for now).
If anyone notices any problems please contact me.


1 jgs 121
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
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 ksteube 1312
14 ksteube 1811
15 jgs 474 #include "DataEmpty.h"
16     #include "DataException.h"
17 jgs 82
18 jfenwick 1796
19     namespace {
20    
21    
22 jfenwick 1803 inline
23     void
24     throwStandardException(const std::string& functionName)
25     {
26     throw escript::DataException("Error - "+functionName+" function call invalid for DataEmpty.");
27     }
28 jfenwick 1796
29    
30 jfenwick 1803 escript::DataTypes::ValueType dummy;
31 jfenwick 1796
32     }
33    
34 jgs 82 namespace escript {
35    
36     DataEmpty::DataEmpty() :
37 jfenwick 2005 parent(FunctionSpace(),DataTypes::scalarShape, true)
38 jgs 82 {
39 jfenwick 1803
40 jgs 82 }
41    
42 jgs 102 DataEmpty::~DataEmpty()
43     {
44 jgs 82 }
45    
46 jgs 102 std::string
47     DataEmpty::toString() const
48     {
49 jgs 121 return "(Empty Data)";
50 jgs 82 }
51    
52 jfenwick 1799
53     DataAbstract*
54     DataEmpty::deepCopy()
55     {
56     return new DataEmpty();
57     }
58    
59 jfenwick 1796 DataTypes::ValueType::size_type
60 jgs 102 DataEmpty::getPointOffset(int sampleNo,
61     int dataPointNo) const
62 jgs 82 {
63     throwStandardException("getPointOffset");
64     return 0;
65     }
66    
67 jfenwick 1796 DataTypes::ValueType::size_type
68 jfenwick 2005 DataEmpty::getPointOffset(int sampleNo,
69     int dataPointNo)
70     {
71     throwStandardException("getPointOffset");
72     return 0;
73     }
74    
75     DataTypes::ValueType::size_type
76 jgs 102 DataEmpty::getLength() const
77 jgs 82 {
78     return 0;
79     }
80    
81 jgs 102 DataAbstract*
82 jfenwick 1796 DataEmpty::getSlice(const DataTypes::RegionType& region) const
83 jgs 82 {
84     throwStandardException("getSlice");
85     return 0;
86     }
87    
88 jgs 102 void
89     DataEmpty::setSlice(const DataAbstract* value,
90 jfenwick 1796 const DataTypes::RegionType& region)
91 jgs 82 {
92     throwStandardException("setSlice");
93     }
94    
95 jfenwick 1796
96    
97     DataTypes::ValueType&
98     DataEmpty::getVector()
99 jgs 121 {
100 jfenwick 1796 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
101     return dummy; // dead code to stop the compiler complaining
102 jgs 121 }
103    
104 jfenwick 1796 const DataTypes::ValueType&
105     DataEmpty::getVector() 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 jfenwick 1803 void
113     DataEmpty::dump(const std::string fileName) const
114     {
115     throw DataException("Error - Cannot dump() a DataEmpty object.");
116     }
117 jfenwick 1796
118 jgs 82 } // end of namespace

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26