/[escript]/trunk/escript/src/Utils.cpp
ViewVC logotype

Diff of /trunk/escript/src/Utils.cpp

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

revision 2798 by jfenwick, Wed Nov 25 01:24:51 2009 UTC revision 2799 by jfenwick, Thu Dec 3 01:35:08 2009 UTC
# Line 518  bool append) Line 518  bool append)
518  }  }
519    
520    
521    void
522    resolveGroup(boost::python::object obj)
523    {
524        int len=0;
525        try
526        {
527           len=boost::python::extract<int>(obj.attr("__len__")());
528        }
529        catch(...)
530        {
531           PyErr_Clear();       // tell python the error isn't there anymore
532           throw DataException("Error - resolveGroup expects a sequence object.");
533        }
534        std::vector<DataLazy*> dats;
535        for (int i=0;i<len;++i)
536        {
537            Data* p=0;
538            try
539            {
540                p=boost::python::extract<Data*>(obj[i]);
541            }
542            catch(...)
543            {
544                PyErr_Clear();
545                throw DataException("Error - resolveGroup only accepts Data objects.");
546            }
547            if (p->isLazy())
548            {
549                dats.push_back(dynamic_cast<DataLazy*>(p->borrowData()));
550            }
551        }
552        if (dats.size()>0)
553        {
554            dats[0]->resolveGroupWorker(dats);
555        }
556    }
557    
558  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.2798  
changed lines
  Added in v.2799

  ViewVC Help
Powered by ViewVC 1.1.26