Ignore:
Timestamp:
07/29/10 10:07:56 (15 years ago)
Author:
Mathieu Morlighem
Message:

outputfile is now loaded step by step to save memory. the file is open once and closed at the end of the solution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Container/Parameters.cpp

    r4855 r4873  
    309309}
    310310/*}}}*/
     311/*FUNCTION Parameters::FindParam(FILE** pfid,int enum_type){{{1*/
     312int   Parameters::FindParam(FILE** pfid,int enum_type){
     313
     314        /*Go through a dataset, and find a Param* object
     315         *which parameter name is "name" : */
     316
     317        vector<Object*>::iterator object;
     318        Param* param=NULL;
     319
     320        int found=0;
     321
     322        for ( object=objects.begin() ; object < objects.end(); object++ ){
     323
     324                /*Ok, this object is a parameter, recover it and ask which name it has: */
     325                param=(Param*)(*object);
     326
     327                if(param->EnumType()==enum_type){
     328                        /*Ok, this is the one! Recover the value of this parameter: */
     329                        param->GetParameterValue(pfid);
     330                        found=1;
     331                        break;
     332                }
     333        }
     334        return found;
     335}
     336/*}}}*/
    311337
    312338/*FUNCTION Parameters::SetParam(bool boolean,int enum_type);{{{1*/
     
    418444}
    419445/*}}}*/
     446/*FUNCTION Parameters::SetParam(FILE* fid,int enum_type);{{{1*/
     447void   Parameters::SetParam(FILE* fid,int enum_type){
     448
     449        Param* param=NULL;
     450
     451        /*first, figure out if the param has already been created: */
     452        param=(Param*)this->FindParamObject(enum_type);
     453
     454        if(param) param->SetValue(fid); //already exists, just set it.
     455        else this->AddObject(new FileParam(enum_type,fid)); //just add the new parameter.
     456}
     457/*}}}*/
    420458
    421459/*FUNCTION Parameters::FindParamObject{{{1*/
Note: See TracChangeset for help on using the changeset viewer.