Ignore:
Timestamp:
04/12/12 17:02:23 (12 years ago)
Author:
ymipsl
Message:

Suppress access to CObjectFactory class and CTreeManager.

YM

Location:
XIOS/trunk/src/interface/c
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/c/icaxis.cpp

    r345 r346  
    3030      if (!cstr2string(_id, _id_len, id)) return; 
    3131 
    32       *_ret = xios::CObjectFactory::GetObject<xios::CAxis>(id).get(); 
     32      *_ret = xios::CAxis::get(id).get(); 
    3333   } 
    3434    
     
    3838      if (!cstr2string(_id, _id_len, id)) return; 
    3939 
    40       *_ret = xios::CObjectFactory::GetObject<xios::CAxisGroup>(id).get(); 
     40      *_ret = xios::CAxisGroup::get(id).get(); 
    4141   } 
    4242 
     
    4848      if (!cstr2string(_id, _id_len, id)) return; 
    4949 
    50       *_ret = xios::CObjectFactory::HasObject<xios::CAxis>(id); 
     50      *_ret = xios::CAxis::has(id); 
    5151   } 
    5252 
     
    5656      if (!cstr2string(_id, _id_len, id)) return; 
    5757 
    58       *_ret = xios::CObjectFactory::HasObject<xios::CAxisGroup>(id); 
     58      *_ret = xios::CAxisGroup::has(id); 
    5959   } 
    6060    
  • XIOS/trunk/src/interface/c/iccontext.cpp

    r345 r346  
    3434 
    3535      std::vector<boost::shared_ptr<xios::CContext> > def_vector = 
    36             xios::CContext::GetContextGroup()->getChildList(); 
     36            xios::CContext::getRoot()->getChildList(); 
    3737 
    3838      for (std::size_t i = 0; i < def_vector.size(); i++) 
     
    4949   void cxios_context_set_current(XContextPtr context, bool withswap) 
    5050   { 
    51       CTreeManager::SetCurrentContextId(context->getId()); 
     51      CContext::setCurrent(context->getId()); 
    5252   } 
    5353    
     
    6161 
    6262      std::vector<boost::shared_ptr<xios::CContext> > def_vector = 
    63             xios::CContext::GetContextGroup()->getChildList(); 
     63            xios::CContext::getRoot()->getChildList(); 
    6464 
    6565      for (std::size_t i = 0; i < def_vector.size(); i++) 
  • XIOS/trunk/src/interface/c/icdata.cpp

    r345 r346  
    6767    void cxios_context_close_definition() 
    6868   { 
    69      boost::shared_ptr<CContext> context = 
    70             CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 
     69     boost::shared_ptr<CContext> context = CContext::getCurrent() ; 
    7170     context->closeDefinition() ; 
    7271   }   
     
    7473   void cxios_context_finalize() 
    7574   { 
    76      boost::shared_ptr<CContext> context = 
    77             CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 
     75     boost::shared_ptr<CContext> context = CContext::getCurrent() ; 
    7876     context->finalize() ; 
    7977   } 
     
    9189   { 
    9290      std::string fieldid_str; 
    93       boost::shared_ptr<CContext> context = 
    94       CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 
     91      boost::shared_ptr<CContext> context = CContext::getCurrent() ; 
    9592      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;  
    9693       
     
    108105   { 
    109106      std::string fieldid_str; 
    110       boost::shared_ptr<CContext> context = 
    111       CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 
     107      boost::shared_ptr<CContext> context = CContext::getCurrent() ; 
    112108      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
    113109       
     
    124120   { 
    125121      std::string fieldid_str; 
    126       boost::shared_ptr<CContext> context = 
    127       CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 
     122      boost::shared_ptr<CContext> context = CContext::getCurrent() ; 
    128123      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;  
    129124       
     
    141136   { 
    142137      std::string fieldid_str; 
    143       boost::shared_ptr<CContext> context = 
    144       CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 
     138      boost::shared_ptr<CContext> context = CContext::getCurrent() ; 
    145139      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;  
    146140       
     
    160154   { 
    161155      std::string fieldid_str; 
    162       boost::shared_ptr<CContext> context = 
    163       CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 
     156      boost::shared_ptr<CContext> context = CContext::getCurrent() ; 
    164157      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;  
    165158       
     
    179172   { 
    180173      std::string fieldid_str; 
    181       boost::shared_ptr<CContext> context = 
    182       CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 
     174      boost::shared_ptr<CContext> context = CContext::getCurrent() ; 
    183175      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;  
    184176       
  • XIOS/trunk/src/interface/c/icdate.cpp

    r345 r346  
    2626      { 
    2727         CDuration dur = {ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second}; 
    28          boost::shared_ptr<xios::CContext> context = 
    29          xios::CObjectFactory::GetObject<xios::CContext> 
    30             (CObjectFactory::GetCurrentContextId()); 
     28         boost::shared_ptr<xios::CContext> context = CContext::getCurrent() ; 
    3129          
    3230            context->timestep.setValue(dur.toString()); 
     
    4240   void cxios_update_calendar(int step) 
    4341   { 
    44       boost::shared_ptr<xios::CContext> context = 
    45             xios::CObjectFactory::GetObject<xios::CContext> 
    46             (CObjectFactory::GetCurrentContextId()); 
     42      boost::shared_ptr<xios::CContext> context = CContext::getCurrent() ; 
    4743      context->updateCalendar(step) ; 
    4844      context->sendUpdateCalendar(step) ; 
  • XIOS/trunk/src/interface/c/icdomain.cpp

    r345 r346  
    3030      if (!cstr2string(_id, _id_len, id)) return; 
    3131 
    32       *_ret = xios::CObjectFactory::GetObject<xios::CDomain>(id).get(); 
     32      *_ret = CDomain::get(id).get(); 
    3333   } 
    3434    
     
    3838      if (!cstr2string(_id, _id_len, id)) return; 
    3939 
    40       *_ret = xios::CObjectFactory::GetObject<xios::CDomainGroup>(id).get(); 
     40      *_ret = CDomainGroup::get(id).get(); 
    4141   } 
    4242 
     
    4848      if (!cstr2string(_id, _id_len, id)) return; 
    4949 
    50       *_ret = xios::CObjectFactory::HasObject<xios::CDomain>(id); 
     50      *_ret = CDomain::has(id); 
    5151   } 
    5252 
     
    5656      if (!cstr2string(_id, _id_len, id)) return; 
    5757 
    58       *_ret = xios::CObjectFactory::HasObject<xios::CDomainGroup>(id); 
     58      *_ret = CDomainGroup::has(id); 
    5959   } 
    6060} // extern "C" 
  • XIOS/trunk/src/interface/c/icfield.cpp

    r345 r346  
    3232      if (!cstr2string(_id, _id_len, id)) return; 
    3333 
    34       *_ret = xios::CObjectFactory::GetObject<xios::CField>(id).get(); 
     34      *_ret = CField::get(id).get(); 
    3535   } 
    3636    
     
    4040      if (!cstr2string(_id, _id_len, id)) return; 
    4141 
    42       *_ret = xios::CObjectFactory::GetObject<xios::CFieldGroup>(id).get(); 
     42      *_ret = CFieldGroup::get(id).get(); 
    4343   } 
    4444 
     
    5151      if (!cstr2string(_id, _id_len, id)) return; 
    5252 
    53       *_ret = xios::CObjectFactory::HasObject<xios::CField>(id); 
     53      *_ret = CField::has(id); 
    5454   } 
    5555 
     
    5959      if (!cstr2string(_id, _id_len, id)) return; 
    6060 
    61       *_ret = xios::CObjectFactory::HasObject<xios::CFieldGroup>(id); 
     61      *_ret = CFieldGroup::has(id); 
    6262   } 
    6363 
  • XIOS/trunk/src/interface/c/icfile.cpp

    r345 r346  
    3030      if (!cstr2string(_id, _id_len, id)) return; 
    3131 
    32       *_ret = xios::CObjectFactory::GetObject<xios::CFile>(id).get(); 
     32      *_ret = CFile::get(id).get(); 
    3333   } 
    3434    
     
    3838      if (!cstr2string(_id, _id_len, id)) return; 
    3939 
    40       *_ret = xios::CObjectFactory::GetObject<xios::CFileGroup>(id).get(); 
     40      *_ret = CFileGroup::get(id).get(); 
    4141   } 
    4242 
     
    4848      if (!cstr2string(_id, _id_len, id)) return; 
    4949 
    50       *_ret = xios::CObjectFactory::HasObject<xios::CFile>(id); 
     50      *_ret = CFile::has(id); 
    5151   } 
    5252 
     
    5656      if (!cstr2string(_id, _id_len, id)) return; 
    5757 
    58       *_ret = xios::CObjectFactory::HasObject<xios::CFileGroup>(id); 
     58      *_ret = CFileGroup::has(id); 
    5959   } 
    6060} // extern "C" 
  • XIOS/trunk/src/interface/c/icgrid.cpp

    r345 r346  
    3030      if (!cstr2string(_id, _id_len, id)) return; 
    3131 
    32       *_ret = xios::CObjectFactory::GetObject<xios::CGrid>(id).get(); 
     32      *_ret = CGrid::get(id).get(); 
    3333   } 
    3434    
     
    3838      if (!cstr2string(_id, _id_len, id)) return; 
    3939 
    40       *_ret = xios::CObjectFactory::GetObject<xios::CGridGroup>(id).get(); 
     40      *_ret = CGridGroup::get(id).get(); 
    4141   } 
    4242 
     
    4848      if (!cstr2string(_id, _id_len, id)) return; 
    4949 
    50       *_ret = xios::CObjectFactory::HasObject<xios::CGrid>(id); 
     50      *_ret = CGrid::has(id); 
    5151   } 
    5252 
     
    5656      if (!cstr2string(_id, _id_len, id)) return; 
    5757 
    58       *_ret = xios::CObjectFactory::HasObject<xios::CGridGroup>(id); 
     58      *_ret = CGridGroup::has(id); 
    5959   } 
    6060} // extern "C" 
  • XIOS/trunk/src/interface/c/icxml_tree.cpp

    r345 r346  
    241241   // ----------------------- Affichage de l'arborescence ---------------------- 
    242242    
    243    void cxios_xml_tree_show   (const char * filename, int filename_size)  
    244    { 
    245       std::string filename_str; 
    246       try 
    247       { 
    248          if (cstr2string(filename, filename_size, filename_str)) 
    249             xios::CTreeManager::PrintTreeToFile(filename_str); 
    250          else 
    251             xios::CTreeManager::PrintTreeToStream(std::clog); 
    252       } 
    253       catch (xios::CException & exc) 
    254       { 
    255          std::cerr << exc.getMessage() << std::endl; 
    256          exit (EXIT_FAILURE); 
    257       } 
    258    } 
     243//   void cxios_xml_tree_show   (const char * filename, int filename_size)  
     244//   { 
     245//      std::string filename_str; 
     246//      try 
     247//      { 
     248//         if (cstr2string(filename, filename_size, filename_str)) 
     249//            xios::CTreeManager::PrintTreeToFile(filename_str); 
     250//         else 
     251//            xios::CTreeManager::PrintTreeToStream(std::clog); 
     252//      } 
     253//      catch (xios::CException & exc) 
     254//      { 
     255//         std::cerr << exc.getMessage() << std::endl; 
     256//         exit (EXIT_FAILURE); 
     257//      } 
     258//  } 
    259259      
    260260    
    261261   // ----------------------- Parsing de document xml -------------------------- 
    262262    
    263    void cxios_xml_parse_file  (const char * filename  , int filename_size) 
    264    { 
    265       std::string filename_str;  
    266       if (!cstr2string(filename, filename_size, filename_str)) return; 
    267  
    268       try 
    269       { 
    270          xios::CTreeManager::ParseFile(filename_str); 
    271       } 
    272       catch (xios::CException & exc) 
    273       { 
    274          std::cerr << exc.getMessage() << std::endl; 
    275          exit (EXIT_FAILURE); 
    276       } 
    277    } 
    278     
    279    void cxios_xml_parse_string(const char * xmlcontent, int xmlcontent_size) 
    280    { 
    281       std::string xmlcontent_str;  
    282       if (!cstr2string(xmlcontent, xmlcontent_size, xmlcontent_str)) return; 
    283  
    284       try 
    285       { 
    286          xios::CTreeManager::ParseString(xmlcontent_str); 
    287       } 
    288       catch (xios::CException & exc) 
    289       { 
    290          std::cerr << exc.getMessage() << std::endl; 
    291          exit (EXIT_FAILURE); 
    292       } 
    293    } 
     263//   void cxios_xml_parse_file  (const char * filename  , int filename_size)// 
     264//   { 
     265//      std::string filename_str;  
     266//      if (!cstr2string(filename, filename_size, filename_str)) return; 
     267// 
     268//      try 
     269//      { 
     270//         xios::CTreeManager::ParseFile(filename_str); 
     271//      } 
     272//      catch (xios::CException & exc) 
     273//      { 
     274//         std::cerr << exc.getMessage() << std::endl; 
     275//         exit (EXIT_FAILURE); 
     276//      } 
     277//   } 
     278    
     279//   void cxios_xml_parse_string(const char * xmlcontent, int xmlcontent_size) 
     280//   { 
     281//      std::string xmlcontent_str;  
     282//      if (!cstr2string(xmlcontent, xmlcontent_size, xmlcontent_str)) return; 
     283// 
     284//      try 
     285//      { 
     286//         xios::CTreeManager::ParseString(xmlcontent_str); 
     287//      } 
     288//      catch (xios::CException & exc) 
     289//      { 
     290//         std::cerr << exc.getMessage() << std::endl; 
     291//         exit (EXIT_FAILURE); 
     292//      } 
     293//   } 
    294294    
    295295 
Note: See TracChangeset for help on using the changeset viewer.