/[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 474 by jgs, Mon Jan 30 04:23:44 2006 UTC revision 2742 by jfenwick, Thu Nov 12 06:03:37 2009 UTC
# Line 1  Line 1 
1  //$Id$  
2  /*  /*******************************************************
3   ******************************************************************************  *
4   *                                                                            *  * Copyright (c) 2003-2009 by University of Queensland
5   *       COPYRIGHT  ACcESS 2004 -  All Rights Reserved                        *  * Earth Systems Science Computational Center (ESSCC)
6   *                                                                            *  * http://www.uq.edu.au/esscc
7   * This software is the property of ACcESS. No part of this code              *  *
8   * may be copied in any form or by any means without the expressed written    *  * Primary Business: Queensland, Australia
9   * consent of ACcESS.  Copying, use or modification of this software          *  * Licensed under the Open Software License version 3.0
10   * by any unauthorised person is illegal unless that person has a software    *  * http://www.opensource.org/licenses/osl-3.0.php
11   * license agreement with ACcESS.                                             *  *
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    #include "system_dep.h"
18    
19  #include "DataAbstract.h"  #include "DataReady.h"
20    
21  namespace escript {  namespace escript {
22    
# Line 28  namespace escript { Line 28  namespace escript {
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 DataReady {
32    typedef DataReady parent;
33   public:   public:
34    
35    /**    /**
# Line 40  class DataEmpty : public DataAbstract { Line 40  class DataEmpty : public DataAbstract {
40       Default constructor for DataEmpty.       Default constructor for DataEmpty.
41    
42    */    */
43      ESCRIPT_DLL_API
44    DataEmpty();    DataEmpty();
45    
46    /**    /**
47       \brief       \brief
48       Destructor for DataEmpty.       Destructor for DataEmpty.
49    */    */
50      ESCRIPT_DLL_API
51    virtual    virtual
52    ~DataEmpty();    ~DataEmpty();
53    
# Line 53  class DataEmpty : public DataAbstract { Line 55  class DataEmpty : public DataAbstract {
55       \brief       \brief
56       Return a textual representation of the Data object.       Return a textual representation of the Data object.
57    */    */
58      ESCRIPT_DLL_API
59    virtual    virtual
60    std::string    std::string
61    toString() const;    toString() const;
62    
63    /**    /**
64         \brief Return a deep copy of the current object.
65      */
66      ESCRIPT_DLL_API
67      virtual
68      DataAbstract*
69      deepCopy();
70    
71    
72      /**
73       \brief       \brief
74       Return the offset for the given sample.       Return the offset for the given sample.
75       NB: This will throw an exception as obviously an empty Data object contains no       NB: This will throw an exception as obviously an empty Data object contains no
# Line 65  class DataEmpty : public DataAbstract { Line 77  class DataEmpty : public DataAbstract {
77       \param sampleNo - Input - Sample number.       \param sampleNo - Input - Sample number.
78       \param dataPointNo - Input - data-point number.       \param dataPointNo - Input - data-point number.
79     */     */
80      ESCRIPT_DLL_API
81    virtual    virtual
82    DataArrayView::ValueType::size_type    DataTypes::ValueType::size_type
83    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
84                   int dataPointNo) const;                   int dataPointNo) const;
85    
86    /**    ESCRIPT_DLL_API
      \brief  
      Return a view into the data for the data point specified.  
      NB: This will throw an exception as obviously an empty Data object contains no  
      data points. An implementation is required by parent DataAbstract class.  
      \param sampleNo - Input - Sample number.  
      \param dataPointNo - Input - data-point number.  
   */  
87    virtual    virtual
88    DataArrayView    DataTypes::ValueType::size_type
89    getDataPoint(int sampleNo,    getPointOffset(int sampleNo,
90                 int dataPointNo);                   int dataPointNo);
91    
92    /**    /**
93       \brief       \brief
94       Return the number of doubles stored for the Data object.       Return the number of doubles stored for the Data object.
95       As this is an empty Data object, this method will always return 0.       As this is an empty Data object, this method will always return 0.
96    */    */
97      ESCRIPT_DLL_API
98    virtual    virtual
99    ValueType::size_type    ValueType::size_type
100    getLength() const;    getLength() const;
# Line 99  class DataEmpty : public DataAbstract { Line 106  class DataEmpty : public DataAbstract {
106       NB: This will throw an exception as obviously an empty Data object contains no       NB: This will throw an exception as obviously an empty Data object contains no
107       data to slice from. An implementation is required by parent DataAbstract class.       data to slice from. An implementation is required by parent DataAbstract class.
108    */    */
109      ESCRIPT_DLL_API
110    virtual    virtual
111    DataAbstract*    DataAbstract*
112    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataTypes::RegionType& region) const;
113    
114    /**    /**
115       \brief       \brief
# Line 112  class DataEmpty : public DataAbstract { Line 120  class DataEmpty : public DataAbstract {
120       \param value Input - Data to copy from       \param value Input - Data to copy from
121       \param region Input - Region to copy.       \param region Input - Region to copy.
122    */    */
123      ESCRIPT_DLL_API
124    virtual    virtual
125    void    void
126    setSlice(const DataAbstract* value,    setSlice(const DataAbstract* value,
127             const DataArrayView::RegionType& region);             const DataTypes::RegionType& region);
128    
129    /**    /**
130       \brief      \brief invert square matricies
131       Reshape the data point if the data point is currently rank 0.      \param out - Where to store the results
      NB: This will throw an exception as obviously an empty Data object contains no  
      data to reshape. An implementation is required by parent DataAbstract class.  
132    */    */
133    virtual    ESCRIPT_DLL_API
134    void    void
135    reshapeDataPoint(const DataArrayView::ShapeType& shape);    matrixInverse(DataAbstract* out) const;
136    
137      void
138      dump(const std::string fileName) const;
139    
140   protected:   protected:
141    
142     /**
143        \brief Provide access to underlying storage. Internal use only!
144      */
145      ESCRIPT_DLL_API
146      virtual DataTypes::ValueType&
147      getVectorRW();
148    
149    
150      ESCRIPT_DLL_API
151      virtual const DataTypes::ValueType&
152      getVectorRO() const;
153    
154    
155   private:   private:
156    
157    /**  //  /**
158       \brief  /*     \brief
159       Throw a standard exception. This function is called if an attempt       Throw a standard exception. This function is called if an attempt
160       is made to use functions of DataEmpty that are not valid.       is made to use functions of DataEmpty that are not valid.*/
161    */  //  */
162    void  //   void
163    throwStandardException(const std::string& functionName) const;  //   throwStandardException(const std::string& functionName) const;
164    
165  };  };
166    

Legend:
Removed from v.474  
changed lines
  Added in v.2742

  ViewVC Help
Powered by ViewVC 1.1.26