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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1387 - (hide annotations)
Fri Jan 11 07:45:26 2008 UTC (11 years, 10 months ago) by trankine
Original Path: temp/escript/src/DataEmpty.h
File MIME type: text/plain
File size: 3582 byte(s)
Restore the trunk that existed before the windows changes were committed to the (now moved to branches) old trunk.
1 jgs 121
2 ksteube 1312 /* $Id$ */
3    
4     /*******************************************************
5     *
6     * Copyright 2003-2007 by ACceSS MNRF
7     * Copyright 2007 by University of Queensland
8     *
9     * http://esscc.uq.edu.au
10     * Primary Business: Queensland, Australia
11     * Licensed under the Open Software License version 3.0
12     * http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16 jgs 102 #if !defined escript_DataEmpty_20040726_H
17 jgs 82 #define escript_DataEmpty_20040726_H
18 woo409 757 #include "system_dep.h"
19 jgs 82
20     #include "DataAbstract.h"
21    
22     namespace escript {
23    
24     /**
25     \brief
26 jgs 102 Implements the DataAbstract interface for an empty Data object.
27 jgs 82
28     Description:
29 jgs 102 Implements the DataAbstract interface for an empty Data object.
30 jgs 82 */
31 jgs 121
32 jgs 102 class DataEmpty : public DataAbstract {
33 jgs 82
34     public:
35    
36     /**
37     \brief
38 jgs 102 Default constructor for DataEmpty.
39 jgs 82
40     Description:
41 jgs 102 Default constructor for DataEmpty.
42 jgs 82
43     */
44 woo409 757 ESCRIPT_DLL_API
45 jgs 82 DataEmpty();
46 jgs 102
47 jgs 82 /**
48     \brief
49 jgs 102 Destructor for DataEmpty.
50 jgs 82 */
51 woo409 757 ESCRIPT_DLL_API
52 jgs 102 virtual
53     ~DataEmpty();
54    
55 jgs 82 /**
56     \brief
57 jgs 102 Return a textual representation of the Data object.
58 jgs 82 */
59 woo409 757 ESCRIPT_DLL_API
60 jgs 102 virtual
61     std::string
62     toString() const;
63    
64 jgs 82 /**
65     \brief
66 jgs 121 Return the offset for the given sample.
67     NB: This will throw an exception as obviously an empty Data object contains no
68     samples. An implementation is required by parent DataAbstract class.
69 jgs 102 \param sampleNo - Input - Sample number.
70     \param dataPointNo - Input - data-point number.
71 jgs 82 */
72 woo409 757 ESCRIPT_DLL_API
73 jgs 102 virtual
74     DataArrayView::ValueType::size_type
75     getPointOffset(int sampleNo,
76     int dataPointNo) const;
77    
78 jgs 82 /**
79     \brief
80     Return a view into the data for the data point specified.
81 jgs 121 NB: This will throw an exception as obviously an empty Data object contains no
82     data points. An implementation is required by parent DataAbstract class.
83 jgs 102 \param sampleNo - Input - Sample number.
84     \param dataPointNo - Input - data-point number.
85 jgs 82 */
86 woo409 757 ESCRIPT_DLL_API
87 jgs 102 virtual
88     DataArrayView
89     getDataPoint(int sampleNo,
90     int dataPointNo);
91    
92     /**
93 jgs 82 \brief
94 jgs 102 Return the number of doubles stored for the Data object.
95 jgs 121 As this is an empty Data object, this method will always return 0.
96 jgs 82 */
97 woo409 757 ESCRIPT_DLL_API
98 jgs 102 virtual
99     ValueType::size_type
100     getLength() const;
101    
102 jgs 82 /**
103     \brief
104 jgs 102 Factory method that returns a newly created DataEmpty sliced from the
105     current Data object according to the specified region.
106 jgs 121 NB: This will throw an exception as obviously an empty Data object contains no
107     data to slice from. An implementation is required by parent DataAbstract class.
108 jgs 82 */
109 woo409 757 ESCRIPT_DLL_API
110 jgs 102 virtual
111     DataAbstract*
112     getSlice(const DataArrayView::RegionType& region) const;
113    
114     /**
115 jgs 82 \brief
116 jgs 102 Set the current Data object according to the specified slice from the
117     given input value.
118 jgs 121 NB: This will throw an exception as obviously an empty Data object contains no
119     data to slice to. An implementation is required by parent DataAbstract class.
120 jgs 82 \param value Input - Data to copy from
121     \param region Input - Region to copy.
122     */
123 woo409 757 ESCRIPT_DLL_API
124 jgs 102 virtual
125     void
126     setSlice(const DataAbstract* value,
127     const DataArrayView::RegionType& region);
128    
129 jgs 82 protected:
130    
131     private:
132 jgs 102
133 jgs 121 /**
134     \brief
135     Throw a standard exception. This function is called if an attempt
136     is made to use functions of DataEmpty that are not valid.
137     */
138     void
139     throwStandardException(const std::string& functionName) const;
140    
141 jgs 82 };
142    
143     } // end of namespace
144 jgs 121
145 jgs 82 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26