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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 97 - (show annotations)
Tue Dec 14 05:39:33 2004 UTC (14 years, 11 months ago) by jgs
File MIME type: text/plain
File size: 3945 byte(s)
*** empty log message ***

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 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 DataEmpty();
43
44 /**
45 \brief
46 Destructor for DataEmpty.
47 */
48 virtual
49 ~DataEmpty();
50
51 /**
52 \brief
53 Return a textual representation of the Data object.
54 */
55 virtual
56 std::string
57 toString() const;
58
59 /**
60 \brief
61 Return the offset for the given sample. This is a somewhat artificial notion
62 but returns the offset in bytes for the given point into the container
63 holding the point data.
64 \param sampleNo - Input - Sample number.
65 \param dataPointNo - Input - data-point number.
66 */
67 virtual
68 DataArrayView::ValueType::size_type
69 getPointOffset(int sampleNo,
70 int dataPointNo) const;
71
72 /**
73 \brief
74 Return a view into the data for the data point specified.
75 NOTE: Construction of the DataArrayView is a relatively expensive
76 operation.
77 \param sampleNo - Input - Sample number.
78 \param dataPointNo - Input - data-point number.
79 */
80 virtual
81 DataArrayView
82 getDataPoint(int sampleNo,
83 int dataPointNo);
84
85 /**
86 \brief
87 Return the sample data for the given tag key. If the data isn't tagged
88 an exception will be thrown.
89 */
90 virtual
91 double*
92 getSampleDataByTag(int tag);
93
94 /**
95 \brief
96 Throw a standard exception. This function is called if an attempt
97 is made to use functions of DataEmpty that are not valid.
98 */
99 void
100 throwStandardException(const std::string& functionName) const;
101
102 /**
103 \brief
104 Return the number of doubles stored for the Data object.
105 */
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 The caller is reponsible for managing the object created.
115 */
116 virtual
117 DataAbstract*
118 getSlice(const DataArrayView::RegionType& region) const;
119
120 /**
121 \brief
122 Set the current Data object according to the specified slice from the
123 given input value.
124 \param value Input - Data to copy from
125 \param region Input - Region to copy.
126 */
127 virtual
128 void
129 setSlice(const DataAbstract* value,
130 const DataArrayView::RegionType& region);
131
132 /**
133 \brief
134 Reshape the data point if the data point is currently rank 0.
135 The original data point value is used for all values of the new
136 data point.
137 */
138 virtual
139 void
140 reshapeDataPoint(const DataArrayView::ShapeType& shape);
141
142 protected:
143
144 private:
145
146 };
147
148 } // end of namespace
149 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26