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

Legend:
Removed from v.97  
changed lines
  Added in v.100

  ViewVC Help
Powered by ViewVC 1.1.26