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

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

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 MIME type: text/plain
File size: 3967 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 #if !defined escript_DataEmpty_20040726_H
16 #define escript_DataEmpty_20040726_H
17 #include "system_dep.h"
18
19 #include "DataAbstract.h"
20
21 namespace escript {
22
23 /**
24 \brief
25 Implements the DataAbstract interface for an empty Data object.
26
27 Description:
28 Implements the DataAbstract interface for an empty Data object.
29 */
30
31 class DataEmpty : public DataAbstract {
32
33 public:
34
35 /**
36 \brief
37 Default constructor for DataEmpty.
38
39 Description:
40 Default constructor for DataEmpty.
41
42 */
43 ESCRIPT_DLL_API
44 DataEmpty();
45
46 /**
47 \brief
48 Destructor for DataEmpty.
49 */
50 ESCRIPT_DLL_API
51 virtual
52 ~DataEmpty();
53
54 /**
55 \brief
56 Return a textual representation of the Data object.
57 */
58 ESCRIPT_DLL_API
59 virtual
60 std::string
61 toString() const;
62
63 /**
64 \brief Return a deep copy of the current object.
65 */
66 ESCRIPT_DLL_API
67 virtual
68 DataAbstract*
69 deepCopy();
70
71
72 /**
73 \brief
74 Return the offset for the given sample.
75 NB: This will throw an exception as obviously an empty Data object contains no
76 samples. An implementation is required by parent DataAbstract class.
77 \param sampleNo - Input - Sample number.
78 \param dataPointNo - Input - data-point number.
79 */
80 ESCRIPT_DLL_API
81 virtual
82 DataTypes::ValueType::size_type
83 getPointOffset(int sampleNo,
84 int dataPointNo) const;
85
86 // /**
87 /* \brief
88 Return a view into the data for the data point specified.
89 NB: This will throw an exception as obviously an empty Data object contains no
90 data points. An implementation is required by parent DataAbstract class.
91 \param sampleNo - Input - Sample number.
92 \param dataPointNo - Input - data-point number.*/
93 // */
94 // ESCRIPT_DLL_API
95 // virtual
96 // DataArrayView
97 // getDataPoint(int sampleNo,
98 // int dataPointNo);
99
100 /**
101 \brief
102 Return the number of doubles stored for the Data object.
103 As this is an empty Data object, this method will always return 0.
104 */
105 ESCRIPT_DLL_API
106 virtual
107 ValueType::size_type
108 getLength() const;
109
110 /**
111 \brief
112 Factory method that returns a newly created DataEmpty sliced from the
113 current Data object according to the specified region.
114 NB: This will throw an exception as obviously an empty Data object contains no
115 data to slice from. An implementation is required by parent DataAbstract class.
116 */
117 ESCRIPT_DLL_API
118 virtual
119 DataAbstract*
120 getSlice(const DataTypes::RegionType& region) const;
121
122 /**
123 \brief
124 Set the current Data object according to the specified slice from the
125 given input value.
126 NB: This will throw an exception as obviously an empty Data object contains no
127 data to slice to. An implementation is required by parent DataAbstract class.
128 \param value Input - Data to copy from
129 \param region Input - Region to copy.
130 */
131 ESCRIPT_DLL_API
132 virtual
133 void
134 setSlice(const DataAbstract* value,
135 const DataTypes::RegionType& region);
136
137
138 void
139 dump(const std::string fileName) const;
140
141 protected:
142
143 /**
144 \brief Provide access to underlying storage. Internal use only!
145 */
146 ESCRIPT_DLL_API
147 virtual DataTypes::ValueType&
148 getVector();
149
150 ESCRIPT_DLL_API
151 virtual const DataTypes::ValueType&
152 getVector() const;
153
154 private:
155
156 // /**
157 /* \brief
158 Throw a standard exception. This function is called if an attempt
159 is made to use functions of DataEmpty that are not valid.*/
160 // */
161 // void
162 // throwStandardException(const std::string& functionName) const;
163
164 };
165
166 } // end of namespace
167
168 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26