/[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 102 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 121 by jgs, Fri May 6 04:26:16 2005 UTC
# Line 12  Line 12 
12   *                                                                            *   *                                                                            *
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    
# Line 27  namespace escript { Line 27  namespace escript {
27     Description:     Description:
28     Implements the DataAbstract interface for an empty Data object.     Implements the DataAbstract interface for an empty Data object.
29  */  */
30    
31  class DataEmpty : public DataAbstract {  class DataEmpty : public DataAbstract {
32    
33   public:   public:
# Line 58  class DataEmpty : public DataAbstract { Line 59  class DataEmpty : public DataAbstract {
59    
60    /**    /**
61       \brief       \brief
62       Return the offset for the given sample. This is a somewhat artificial notion       Return the offset for the given sample.
63       but returns the offset in bytes for the given point into the container       NB: This will throw an exception as obviously an empty Data object contains no
64       holding the point data.       samples. An implementation is required by parent DataAbstract class.
65       \param sampleNo - Input - Sample number.       \param sampleNo - Input - Sample number.
66       \param dataPointNo - Input - data-point number.       \param dataPointNo - Input - data-point number.
67     */     */
# Line 72  class DataEmpty : public DataAbstract { Line 73  class DataEmpty : public DataAbstract {
73    /**    /**
74       \brief       \brief
75       Return a view into the data for the data point specified.       Return a view into the data for the data point specified.
76       NOTE: Construction of the DataArrayView is a relatively expensive       NB: This will throw an exception as obviously an empty Data object contains no
77       operation.       data points. An implementation is required by parent DataAbstract class.
78       \param sampleNo - Input - Sample number.       \param sampleNo - Input - Sample number.
79       \param dataPointNo - Input - data-point number.       \param dataPointNo - Input - data-point number.
80    */    */
# Line 84  class DataEmpty : public DataAbstract { Line 85  class DataEmpty : public DataAbstract {
85    
86    /**    /**
87       \brief       \brief
      Return the sample data for the given tag key. If the data isn't tagged  
      an exception will be thrown.  
   */  
   virtual  
   double*  
   getSampleDataByTag(int tag);  
   
   /**  
      \brief  
      Throw a standard exception. This function is called if an attempt  
      is made to use functions of DataEmpty that are not valid.  
   */  
   void  
   throwStandardException(const std::string& functionName) const;  
   
   /**  
      \brief  
88       Return the number of doubles stored for the Data object.       Return the number of doubles stored for the Data object.
89         As this is an empty Data object, this method will always return 0.
90    */    */
91    virtual    virtual
92    ValueType::size_type    ValueType::size_type
# Line 111  class DataEmpty : public DataAbstract { Line 96  class DataEmpty : public DataAbstract {
96       \brief       \brief
97       Factory method that returns a newly created DataEmpty sliced from the       Factory method that returns a newly created DataEmpty sliced from the
98       current Data object according to the specified region.       current Data object according to the specified region.
99       The caller is reponsible for managing the object created.       NB: This will throw an exception as obviously an empty Data object contains no
100         data to slice from. An implementation is required by parent DataAbstract class.
101    */    */
102    virtual    virtual
103    DataAbstract*    DataAbstract*
# Line 121  class DataEmpty : public DataAbstract { Line 107  class DataEmpty : public DataAbstract {
107       \brief       \brief
108       Set the current Data object according to the specified slice from the       Set the current Data object according to the specified slice from the
109       given input value.       given input value.
110         NB: This will throw an exception as obviously an empty Data object contains no
111         data to slice to. An implementation is required by parent DataAbstract class.
112       \param value Input - Data to copy from       \param value Input - Data to copy from
113       \param region Input - Region to copy.       \param region Input - Region to copy.
114    */    */
# Line 132  class DataEmpty : public DataAbstract { Line 120  class DataEmpty : public DataAbstract {
120    /**    /**
121       \brief       \brief
122       Reshape the data point if the data point is currently rank 0.       Reshape the data point if the data point is currently rank 0.
123       The original data point value is used for all values of the new       NB: This will throw an exception as obviously an empty Data object contains no
124       data point.       data to reshape. An implementation is required by parent DataAbstract class.
125    */    */
126    virtual    virtual
127    void    void
# Line 143  class DataEmpty : public DataAbstract { Line 131  class DataEmpty : public DataAbstract {
131    
132   private:   private:
133    
134      /**
135         \brief
136         Throw a standard exception. This function is called if an attempt
137         is made to use functions of DataEmpty that are not valid.
138      */
139      void
140      throwStandardException(const std::string& functionName) const;
141    
142  };  };
143    
144  } // end of namespace  } // end of namespace
145    
146  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.26