/[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

trunk/esys2/escript/src/Data/DataEmpty.h revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC trunk/escript/src/DataEmpty.h revision 615 by elspeth, Wed Mar 22 02:12:00 2006 UTC
# Line 1  Line 1 
1  //$Id$  //$Id$
2  /*  /*
3   ******************************************************************************   ************************************************************
4   *                                                                            *   *          Copyright 2006 by ACcESS MNRF                   *
5   *       COPYRIGHT  ACcESS 2004 -  All Rights Reserved                        *   *                                                          *
6   *                                                                            *   *              http://www.access.edu.au                    *
7   * This software is the property of ACcESS. No part of this code              *   *       Primary Business: Queensland, Australia            *
8   * may be copied in any form or by any means without the expressed written    *   *  Licensed under the Open Software License version 3.0    *
9   * consent of ACcESS.  Copying, use or modification of this software          *   *     http://www.opensource.org/licenses/osl-3.0.php       *
10   * by any unauthorised person is illegal unless that person has a software    *   *                                                          *
11   * license agreement with ACcESS.                                             *   ************************************************************
  *                                                                            *  
  ******************************************************************************  
12  */  */
13                                                                              
14  #if !defined escript_DataEmpty_20040726_H  #if !defined escript_DataEmpty_20040726_H
15  #define escript_DataEmpty_20040726_H  #define escript_DataEmpty_20040726_H
16    
# Line 27  namespace escript { Line 25  namespace escript {
25     Description:     Description:
26     Implements the DataAbstract interface for an empty Data object.     Implements the DataAbstract interface for an empty Data object.
27  */  */
28    
29  class DataEmpty : public DataAbstract {  class DataEmpty : public DataAbstract {
30    
31   public:   public:
# Line 58  class DataEmpty : public DataAbstract { Line 57  class DataEmpty : public DataAbstract {
57    
58    /**    /**
59       \brief       \brief
60       Return the offset for the given sample. This is a somewhat artificial notion       Return the offset for the given sample.
61       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
62       holding the point data.       samples. An implementation is required by parent DataAbstract class.
63       \param sampleNo - Input - Sample number.       \param sampleNo - Input - Sample number.
64       \param dataPointNo - Input - data-point number.       \param dataPointNo - Input - data-point number.
65     */     */
# Line 72  class DataEmpty : public DataAbstract { Line 71  class DataEmpty : public DataAbstract {
71    /**    /**
72       \brief       \brief
73       Return a view into the data for the data point specified.       Return a view into the data for the data point specified.
74       NOTE: Construction of the DataArrayView is a relatively expensive       NB: This will throw an exception as obviously an empty Data object contains no
75       operation.       data points. An implementation is required by parent DataAbstract class.
76       \param sampleNo - Input - Sample number.       \param sampleNo - Input - Sample number.
77       \param dataPointNo - Input - data-point number.       \param dataPointNo - Input - data-point number.
78    */    */
# Line 84  class DataEmpty : public DataAbstract { Line 83  class DataEmpty : public DataAbstract {
83    
84    /**    /**
85       \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  
86       Return the number of doubles stored for the Data object.       Return the number of doubles stored for the Data object.
87         As this is an empty Data object, this method will always return 0.
88    */    */
89    virtual    virtual
90    ValueType::size_type    ValueType::size_type
# Line 111  class DataEmpty : public DataAbstract { Line 94  class DataEmpty : public DataAbstract {
94       \brief       \brief
95       Factory method that returns a newly created DataEmpty sliced from the       Factory method that returns a newly created DataEmpty sliced from the
96       current Data object according to the specified region.       current Data object according to the specified region.
97       The caller is reponsible for managing the object created.       NB: This will throw an exception as obviously an empty Data object contains no
98         data to slice from. An implementation is required by parent DataAbstract class.
99    */    */
100    virtual    virtual
101    DataAbstract*    DataAbstract*
# Line 121  class DataEmpty : public DataAbstract { Line 105  class DataEmpty : public DataAbstract {
105       \brief       \brief
106       Set the current Data object according to the specified slice from the       Set the current Data object according to the specified slice from the
107       given input value.       given input value.
108         NB: This will throw an exception as obviously an empty Data object contains no
109         data to slice to. An implementation is required by parent DataAbstract class.
110       \param value Input - Data to copy from       \param value Input - Data to copy from
111       \param region Input - Region to copy.       \param region Input - Region to copy.
112    */    */
# Line 132  class DataEmpty : public DataAbstract { Line 118  class DataEmpty : public DataAbstract {
118    /**    /**
119       \brief       \brief
120       Reshape the data point if the data point is currently rank 0.       Reshape the data point if the data point is currently rank 0.
121       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
122       data point.       data to reshape. An implementation is required by parent DataAbstract class.
123    */    */
124    virtual    virtual
125    void    void
# Line 143  class DataEmpty : public DataAbstract { Line 129  class DataEmpty : public DataAbstract {
129    
130   private:   private:
131    
132      /**
133         \brief
134         Throw a standard exception. This function is called if an attempt
135         is made to use functions of DataEmpty that are not valid.
136      */
137      void
138      throwStandardException(const std::string& functionName) const;
139    
140  };  };
141    
142  } // end of namespace  } // end of namespace
143    
144  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.26