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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 102 - (hide annotations)
Wed Dec 15 07:08:39 2004 UTC (14 years, 10 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/DataEmpty.h
File MIME type: text/plain
File size: 3945 byte(s)
*** empty log message ***

1 jgs 102 //$Id$
2 jgs 82 /*
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 jgs 102 #if !defined escript_DataEmpty_20040726_H
17 jgs 82 #define escript_DataEmpty_20040726_H
18    
19     #include "DataAbstract.h"
20    
21     namespace escript {
22    
23     /**
24     \brief
25 jgs 102 Implements the DataAbstract interface for an empty Data object.
26 jgs 82
27     Description:
28 jgs 102 Implements the DataAbstract interface for an empty Data object.
29 jgs 82 */
30 jgs 102 class DataEmpty : public DataAbstract {
31 jgs 82
32     public:
33    
34     /**
35     \brief
36 jgs 102 Default constructor for DataEmpty.
37 jgs 82
38     Description:
39 jgs 102 Default constructor for DataEmpty.
40 jgs 82
41     */
42     DataEmpty();
43 jgs 102
44 jgs 82 /**
45     \brief
46 jgs 102 Destructor for DataEmpty.
47 jgs 82 */
48 jgs 102 virtual
49     ~DataEmpty();
50    
51 jgs 82 /**
52     \brief
53 jgs 102 Return a textual representation of the Data object.
54 jgs 82 */
55 jgs 102 virtual
56     std::string
57     toString() const;
58    
59 jgs 82 /**
60     \brief
61 jgs 102 Return the offset for the given sample. This is a somewhat artificial notion
62 jgs 82 but returns the offset in bytes for the given point into the container
63     holding the point data.
64 jgs 102 \param sampleNo - Input - Sample number.
65     \param dataPointNo - Input - data-point number.
66 jgs 82 */
67 jgs 102 virtual
68     DataArrayView::ValueType::size_type
69     getPointOffset(int sampleNo,
70     int dataPointNo) const;
71    
72 jgs 82 /**
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 jgs 102 operation.
77     \param sampleNo - Input - Sample number.
78     \param dataPointNo - Input - data-point number.
79 jgs 82 */
80 jgs 102 virtual
81     DataArrayView
82     getDataPoint(int sampleNo,
83     int dataPointNo);
84    
85     /**
86 jgs 82 \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 jgs 102 virtual
91     double*
92     getSampleDataByTag(int tag);
93    
94 jgs 82 /**
95     \brief
96     Throw a standard exception. This function is called if an attempt
97 jgs 102 is made to use functions of DataEmpty that are not valid.
98 jgs 82 */
99 jgs 102 void
100     throwStandardException(const std::string& functionName) const;
101    
102 jgs 82 /**
103     \brief
104 jgs 102 Return the number of doubles stored for the Data object.
105 jgs 82 */
106 jgs 102 virtual
107     ValueType::size_type
108     getLength() const;
109    
110 jgs 82 /**
111     \brief
112 jgs 102 Factory method that returns a newly created DataEmpty sliced from the
113     current Data object according to the specified region.
114 jgs 82 The caller is reponsible for managing the object created.
115     */
116 jgs 102 virtual
117     DataAbstract*
118     getSlice(const DataArrayView::RegionType& region) const;
119    
120     /**
121 jgs 82 \brief
122 jgs 102 Set the current Data object according to the specified slice from the
123     given input value.
124 jgs 82 \param value Input - Data to copy from
125     \param region Input - Region to copy.
126     */
127 jgs 102 virtual
128     void
129     setSlice(const DataAbstract* value,
130     const DataArrayView::RegionType& region);
131    
132 jgs 82 /**
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 jgs 102 virtual
139     void
140     reshapeDataPoint(const DataArrayView::ShapeType& shape);
141    
142 jgs 82 protected:
143    
144     private:
145 jgs 102
146 jgs 82 };
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