Changeset 2509 for XIOS3/trunk


Ignore:
Timestamp:
06/02/23 14:05:29 (13 months ago)
Author:
jderouillat
Message:

Add a comparison operator to the filesToWrite_ std:: set to force the file creation ordering

Location:
XIOS3/trunk/src/node
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/node/context.hpp

    r2507 r2509  
    1515#include "server_context.hpp" 
    1616#include "event_scheduler.hpp" 
    17  
     17#include "file.hpp" 
    1818 
    1919namespace xios 
     
    299299        void registerFileToWrite(CFile* file) { filesToWrite_.insert(file); } // Add a file that need to be write for example to create headers 
    300300      private:   
    301         std::set<CFile*> filesToWrite_ ;   
     301        std::set<CFile*,FilePtrCompare> filesToWrite_ ;   
    302302 
    303303      private: 
  • XIOS3/trunk/src/node/file.hpp

    r2507 r2509  
    228228   ///-------------------------------------------------------------- 
    229229 
     230   struct FilePtrCompare { 
     231     bool operator() (CFile const *l, CFile const *r) const { 
     232       return l->getFileOutputName() < r->getFileOutputName(); 
     233     } 
     234   }; 
    230235} // namespace xios 
    231236 
Note: See TracChangeset for help on using the changeset viewer.