/[escript]/trunk/escript/src/DataAbstract.h
ViewVC logotype

Diff of /trunk/escript/src/DataAbstract.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1802 by jfenwick, Tue Sep 23 01:03:29 2008 UTC revision 1803 by jfenwick, Wed Sep 24 06:20:29 2008 UTC
# Line 22  Line 22 
22  #include <boost/scoped_ptr.hpp>  #include <boost/scoped_ptr.hpp>
23  #include <boost/python/numeric.hpp>  #include <boost/python/numeric.hpp>
24    
25    #include "DataException.h"
26    
27  #include <string>  #include <string>
28  #include <fstream>  #include <fstream>
29    
# Line 58  class DataAbstract { Line 60  class DataAbstract {
60       \param what - Input - A description of what this data represents.       \param what - Input - A description of what this data represents.
61    */    */
62    ESCRIPT_DLL_API    ESCRIPT_DLL_API
63    DataAbstract(const FunctionSpace& what, const ShapeType& shape);    DataAbstract(const FunctionSpace& what, const ShapeType& shape, bool isDataEmpty=false);
64    
65    /**    /**
66      \brief      \brief
# Line 110  class DataAbstract { Line 112  class DataAbstract {
112    int    int
113    getNumSamples() const;    getNumSamples() const;
114    
 //  /**  
 //      \brief  
 //      Return the DataArrayView of the point data. This essentially contains  
 //      the shape information for each data point although it also may be used  
 //      to manipulate the point data.  
 //  */  
 //   ESCRIPT_DLL_API  
 //   DataArrayView&  
 //   getPointDataView();  
   
 //   ESCRIPT_DLL_API  
 //   const DataArrayView&  
 //   getPointDataView() const;  
   
115    /**    /**
116       \brief       \brief
117       Return the shape information for the point data.       Return the shape information for the point data.
# Line 262  class DataAbstract { Line 250  class DataAbstract {
250    setSlice(const DataAbstract* value,    setSlice(const DataAbstract* value,
251             const DataTypes::RegionType& region) = 0;             const DataTypes::RegionType& region) = 0;
252    
   
 //  /**  
 //      \brief  
 //      setTaggedValue  
 //  
 //      Description:  
 //      Assign the given value to the given tag.  
 //  
 //      NB: If the data isn't tagged an exception will be thrown.  
 //  
 //      \param tagKey - Input - Integer key.  
 //      \param value - Input - Single DataArrayView value to be assigned to the tag.  
 //  */  
 //   ESCRIPT_DLL_API  
 //   virtual  
 //   void  
 //   setTaggedValue(int tagKey,  
 //                  const DataArrayView& value);  
   
   
253    /**    /**
254       \brief       \brief
255       setTaggedValue       setTaggedValue
# Line 499  class DataAbstract { Line 467  class DataAbstract {
467    
468   protected:   protected:
469    
470  //  /**    bool isEmpty() const; // a fast test to determine if this object is an instance of DataEmpty
 //     \brief  
 //     Set the pointDataView DataArrayView associated with this object.  
 //  
 //     \param input - Input - The point data view. DataAbstract takes ownership  
 //     of the DataArrayView provided. It will delete it when it is destructed.  
 //  */  
 //   ESCRIPT_DLL_API  
 //   void  
 //   setPointDataView(const DataArrayView& input);  
 //  
 //   ESCRIPT_DLL_API  
 //   void  
 //   resetPointDataView();  
   
   
471    
472    
473    
# Line 554  class DataAbstract { Line 507  class DataAbstract {
507    // The rank of the points stored in this view    // The rank of the points stored in this view
508    int m_rank;    int m_rank;
509    
510      //
511      // Is this an instance of DataEmpty?
512      bool m_isempty;
513  };  };
514    
515    
516  inline  inline
517    bool
518    DataAbstract::isEmpty() const
519    {
520        return m_isempty;
521    }
522    
523    
524    inline
525  DataTypes::ValueType::const_reference  DataTypes::ValueType::const_reference
526  DataAbstract::getDataAtOffset(DataTypes::ValueType::size_type i) const  DataAbstract::getDataAtOffset(DataTypes::ValueType::size_type i) const
527  {  {
# Line 598  inline Line 562  inline
562  int  int
563  DataAbstract::getNumDPPSample() const  DataAbstract::getNumDPPSample() const
564  {  {
565      if (isEmpty())
566      {
567            throw DataException("Error - Operations not permitted on instances of DataEmpty.");
568      }
569    return m_noDataPointsPerSample;    return m_noDataPointsPerSample;
570  }  }
571    
# Line 605  inline Line 573  inline
573  int  int
574  DataAbstract::getNumSamples() const  DataAbstract::getNumSamples() const
575  {  {
576      if (isEmpty())
577      {
578            throw DataException("Error - Operations not permitted on instances of DataEmpty.");
579      }
580    return m_noSamples;    return m_noSamples;
581  }  }
582    
# Line 616  DataAbstract::getFunctionSpace() const Line 588  DataAbstract::getFunctionSpace() const
588    return m_functionSpace;    return m_functionSpace;
589  }  }
590    
 // inline  
 // const  
 // DataArrayView&  
 // DataAbstract::getPointDataView() const  
 // {  
 //   return *(m_pointDataView.get());  
 // }  
   
 // inline  
 // DataArrayView&  
 // DataAbstract::getPointDataView()  
 // {  
 //   return *(m_pointDataView.get());  
 // }  
   
591  inline  inline
592  const DataTypes::ShapeType&  const DataTypes::ShapeType&
593  DataAbstract::getShape() const  DataAbstract::getShape() const
594  {  {
595        if (isEmpty())
596        {
597            throw DataException("Error - Operations not permitted on instances of DataEmpty.");
598        }
599      return m_shape;      return m_shape;
600  }  }
601    
# Line 642  inline Line 603  inline
603  int  int
604  DataAbstract::getRank() const  DataAbstract::getRank() const
605  {  {
606        if (isEmpty())
607        {
608            throw DataException("Error - Operations not permitted on instances of DataEmpty.");
609        }
610      return m_rank;      return m_rank;
611  }  }
612    
613  inline  inline
614  int  int
615  DataAbstract::getNoValues() const  DataAbstract::getNoValues() const
616  {  {  
617        if (isEmpty())
618        {
619            throw DataException("Error - Operations not permitted on instances of DataEmpty.");
620        }
621      return m_novalues;      return m_novalues;
622  }  }
623    
624    
625  } // end of namespace  } // end of namespace
626    
627  #endif  #endif

Legend:
Removed from v.1802  
changed lines
  Added in v.1803

  ViewVC Help
Powered by ViewVC 1.1.26