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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1796 - (show annotations)
Wed Sep 17 01:45:46 2008 UTC (10 years, 7 months ago) by jfenwick
File size: 2270 byte(s)
Merged noarrayview branch onto trunk.


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26