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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757 - (show annotations)
Mon Jun 26 13:12:56 2006 UTC (13 years, 5 months ago) by woo409
File MIME type: text/plain
File size: 4066 byte(s)
+ Merge of intelc_win32 branch (revision 741:755) with trunk. Tested on iVEC altix (run_tests and py_tests all pass)

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26