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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 474 - (hide 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 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 jgs 121
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 121
31 jgs 102 class DataEmpty : public DataAbstract {
32 jgs 82
33     public:
34    
35     /**
36     \brief
37 jgs 102 Default constructor for DataEmpty.
38 jgs 82
39     Description:
40 jgs 102 Default constructor for DataEmpty.
41 jgs 82
42     */
43     DataEmpty();
44 jgs 102
45 jgs 82 /**
46     \brief
47 jgs 102 Destructor for DataEmpty.
48 jgs 82 */
49 jgs 102 virtual
50     ~DataEmpty();
51    
52 jgs 82 /**
53     \brief
54 jgs 102 Return a textual representation of the Data object.
55 jgs 82 */
56 jgs 102 virtual
57     std::string
58     toString() const;
59    
60 jgs 82 /**
61     \brief
62 jgs 121 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 jgs 102 \param sampleNo - Input - Sample number.
66     \param dataPointNo - Input - data-point number.
67 jgs 82 */
68 jgs 102 virtual
69     DataArrayView::ValueType::size_type
70     getPointOffset(int sampleNo,
71     int dataPointNo) const;
72    
73 jgs 82 /**
74     \brief
75     Return a view into the data for the data point specified.
76 jgs 121 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 jgs 102 \param sampleNo - Input - Sample number.
79     \param dataPointNo - Input - data-point number.
80 jgs 82 */
81 jgs 102 virtual
82     DataArrayView
83     getDataPoint(int sampleNo,
84     int dataPointNo);
85    
86     /**
87 jgs 82 \brief
88 jgs 102 Return the number of doubles stored for the Data object.
89 jgs 121 As this is an empty Data object, this method will always return 0.
90 jgs 82 */
91 jgs 102 virtual
92     ValueType::size_type
93     getLength() const;
94    
95 jgs 82 /**
96     \brief
97 jgs 102 Factory method that returns a newly created DataEmpty sliced from the
98     current Data object according to the specified region.
99 jgs 121 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 jgs 82 */
102 jgs 102 virtual
103     DataAbstract*
104     getSlice(const DataArrayView::RegionType& region) const;
105    
106     /**
107 jgs 82 \brief
108 jgs 102 Set the current Data object according to the specified slice from the
109     given input value.
110 jgs 121 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 jgs 82 \param value Input - Data to copy from
113     \param region Input - Region to copy.
114     */
115 jgs 102 virtual
116     void
117     setSlice(const DataAbstract* value,
118     const DataArrayView::RegionType& region);
119    
120 jgs 82 /**
121     \brief
122     Reshape the data point if the data point is currently rank 0.
123 jgs 121 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 jgs 82 */
126 jgs 102 virtual
127     void
128     reshapeDataPoint(const DataArrayView::ShapeType& shape);
129    
130 jgs 82 protected:
131    
132     private:
133 jgs 102
134 jgs 121 /**
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 jgs 82 };
143    
144     } // end of namespace
145 jgs 121
146 jgs 82 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26