Changeset 641


Ignore:
Timestamp:
07/17/15 13:58:13 (6 years ago)
Author:
rlacroix
Message:

Use the filter infrastructure to handle field references.

Add a pass-through filter to do so.

Location:
XIOS/trunk/src
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/field.cpp

    r640 r641  
    1818#include "store_filter.hpp" 
    1919#include "file_writer_filter.hpp" 
     20#include "pass_through_filter.hpp" 
    2021 
    2122namespace xios{ 
     
    609610      return(this->last_operation); 
    610611   } 
     612 
     613   //---------------------------------------------------------------- 
     614 
     615   boost::shared_ptr<COutputPin> CField::getInstantDataFilter() 
     616   { 
     617     return instantDataFilter; 
     618   } 
     619 
     620   //---------------------------------------------------------------- 
    611621 
    612622   void CField::solveAllReferenceEnabledField(bool doSending2Sever) 
     
    759769   void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput) 
    760770   { 
     771     if (!areAllReferenceSolved) solveAllReferenceEnabledField(false); 
     772 
    761773     // Start by building a filter which can provide the field's instant data 
    762774     if (!instantDataFilter) 
    763775     { 
     776       // Check if we have a reference on another field 
     777       if (!field_ref.isEmpty()) 
     778       { 
     779         boost::shared_ptr<CPassThroughFilter> passThroughFilter(new CPassThroughFilter(gc)); 
     780         instantDataFilter = passThroughFilter; 
     781         CField* fieldRef = CField::get(field_ref); 
     782         fieldRef->buildFilterGraph(gc, false); 
     783         fieldRef->getInstantDataFilter()->connectOutput(passThroughFilter, 0); 
     784       } 
    764785       // Check if the data is to be read from a file 
    765        if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 
     786       else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 
    766787         instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid)); 
    767788       else // The data might be passed from the model 
  • XIOS/trunk/src/node/field.hpp

    r640 r641  
    9393         template <int N> void getData(CArray<double, N>& _data) const; 
    9494 
     95         boost::shared_ptr<COutputPin> getInstantDataFilter(); 
    9596 
    9697         /// Mutateur /// 
Note: See TracChangeset for help on using the changeset viewer.