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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 615 - (show annotations)
Wed Mar 22 02:12:00 2006 UTC (13 years, 6 months ago) by elspeth
File MIME type: text/plain
File size: 3880 byte(s)
More copyright information.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26