escript  Revision_4925
DataEmpty.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 
18 #if !defined escript_DataEmpty_20040726_H
19 #define escript_DataEmpty_20040726_H
20 #include "system_dep.h"
21 
22 #include "DataReady.h"
23 
24 namespace escript {
25 
34 class DataEmpty : public DataReady {
35 typedef DataReady parent;
36  public:
37 
47  DataEmpty();
48 
54  virtual
55  ~DataEmpty();
56 
62  virtual
63  std::string
64  toString() const;
65 
70  virtual
72  deepCopy();
73 
74 
84  virtual
86  getPointOffset(int sampleNo,
87  int dataPointNo) const;
88 
90  virtual
92  getPointOffset(int sampleNo,
93  int dataPointNo);
94 
101  virtual
103  getLength() const;
104 
113  virtual
114  DataAbstract*
115  getSlice(const DataTypes::RegionType& region) const;
116 
127  virtual
128  void
129  setSlice(const DataAbstract* value,
130  const DataTypes::RegionType& region);
131 
138  int
139  matrixInverse(DataAbstract* out) const;
140 
141  void
142  dump(const std::string fileName) const;
143 
145  bool
146  hasNaN() const
147  {
148  return false;
149  }
150  protected:
151 
156  virtual DataTypes::ValueType&
157  getVectorRW();
158 
159 
161  virtual const DataTypes::ValueType&
162  getVectorRO() const;
163 
164 
165  private:
166 
167 // /**
168 /* \brief
169  Throw a standard exception. This function is called if an attempt
170  is made to use functions of DataEmpty that are not valid.*/
171 // */
172 // void
173 // throwStandardException(const std::string& functionName) const;
174 
175 };
176 
177 } // end of namespace
178 
179 #endif
DataVector implements an arbitrarily long vector of data values. DataVector is the underlying data co...
Definition: DataVector.h:44
virtual void setSlice(const DataAbstract *value, const DataTypes::RegionType &region)
Set the current Data object according to the specified slice from the given input value...
Definition: DataEmpty.cpp:92
virtual DataAbstract * getSlice(const DataTypes::RegionType &region) const
Factory method that returns a newly created DataEmpty sliced from the current Data object according t...
Definition: DataEmpty.cpp:85
Definition: DataReady.h:35
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:39
virtual std::string toString() const
Return a textual representation of the Data object.
Definition: DataEmpty.cpp:50
Implements the DataAbstract interface for an empty Data object.
Definition: DataEmpty.h:34
virtual DataAbstract * deepCopy()
Return a deep copy of the current object.
Definition: DataEmpty.cpp:57
virtual const DataTypes::ValueType & getVectorRO() const
Definition: DataEmpty.cpp:114
int matrixInverse(DataAbstract *out) const
invert square matricies
Definition: DataEmpty.cpp:99
virtual ~DataEmpty()
Destructor for DataEmpty.
Definition: DataEmpty.cpp:45
virtual ValueType::size_type getLength() const
Return the number of doubles stored for the Data object. As this is an empty Data object...
Definition: DataEmpty.cpp:79
bool hasNaN() const
return true if data contains NaN.
Definition: DataEmpty.h:146
virtual DataTypes::ValueType & getVectorRW()
Provide access to underlying storage. Internal use only!
Definition: DataEmpty.cpp:107
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:64
virtual DataTypes::ValueType::size_type getPointOffset(int sampleNo, int dataPointNo) const
Return the offset for the given sample. NB: This will throw an exception as obviously an empty Data o...
Definition: DataEmpty.cpp:63
Definition: DataAbstract.h:61
DataReady parent
Definition: DataEmpty.h:35
long size_type
Definition: DataVector.h:60
void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: DataEmpty.cpp:122
DataEmpty()
Default constructor for DataEmpty.
Definition: DataEmpty.cpp:39