/[escript]/branches/schroedinger/escript/src/Data.cpp
ViewVC logotype

Diff of /branches/schroedinger/escript/src/Data.cpp

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

revision 1888 by jfenwick, Wed Oct 15 04:00:21 2008 UTC revision 1889 by jfenwick, Thu Oct 16 05:57:09 2008 UTC
# Line 574  Data::expand() Line 574  Data::expand()
574    } else if (isEmpty()) {    } else if (isEmpty()) {
575      throw DataException("Error - Expansion of DataEmpty not possible.");      throw DataException("Error - Expansion of DataEmpty not possible.");
576    } else if (isLazy()) {    } else if (isLazy()) {
577      DataReady_ptr res=m_data->resolve();      resolve();
578      m_data=res;      expand();       // resolve might not give us expanded data
579    } else {    } else {
580      throw DataException("Error - Expansion not implemented for this Data type.");      throw DataException("Error - Expansion not implemented for this Data type.");
581    }    }
# Line 596  Data::tag() Line 596  Data::tag()
596      throw DataException("Error - Creating tag data from DataExpanded not possible.");      throw DataException("Error - Creating tag data from DataExpanded not possible.");
597    } else if (isEmpty()) {    } else if (isEmpty()) {
598      throw DataException("Error - Creating tag data from DataEmpty not possible.");      throw DataException("Error - Creating tag data from DataEmpty not possible.");
599      } else if (isLazy()) {
600         DataAbstract_ptr res=m_data->resolve();
601         if (m_data->isExpanded())
602         {
603        throw DataException("Error - data would resolve to DataExpanded, tagging is not possible.");
604         }
605         m_data=res;    
606         tag();
607    } else {    } else {
608      throw DataException("Error - Tagging not implemented for this Data type.");      throw DataException("Error - Tagging not implemented for this Data type.");
609    }    }
610  }  }
611    
612    void
613    Data::resolve()
614    {
615      if (isLazy())
616      {
617         m_data=m_data->resolve();
618      }
619    }
620    
621    
622  Data  Data
623  Data::oneOver() const  Data::oneOver() const
624  {  {

Legend:
Removed from v.1888  
changed lines
  Added in v.1889

  ViewVC Help
Powered by ViewVC 1.1.26