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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 jgs 102 //$Id$
2 jgs 82 /*
3 elspeth 615 ************************************************************
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 jgs 82 */
13 jgs 121
14 jgs 102 #if !defined escript_DataEmpty_20040726_H
15 jgs 82 #define escript_DataEmpty_20040726_H
16    
17     #include "DataAbstract.h"
18    
19     namespace escript {
20    
21     /**
22     \brief
23 jgs 102 Implements the DataAbstract interface for an empty Data object.
24 jgs 82
25     Description:
26 jgs 102 Implements the DataAbstract interface for an empty Data object.
27 jgs 82 */
28 jgs 121
29 jgs 102 class DataEmpty : public DataAbstract {
30 jgs 82
31     public:
32    
33     /**
34     \brief
35 jgs 102 Default constructor for DataEmpty.
36 jgs 82
37     Description:
38 jgs 102 Default constructor for DataEmpty.
39 jgs 82
40     */
41     DataEmpty();
42 jgs 102
43 jgs 82 /**
44     \brief
45 jgs 102 Destructor for DataEmpty.
46 jgs 82 */
47 jgs 102 virtual
48     ~DataEmpty();
49    
50 jgs 82 /**
51     \brief
52 jgs 102 Return a textual representation of the Data object.
53 jgs 82 */
54 jgs 102 virtual
55     std::string
56     toString() const;
57    
58 jgs 82 /**
59     \brief
60 jgs 121 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 jgs 102 \param sampleNo - Input - Sample number.
64     \param dataPointNo - Input - data-point number.
65 jgs 82 */
66 jgs 102 virtual
67     DataArrayView::ValueType::size_type
68     getPointOffset(int sampleNo,
69     int dataPointNo) const;
70    
71 jgs 82 /**
72     \brief
73     Return a view into the data for the data point specified.
74 jgs 121 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 jgs 102 \param sampleNo - Input - Sample number.
77     \param dataPointNo - Input - data-point number.
78 jgs 82 */
79 jgs 102 virtual
80     DataArrayView
81     getDataPoint(int sampleNo,
82     int dataPointNo);
83    
84     /**
85 jgs 82 \brief
86 jgs 102 Return the number of doubles stored for the Data object.
87 jgs 121 As this is an empty Data object, this method will always return 0.
88 jgs 82 */
89 jgs 102 virtual
90     ValueType::size_type
91     getLength() const;
92    
93 jgs 82 /**
94     \brief
95 jgs 102 Factory method that returns a newly created DataEmpty sliced from the
96     current Data object according to the specified region.
97 jgs 121 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 jgs 82 */
100 jgs 102 virtual
101     DataAbstract*
102     getSlice(const DataArrayView::RegionType& region) const;
103    
104     /**
105 jgs 82 \brief
106 jgs 102 Set the current Data object according to the specified slice from the
107     given input value.
108 jgs 121 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 jgs 82 \param value Input - Data to copy from
111     \param region Input - Region to copy.
112     */
113 jgs 102 virtual
114     void
115     setSlice(const DataAbstract* value,
116     const DataArrayView::RegionType& region);
117    
118 jgs 82 /**
119     \brief
120     Reshape the data point if the data point is currently rank 0.
121 jgs 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 jgs 82 */
124 jgs 102 virtual
125     void
126     reshapeDataPoint(const DataArrayView::ShapeType& shape);
127    
128 jgs 82 protected:
129    
130     private:
131 jgs 102
132 jgs 121 /**
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 jgs 82 };
141    
142     } // end of namespace
143 jgs 121
144 jgs 82 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26