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

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

Parent Directory Parent Directory | Revision Log Revision Log


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


1 jgs 121
2 ksteube 1312 /* $Id$ */
3 jgs 82
4 ksteube 1312 /*******************************************************
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 jgs 474 #include "DataEmpty.h"
17     #include "DataException.h"
18 jgs 82
19 jfenwick 1796
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 jgs 82 namespace escript {
38    
39     DataEmpty::DataEmpty() :
40 jfenwick 1796 DataAbstract(FunctionSpace(),DataTypes::scalarShape)
41 jgs 82 {
42 jfenwick 1796 // resetPointDataView();
43 jgs 82 }
44    
45 jgs 102 DataEmpty::~DataEmpty()
46     {
47 jgs 82 }
48    
49 jgs 102 std::string
50     DataEmpty::toString() const
51     {
52 jgs 121 return "(Empty Data)";
53 jgs 82 }
54    
55 jfenwick 1796 DataTypes::ValueType::size_type
56 jgs 102 DataEmpty::getPointOffset(int sampleNo,
57     int dataPointNo) const
58 jgs 82 {
59     throwStandardException("getPointOffset");
60     return 0;
61     }
62    
63 jfenwick 1796 // DataArrayView
64     // DataEmpty::getDataPoint(int sampleNo,
65     // int dataPointNo)
66     // {
67     // throwStandardException("getDataPoint");
68     // return getPointDataView();
69     // }
70 jgs 82
71 jfenwick 1796 DataTypes::ValueType::size_type
72 jgs 102 DataEmpty::getLength() const
73 jgs 82 {
74     return 0;
75     }
76    
77 jgs 102 DataAbstract*
78 jfenwick 1796 DataEmpty::getSlice(const DataTypes::RegionType& region) const
79 jgs 82 {
80     throwStandardException("getSlice");
81     return 0;
82     }
83    
84 jgs 102 void
85     DataEmpty::setSlice(const DataAbstract* value,
86 jfenwick 1796 const DataTypes::RegionType& region)
87 jgs 82 {
88     throwStandardException("setSlice");
89     }
90    
91 jfenwick 1796
92    
93     DataTypes::ValueType&
94     DataEmpty::getVector()
95 jgs 121 {
96 jfenwick 1796 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
97     return dummy; // dead code to stop the compiler complaining
98 jgs 121 }
99    
100 jfenwick 1796 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 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