/[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 854 by gross, Thu Sep 21 05:29:42 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    #include "system_dep.h"
17    
18  #include "DataAbstract.h"  #include "DataAbstract.h"
19    
# Line 27  namespace escript { Line 26  namespace escript {
26     Description:     Description:
27     Implements the DataAbstract interface for an empty Data object.     Implements the DataAbstract interface for an empty Data object.
28  */  */
29    
30  class DataEmpty : public DataAbstract {  class DataEmpty : public DataAbstract {
31    
32   public:   public:
# Line 39  class DataEmpty : public DataAbstract { Line 39  class DataEmpty : public DataAbstract {
39       Default constructor for DataEmpty.       Default constructor for DataEmpty.
40    
41    */    */
42      ESCRIPT_DLL_API
43    DataEmpty();    DataEmpty();
44    
45    /**    /**
46       \brief       \brief
47       Destructor for DataEmpty.       Destructor for DataEmpty.
48    */    */
49      ESCRIPT_DLL_API
50    virtual    virtual
51    ~DataEmpty();    ~DataEmpty();
52    
# Line 52  class DataEmpty : public DataAbstract { Line 54  class DataEmpty : public DataAbstract {
54       \brief       \brief
55       Return a textual representation of the Data object.       Return a textual representation of the Data object.
56    */    */
57      ESCRIPT_DLL_API
58    virtual    virtual
59    std::string    std::string
60    toString() const;    toString() const;
61    
62    /**    /**
63       \brief       \brief
64       Return the offset for the given sample. This is a somewhat artificial notion       Return the offset for the given sample.
65       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
66       holding the point data.       samples. An implementation is required by parent DataAbstract class.
67       \param sampleNo - Input - Sample number.       \param sampleNo - Input - Sample number.
68       \param dataPointNo - Input - data-point number.       \param dataPointNo - Input - data-point number.
69     */     */
70      ESCRIPT_DLL_API
71    virtual    virtual
72    DataArrayView::ValueType::size_type    DataArrayView::ValueType::size_type
73    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
# Line 72  class DataEmpty : public DataAbstract { Line 76  class DataEmpty : public DataAbstract {
76    /**    /**
77       \brief       \brief
78       Return a view into the data for the data point specified.       Return a view into the data for the data point specified.
79       NOTE: Construction of the DataArrayView is a relatively expensive       NB: This will throw an exception as obviously an empty Data object contains no
80       operation.       data points. An implementation is required by parent DataAbstract class.
81       \param sampleNo - Input - Sample number.       \param sampleNo - Input - Sample number.
82       \param dataPointNo - Input - data-point number.       \param dataPointNo - Input - data-point number.
83    */    */
84      ESCRIPT_DLL_API
85    virtual    virtual
86    DataArrayView    DataArrayView
87    getDataPoint(int sampleNo,    getDataPoint(int sampleNo,
# Line 84  class DataEmpty : public DataAbstract { Line 89  class DataEmpty : public DataAbstract {
89    
90    /**    /**
91       \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  
92       Return the number of doubles stored for the Data object.       Return the number of doubles stored for the Data object.
93         As this is an empty Data object, this method will always return 0.
94    */    */
95      ESCRIPT_DLL_API
96    virtual    virtual
97    ValueType::size_type    ValueType::size_type
98    getLength() const;    getLength() const;
# Line 111  class DataEmpty : public DataAbstract { Line 101  class DataEmpty : public DataAbstract {
101       \brief       \brief
102       Factory method that returns a newly created DataEmpty sliced from the       Factory method that returns a newly created DataEmpty sliced from the
103       current Data object according to the specified region.       current Data object according to the specified region.
104       The caller is reponsible for managing the object created.       NB: This will throw an exception as obviously an empty Data object contains no
105         data to slice from. An implementation is required by parent DataAbstract class.
106    */    */
107      ESCRIPT_DLL_API
108    virtual    virtual
109    DataAbstract*    DataAbstract*
110    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataArrayView::RegionType& region) const;
# Line 121  class DataEmpty : public DataAbstract { Line 113  class DataEmpty : public DataAbstract {
113       \brief       \brief
114       Set the current Data object according to the specified slice from the       Set the current Data object according to the specified slice from the
115       given input value.       given input value.
116         NB: This will throw an exception as obviously an empty Data object contains no
117         data to slice to. An implementation is required by parent DataAbstract class.
118       \param value Input - Data to copy from       \param value Input - Data to copy from
119       \param region Input - Region to copy.       \param region Input - Region to copy.
120    */    */
121      ESCRIPT_DLL_API
122    virtual    virtual
123    void    void
124    setSlice(const DataAbstract* value,    setSlice(const DataAbstract* value,
125             const DataArrayView::RegionType& region);             const DataArrayView::RegionType& region);
126    
127     protected:
128    
129     private:
130    
131    /**    /**
132       \brief       \brief
133       Reshape the data point if the data point is currently rank 0.       Throw a standard exception. This function is called if an attempt
134       The original data point value is used for all values of the new       is made to use functions of DataEmpty that are not valid.
      data point.  
135    */    */
   virtual  
136    void    void
137    reshapeDataPoint(const DataArrayView::ShapeType& shape);    throwStandardException(const std::string& functionName) const;
   
  protected:  
   
  private:  
138    
139  };  };
140    
141  } // end of namespace  } // end of namespace
142    
143  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.26