Ignore:
Timestamp:
05/21/12 17:57:22 (12 years ago)
Author:
ymipsl
Message:
  • Supress lot of shared_ptr
  • instrument code for vampir-trace and timer diagnostic

YM

File:
1 edited

Legend:

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

    r346 r347  
    4545   } 
    4646 
    47    boost::shared_ptr<CFieldGroup> CFile::getVirtualFieldGroup(void) const 
     47   CFieldGroup* CFile::getVirtualFieldGroup(void) const 
    4848   { 
    4949      return (this->vFieldGroup); 
    5050   } 
    5151 
    52    std::vector<boost::shared_ptr<CField> > CFile::getAllFields(void) const 
     52   std::vector<CField*> CFile::getAllFields(void) const 
    5353   { 
    5454      return (this->vFieldGroup->getAllChildren()); 
     
    5757   //---------------------------------------------------------------- 
    5858 
    59    std::vector<boost::shared_ptr<CField> > CFile::getEnabledFields 
    60       (int default_outputlevel, int default_level, bool default_enabled) 
     59   std::vector<CField*> CFile::getEnabledFields(int default_outputlevel,  
     60                                                int default_level, 
     61                                                bool default_enabled) 
    6162   { 
    6263      if (!this->enabledFields.empty()) 
     
    6566      const int _outputlevel = 
    6667         (!output_level.isEmpty()) ? output_level.getValue() : default_outputlevel; 
    67       std::vector<boost::shared_ptr<CField> >::iterator it; 
     68      std::vector<CField*>::iterator it; 
    6869      this->enabledFields = this->getAllFields(); 
    6970 
    70       std::vector<boost::shared_ptr<CField> > newEnabledFields; 
     71      std::vector<CField*> newEnabledFields; 
    7172       
    7273      for ( it = this->enabledFields.begin() ; it != this->enabledFields.end(); it++ ) 
     
    112113   //---------------------------------------------------------------- 
    113114 
    114    void CFile::setVirtualFieldGroup(boost::shared_ptr<CFieldGroup> newVFieldGroup) 
     115   void CFile::setVirtualFieldGroup(CFieldGroup* newVFieldGroup) 
    115116   {  
    116117      this->vFieldGroup = newVFieldGroup;  
     
    127128   bool CFile::isSyncTime(void) 
    128129   { 
    129      shared_ptr<CContext> context = CContext::getCurrent() ; 
     130     CContext* context = CContext::getCurrent() ; 
    130131     CDate& currentDate=context->calendar->getCurrentDate() ; 
    131132     if (! sync_freq.isEmpty()) 
     
    142143   void CFile::initFile(void) 
    143144   { 
    144       shared_ptr<CContext> context = CContext::getCurrent() ; 
     145      CContext* context = CContext::getCurrent() ; 
    145146      CDate& currentDate=context->calendar->getCurrentDate() ; 
    146147       
     
    163164   bool CFile::checkSync(void) 
    164165   { 
    165      shared_ptr<CContext> context = CContext::getCurrent() ; 
     166     CContext* context = CContext::getCurrent() ; 
    166167     CDate& currentDate=context->calendar->getCurrentDate() ; 
    167168     if (! sync_freq.isEmpty()) 
     
    180181    bool CFile::checkSplit(void) 
    181182    { 
    182       shared_ptr<CContext> context = CContext::getCurrent() ; 
     183      CContext* context = CContext::getCurrent() ; 
    183184      CDate& currentDate=context->calendar->getCurrentDate() ; 
    184185      if (! split_freq.isEmpty()) 
     
    188189          *lastSplit=currentDate-outputFreq ; 
    189190         
    190           std::vector<boost::shared_ptr<CField> >::iterator it, end = this->enabledFields.end(); 
     191          std::vector<CField*>::iterator it, end = this->enabledFields.end(); 
    191192          for (it = this->enabledFields.begin() ;it != end; it++)  (*it)->resetNStep() ; 
    192193          createHeader() ; 
     
    199200   void CFile::createHeader(void) 
    200201   { 
    201       shared_ptr<CContext> context = CContext::getCurrent() ; 
     202      CContext* context = CContext::getCurrent() ; 
    202203      CDate& currentDate=context->calendar->getCurrentDate() ; 
    203204       
    204       std::vector<boost::shared_ptr<CField> >::iterator it, end = this->enabledFields.end(); 
     205      std::vector<CField*>::iterator it, end = this->enabledFields.end(); 
    205206 
    206207      AllDomainEmpty=true ; 
     
    208209      for (it = this->enabledFields.begin() ;it != end; it++) 
    209210      { 
    210          boost::shared_ptr<CField> field = *it; 
     211         CField* field = *it; 
    211212         AllDomainEmpty&=field->grid->domain->isEmpty() ; 
    212          setDomain.insert(field->grid->domain.get()) ; 
     213         setDomain.insert(field->grid->domain) ; 
    213214      } 
    214215      nbDomain=setDomain.size() ; 
     
    260261         for (it = this->enabledFields.begin() ;it != end; it++) 
    261262         { 
    262             boost::shared_ptr<CField> field = *it; 
     263            CField* field = *it; 
    263264            this->data_out->writeFieldGrid(field); 
    264265         } 
     
    266267         for (it = this->enabledFields.begin() ;it != end; it++) 
    267268         { 
    268             boost::shared_ptr<CField> field = *it; 
     269            CField* field = *it; 
    269270            this->data_out->writeField(field); 
    270271         } 
     
    306307         oss << " id=\"" << this->getId() << "\" "; 
    307308      oss << SuperClassAttribute::toString() << ">" << std::endl; 
    308       if (this->getVirtualFieldGroup().get() != NULL) 
     309      if (this->getVirtualFieldGroup() != NULL) 
    309310         oss << *this->getVirtualFieldGroup() << std::endl; 
    310311      oss << "</" << CFile::GetName() << " >"; 
     
    325326   { 
    326327      // Résolution des héritages par référence de chacun des champs contenus dans le fichier. 
    327       std::vector<boost::shared_ptr<CField> > allF = this->getAllFields(); 
     328      std::vector<CField*> allF = this->getAllFields(); 
    328329      for (unsigned int i = 0; i < allF.size(); i++) 
    329330         allF[i]->solveRefInheritance(); 
     
    351352   { 
    352353      ENodeType genum = CFileGroup::GetType(); 
    353       bool hasVFG = (this->getVirtualFieldGroup().get() != NULL); 
     354      bool hasVFG = (this->getVirtualFieldGroup() != NULL); 
    354355      SuperClass::toBinary(os); 
    355356       
     
    381382   } 
    382383    
    383    shared_ptr<CField> CFile::addField(const string& id) 
     384   CField* CFile::addField(const string& id) 
    384385   { 
    385386     return vFieldGroup->createChild(id) ; 
    386387   } 
    387388 
    388    shared_ptr<CFieldGroup> CFile::addFieldGroup(const string& id) 
     389   CFieldGroup* CFile::addFieldGroup(const string& id) 
    389390   { 
    390391     return vFieldGroup->createChildGroup(id) ; 
     
    394395   void CFile::sendAddField(const string& id) 
    395396   { 
    396     shared_ptr<CContext> context=CContext::getCurrent() ; 
     397    CContext* context=CContext::getCurrent() ; 
    397398     
    398399    if (! context->hasServer ) 
     
    416417   void CFile::sendAddFieldGroup(const string& id) 
    417418   { 
    418     shared_ptr<CContext> context=CContext::getCurrent() ; 
     419    CContext* context=CContext::getCurrent() ; 
    419420    if (! context->hasServer ) 
    420421    { 
Note: See TracChangeset for help on using the changeset viewer.