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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 101 by jgs, Wed Dec 15 03:48:48 2004 UTC revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC
# Line 1  Line 1 
1    //$Id$
2  /*  /*
3   ******************************************************************************   ******************************************************************************
4   *                                                                            *   *                                                                            *
# Line 12  Line 13 
13   ******************************************************************************   ******************************************************************************
14  */  */
15                                                                                                                                                        
16  #if !defined  escript_DataEmpty_20040726_H  #if !defined escript_DataEmpty_20040726_H
17  #define escript_DataEmpty_20040726_H  #define escript_DataEmpty_20040726_H
18    
19  #include "DataAbstract.h"  #include "DataAbstract.h"
# Line 21  namespace escript { Line 22  namespace escript {
22    
23  /**  /**
24     \brief     \brief
25     Impliments the DataAbstract interface for an empty or null Data.     Implements the DataAbstract interface for an empty Data object.
26    
27     Description:     Description:
28     Impliments the DataAbstract interface for an empty or null Data.     Implements the DataAbstract interface for an empty Data object.
29  */  */
30  class DataEmpty:public DataAbstract {  class DataEmpty : public DataAbstract {
31    
32   public:   public:
33    
34    /**    /**
35       \brief       \brief
36       Default constructor for DataEmpty       Default constructor for DataEmpty.
37    
38       Description:       Description:
39       Default constructor for DataEmpty       Default constructor for DataEmpty.
40    
41    */    */
42    DataEmpty();    DataEmpty();
43    
44    /**    /**
45       \brief       \brief
46       Destructor       Destructor for DataEmpty.
47    */    */
48    virtual ~DataEmpty();    virtual
49      ~DataEmpty();
50    
51    /**    /**
52       \brief       \brief
53       Return a textual representation of the data       Return a textual representation of the Data object.
54    */    */
55    virtual std::string toString() const;    virtual
56      std::string
57      toString() const;
58    
59    /**    /**
60       \brief       \brief
61       Return the offset for the given sample. This is somewhat artificial notion       Return the offset for the given sample. This is a somewhat artificial notion
62       but returns the offset in bytes for the given point into the container       but returns the offset in bytes for the given point into the container
63       holding the point data.       holding the point data.
64       \param sampleNo - Input, number of samples.       \param sampleNo - Input - Sample number.
65       \param dataPointNo - Input.       \param dataPointNo - Input - data-point number.
66     */     */
67    virtual DataArrayView::ValueType::size_type getPointOffset(int sampleNo,int dataPointNo) const;    virtual
68      DataArrayView::ValueType::size_type
69      getPointOffset(int sampleNo,
70                     int dataPointNo) const;
71    
72    /**    /**
73       \brief       \brief
74       Return a view into the data for the data point specified.       Return a view into the data for the data point specified.
75       NOTE: Construction of the DataArrayView is a relatively expensive       NOTE: Construction of the DataArrayView is a relatively expensive
76       operation       operation.
77       \param samplesNo - Input       \param sampleNo - Input - Sample number.
78       \param dataPointNo - Input       \param dataPointNo - Input - data-point number.
79    */    */
80    virtual DataArrayView getDataPoint(int samplesNo, int dataPointNo);    virtual
81   /**    DataArrayView
82      getDataPoint(int sampleNo,
83                   int dataPointNo);
84    
85      /**
86       \brief       \brief
87       Return the sample data for the given tag key. If the data isn't tagged       Return the sample data for the given tag key. If the data isn't tagged
88       an exception will be thrown.       an exception will be thrown.
89    */    */
90    virtual double* getSampleDataByTag(int tag);    virtual
91      double*
92      getSampleDataByTag(int tag);
93    
94    /**    /**
95       \brief       \brief
96       Throw a standard exception. This function is called if an attempt       Throw a standard exception. This function is called if an attempt
97       is made to use functions of DataEmpty that are not allowed.       is made to use functions of DataEmpty that are not valid.
98    */    */
99    void throwStandardException(const std::string& functionName) const;    void
100      throwStandardException(const std::string& functionName) const;
101    
102    /**    /**
103       \brief       \brief
104       Return the number of doubles stored for the Data       Return the number of doubles stored for the Data object.
105    */    */
106    virtual ValueType::size_type getLength() const;    virtual
107      ValueType::size_type
108      getLength() const;
109    
110    /**    /**
111       \brief       \brief
112       Factory method that returns a newly created DataEmpty.       Factory method that returns a newly created DataEmpty sliced from the
113         current Data object according to the specified region.
114       The caller is reponsible for managing the object created.       The caller is reponsible for managing the object created.
115    */    */
116    virtual DataAbstract* getSlice(const DataArrayView::RegionType& region) const;  /**    virtual
117      DataAbstract*
118      getSlice(const DataArrayView::RegionType& region) const;
119    
120      /**
121       \brief       \brief
122       Copy the specified region from the given value.       Set the current Data object according to the specified slice from the
123         given input value.
124       \param value Input - Data to copy from       \param value Input - Data to copy from
125       \param region Input - Region to copy.       \param region Input - Region to copy.
126    */    */
127    virtual void setSlice(const DataAbstract* value, const DataArrayView::RegionType& region);    virtual
128      void
129      setSlice(const DataAbstract* value,
130               const DataArrayView::RegionType& region);
131    
132    /**    /**
133       \brief       \brief
134       Reshape the data point if the data point is currently rank 0.       Reshape the data point if the data point is currently rank 0.
135       The original data point value is used for all values of the new       The original data point value is used for all values of the new
136       data point.       data point.
137    */    */
138    virtual void reshapeDataPoint(const DataArrayView::ShapeType& shape);    virtual
139      void
140      reshapeDataPoint(const DataArrayView::ShapeType& shape);
141    
142   protected:   protected:
143    
144   private:   private:
145    
146  };  };
147    
148  } // end of namespace  } // end of namespace

Legend:
Removed from v.101  
changed lines
  Added in v.102

  ViewVC Help
Powered by ViewVC 1.1.26