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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26