/[escript]/branches/arrayview_from_1695_trunk/escript/src/DataEmpty.h
ViewVC logotype

Annotation of /branches/arrayview_from_1695_trunk/escript/src/DataEmpty.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1747 - (hide annotations)
Wed Sep 3 04:56:50 2008 UTC (11 years, 4 months ago) by jfenwick
File MIME type: text/plain
File size: 3812 byte(s)
Branch commit.

Current status, this version compiles as passes run_tests (haven't tried 
all_tests), provided that the following files are moved out of the way:

DataAlgorithmAdapterTestCase.h 
DataTaggedTestCase.cpp 
DataTestCase.cpp 
DataTaggedTestCase.h

(They are not run by the unit tests at the moment).

I will fix those next.



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 jfenwick 1697 DataTypes::ValueType::size_type
75 jgs 102 getPointOffset(int sampleNo,
76     int dataPointNo) const;
77    
78 jfenwick 1747 // /**
79     /* \brief
80 jgs 82 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 jfenwick 1747 \param dataPointNo - Input - data-point number.*/
85     // */
86     // ESCRIPT_DLL_API
87     // virtual
88     // DataArrayView
89     // getDataPoint(int sampleNo,
90     // int dataPointNo);
91 jgs 102
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 jfenwick 1697 getSlice(const DataTypes::RegionType& region) const;
113 jgs 102
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 jfenwick 1697 const DataTypes::RegionType& region);
128 jgs 102
129 jgs 82 protected:
130    
131 jfenwick 1747 /**
132     \brief Provide access to underlying storage. Internal use only!
133     */
134     ESCRIPT_DLL_API
135     virtual DataTypes::ValueType&
136     getVector();
137    
138     ESCRIPT_DLL_API
139     virtual const DataTypes::ValueType&
140     getVector() const;
141    
142 jgs 82 private:
143 jgs 102
144 jgs 121 /**
145     \brief
146     Throw a standard exception. This function is called if an attempt
147     is made to use functions of DataEmpty that are not valid.
148     */
149     void
150     throwStandardException(const std::string& functionName) const;
151    
152 jgs 82 };
153    
154     } // end of namespace
155 jgs 121
156 jgs 82 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26