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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1811 - (hide annotations)
Thu Sep 25 23:11:13 2008 UTC (10 years, 7 months ago) by ksteube
File size: 2104 byte(s)
Copyright updated in all files

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 1803 DataAbstract(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 jgs 102 DataEmpty::getLength() const
69 jgs 82 {
70     return 0;
71     }
72    
73 jgs 102 DataAbstract*
74 jfenwick 1796 DataEmpty::getSlice(const DataTypes::RegionType& region) const
75 jgs 82 {
76     throwStandardException("getSlice");
77     return 0;
78     }
79    
80 jgs 102 void
81     DataEmpty::setSlice(const DataAbstract* value,
82 jfenwick 1796 const DataTypes::RegionType& region)
83 jgs 82 {
84     throwStandardException("setSlice");
85     }
86    
87 jfenwick 1796
88    
89     DataTypes::ValueType&
90     DataEmpty::getVector()
91 jgs 121 {
92 jfenwick 1796 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
93     return dummy; // dead code to stop the compiler complaining
94 jgs 121 }
95    
96 jfenwick 1796 const DataTypes::ValueType&
97     DataEmpty::getVector() const
98     {
99     throwStandardException("getVector"); // always throws but the compiler doesn't know that.
100     return dummy; // dead code to stop the compiler complaining
101     }
102    
103    
104 jfenwick 1803 void
105     DataEmpty::dump(const std::string fileName) const
106     {
107     throw DataException("Error - Cannot dump() a DataEmpty object.");
108     }
109 jfenwick 1796
110 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