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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (hide annotations)
Tue Oct 26 06:53:54 2004 UTC (14 years, 11 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/DataEmpty.h
File MIME type: text/plain
File size: 3637 byte(s)
Initial revision

1 jgs 82 /*
2     ******************************************************************************
3     * *
4     * COPYRIGHT ACcESS 2004 - All Rights Reserved *
5     * *
6     * This software is the property of ACcESS. No part of this code *
7     * may be copied in any form or by any means without the expressed written *
8     * consent of ACcESS. Copying, use or modification of this software *
9     * by any unauthorised person is illegal unless that person has a software *
10     * license agreement with ACcESS. *
11     * *
12     ******************************************************************************
13     */
14    
15     #if !defined escript_DataEmpty_20040726_H
16     #define escript_DataEmpty_20040726_H
17    
18     #include "DataAbstract.h"
19    
20     namespace escript {
21    
22     /**
23     \brief
24     Impliments the DataAbstract interface for an empty or null Data.
25    
26     Description:
27     Impliments the DataAbstract interface for an empty or null Data.
28     */
29     class DataEmpty:public DataAbstract {
30    
31     public:
32    
33     /**
34     \brief
35     Default constructor for DataEmpty
36    
37     Description:
38     Default constructor for DataEmpty
39    
40     */
41     DataEmpty();
42     /**
43     \brief
44     Destructor
45     */
46     virtual ~DataEmpty();
47     /**
48     \brief
49     Return a textual representation of the data
50     */
51     virtual std::string toString() const;
52     /**
53     \brief
54     Return the offset for the given sample. This is somewhat artificial notion
55     but returns the offset in bytes for the given point into the container
56     holding the point data.
57     \param sampleNo - Input, number of samples.
58     \param dataPointNo - Input.
59     */
60     virtual DataArrayView::ValueType::size_type getPointOffset(int sampleNo,int dataPointNo) const;
61     /**
62     \brief
63     Return a view into the data for the data point specified.
64     NOTE: Construction of the DataArrayView is a relatively expensive
65     operation
66     \param samplesNo - Input
67     \param dataPointNo - Input
68     */
69     virtual DataArrayView getDataPoint(int samplesNo, int dataPointNo);
70     /**
71     \brief
72     Return the sample data for the given tag key. If the data isn't tagged
73     an exception will be thrown.
74     */
75     virtual double* getSampleDataByTag(int tag);
76     /**
77     \brief
78     Throw a standard exception. This function is called if an attempt
79     is made to use functions of DataEmpty that are not allowed.
80     */
81     void throwStandardException(const std::string& functionName) const;
82     /**
83     \brief
84     Return the number of doubles stored for the Data
85     */
86     virtual ValueType::size_type getLength() const;
87     /**
88     \brief
89     Factory method that returns a newly created DataEmpty.
90     The caller is reponsible for managing the object created.
91     */
92     virtual DataAbstract* getSlice(const DataArrayView::RegionType& region) const; /**
93     \brief
94     Copy the specified region from the given value.
95     \param value Input - Data to copy from
96     \param region Input - Region to copy.
97     */
98     virtual void setSlice(const DataAbstract* value, const DataArrayView::RegionType& region);
99     /**
100     \brief
101     Reshape the data point if the data point is currently rank 0.
102     The original data point value is used for all values of the new
103     data point.
104     */
105     virtual void reshapeDataPoint(const DataArrayView::ShapeType& shape);
106     protected:
107    
108     private:
109     };
110    
111     } // end of namespace
112     #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26