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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 474 - (show annotations)
Mon Jan 30 04:23:44 2006 UTC (13 years, 8 months ago) by jgs
File MIME type: text/plain
File size: 4202 byte(s)
restructure escript source tree
move src/Data/* -> src
remove inc
modify #includes and cpppath settings accordingly

1 //$Id$
2 /*
3 ******************************************************************************
4 * *
5 * COPYRIGHT ACcESS 2004 - All Rights Reserved *
6 * *
7 * This software is the property of ACcESS. No part of this code *
8 * may be copied in any form or by any means without the expressed written *
9 * consent of ACcESS. Copying, use or modification of this software *
10 * by any unauthorised person is illegal unless that person has a software *
11 * license agreement with ACcESS. *
12 * *
13 ******************************************************************************
14 */
15
16 #if !defined escript_DataEmpty_20040726_H
17 #define escript_DataEmpty_20040726_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 DataEmpty();
44
45 /**
46 \brief
47 Destructor for DataEmpty.
48 */
49 virtual
50 ~DataEmpty();
51
52 /**
53 \brief
54 Return a textual representation of the Data object.
55 */
56 virtual
57 std::string
58 toString() const;
59
60 /**
61 \brief
62 Return the offset for the given sample.
63 NB: This will throw an exception as obviously an empty Data object contains no
64 samples. An implementation is required by parent DataAbstract class.
65 \param sampleNo - Input - Sample number.
66 \param dataPointNo - Input - data-point number.
67 */
68 virtual
69 DataArrayView::ValueType::size_type
70 getPointOffset(int sampleNo,
71 int dataPointNo) const;
72
73 /**
74 \brief
75 Return a view into the data for the data point specified.
76 NB: This will throw an exception as obviously an empty Data object contains no
77 data points. An implementation is required by parent DataAbstract class.
78 \param sampleNo - Input - Sample number.
79 \param dataPointNo - Input - data-point number.
80 */
81 virtual
82 DataArrayView
83 getDataPoint(int sampleNo,
84 int dataPointNo);
85
86 /**
87 \brief
88 Return the number of doubles stored for the Data object.
89 As this is an empty Data object, this method will always return 0.
90 */
91 virtual
92 ValueType::size_type
93 getLength() const;
94
95 /**
96 \brief
97 Factory method that returns a newly created DataEmpty sliced from the
98 current Data object according to the specified region.
99 NB: This will throw an exception as obviously an empty Data object contains no
100 data to slice from. An implementation is required by parent DataAbstract class.
101 */
102 virtual
103 DataAbstract*
104 getSlice(const DataArrayView::RegionType& region) const;
105
106 /**
107 \brief
108 Set the current Data object according to the specified slice from the
109 given input value.
110 NB: This will throw an exception as obviously an empty Data object contains no
111 data to slice to. An implementation is required by parent DataAbstract class.
112 \param value Input - Data to copy from
113 \param region Input - Region to copy.
114 */
115 virtual
116 void
117 setSlice(const DataAbstract* value,
118 const DataArrayView::RegionType& region);
119
120 /**
121 \brief
122 Reshape the data point if the data point is currently rank 0.
123 NB: This will throw an exception as obviously an empty Data object contains no
124 data to reshape. An implementation is required by parent DataAbstract class.
125 */
126 virtual
127 void
128 reshapeDataPoint(const DataArrayView::ShapeType& shape);
129
130 protected:
131
132 private:
133
134 /**
135 \brief
136 Throw a standard exception. This function is called if an attempt
137 is made to use functions of DataEmpty that are not valid.
138 */
139 void
140 throwStandardException(const std::string& functionName) const;
141
142 };
143
144 } // end of namespace
145
146 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26