Changeset 346 for XIOS/trunk/src/interface
- Timestamp:
- 04/12/12 17:02:23 (12 years ago)
- Location:
- XIOS/trunk/src/interface/c
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/interface/c/icaxis.cpp
r345 r346 30 30 if (!cstr2string(_id, _id_len, id)) return; 31 31 32 *_ret = xios::C ObjectFactory::GetObject<xios::CAxis>(id).get();32 *_ret = xios::CAxis::get(id).get(); 33 33 } 34 34 … … 38 38 if (!cstr2string(_id, _id_len, id)) return; 39 39 40 *_ret = xios::C ObjectFactory::GetObject<xios::CAxisGroup>(id).get();40 *_ret = xios::CAxisGroup::get(id).get(); 41 41 } 42 42 … … 48 48 if (!cstr2string(_id, _id_len, id)) return; 49 49 50 *_ret = xios::C ObjectFactory::HasObject<xios::CAxis>(id);50 *_ret = xios::CAxis::has(id); 51 51 } 52 52 … … 56 56 if (!cstr2string(_id, _id_len, id)) return; 57 57 58 *_ret = xios::C ObjectFactory::HasObject<xios::CAxisGroup>(id);58 *_ret = xios::CAxisGroup::has(id); 59 59 } 60 60 -
XIOS/trunk/src/interface/c/iccontext.cpp
r345 r346 34 34 35 35 std::vector<boost::shared_ptr<xios::CContext> > def_vector = 36 xios::CContext:: GetContextGroup()->getChildList();36 xios::CContext::getRoot()->getChildList(); 37 37 38 38 for (std::size_t i = 0; i < def_vector.size(); i++) … … 49 49 void cxios_context_set_current(XContextPtr context, bool withswap) 50 50 { 51 C TreeManager::SetCurrentContextId(context->getId());51 CContext::setCurrent(context->getId()); 52 52 } 53 53 … … 61 61 62 62 std::vector<boost::shared_ptr<xios::CContext> > def_vector = 63 xios::CContext:: GetContextGroup()->getChildList();63 xios::CContext::getRoot()->getChildList(); 64 64 65 65 for (std::size_t i = 0; i < def_vector.size(); i++) -
XIOS/trunk/src/interface/c/icdata.cpp
r345 r346 67 67 void cxios_context_close_definition() 68 68 { 69 boost::shared_ptr<CContext> context = 70 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 69 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 71 70 context->closeDefinition() ; 72 71 } … … 74 73 void cxios_context_finalize() 75 74 { 76 boost::shared_ptr<CContext> context = 77 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 75 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 78 76 context->finalize() ; 79 77 } … … 91 89 { 92 90 std::string fieldid_str; 93 boost::shared_ptr<CContext> context = 94 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 91 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 95 92 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 96 93 … … 108 105 { 109 106 std::string fieldid_str; 110 boost::shared_ptr<CContext> context = 111 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 107 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 112 108 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 113 109 … … 124 120 { 125 121 std::string fieldid_str; 126 boost::shared_ptr<CContext> context = 127 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 122 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 128 123 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 129 124 … … 141 136 { 142 137 std::string fieldid_str; 143 boost::shared_ptr<CContext> context = 144 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 138 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 145 139 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 146 140 … … 160 154 { 161 155 std::string fieldid_str; 162 boost::shared_ptr<CContext> context = 163 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 156 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 164 157 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 165 158 … … 179 172 { 180 173 std::string fieldid_str; 181 boost::shared_ptr<CContext> context = 182 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 174 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 183 175 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 184 176 -
XIOS/trunk/src/interface/c/icdate.cpp
r345 r346 26 26 { 27 27 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() ; 31 29 32 30 context->timestep.setValue(dur.toString()); … … 42 40 void cxios_update_calendar(int step) 43 41 { 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() ; 47 43 context->updateCalendar(step) ; 48 44 context->sendUpdateCalendar(step) ; -
XIOS/trunk/src/interface/c/icdomain.cpp
r345 r346 30 30 if (!cstr2string(_id, _id_len, id)) return; 31 31 32 *_ret = xios::CObjectFactory::GetObject<xios::CDomain>(id).get();32 *_ret = CDomain::get(id).get(); 33 33 } 34 34 … … 38 38 if (!cstr2string(_id, _id_len, id)) return; 39 39 40 *_ret = xios::CObjectFactory::GetObject<xios::CDomainGroup>(id).get();40 *_ret = CDomainGroup::get(id).get(); 41 41 } 42 42 … … 48 48 if (!cstr2string(_id, _id_len, id)) return; 49 49 50 *_ret = xios::CObjectFactory::HasObject<xios::CDomain>(id);50 *_ret = CDomain::has(id); 51 51 } 52 52 … … 56 56 if (!cstr2string(_id, _id_len, id)) return; 57 57 58 *_ret = xios::CObjectFactory::HasObject<xios::CDomainGroup>(id);58 *_ret = CDomainGroup::has(id); 59 59 } 60 60 } // extern "C" -
XIOS/trunk/src/interface/c/icfield.cpp
r345 r346 32 32 if (!cstr2string(_id, _id_len, id)) return; 33 33 34 *_ret = xios::CObjectFactory::GetObject<xios::CField>(id).get();34 *_ret = CField::get(id).get(); 35 35 } 36 36 … … 40 40 if (!cstr2string(_id, _id_len, id)) return; 41 41 42 *_ret = xios::CObjectFactory::GetObject<xios::CFieldGroup>(id).get();42 *_ret = CFieldGroup::get(id).get(); 43 43 } 44 44 … … 51 51 if (!cstr2string(_id, _id_len, id)) return; 52 52 53 *_ret = xios::CObjectFactory::HasObject<xios::CField>(id);53 *_ret = CField::has(id); 54 54 } 55 55 … … 59 59 if (!cstr2string(_id, _id_len, id)) return; 60 60 61 *_ret = xios::CObjectFactory::HasObject<xios::CFieldGroup>(id);61 *_ret = CFieldGroup::has(id); 62 62 } 63 63 -
XIOS/trunk/src/interface/c/icfile.cpp
r345 r346 30 30 if (!cstr2string(_id, _id_len, id)) return; 31 31 32 *_ret = xios::CObjectFactory::GetObject<xios::CFile>(id).get();32 *_ret = CFile::get(id).get(); 33 33 } 34 34 … … 38 38 if (!cstr2string(_id, _id_len, id)) return; 39 39 40 *_ret = xios::CObjectFactory::GetObject<xios::CFileGroup>(id).get();40 *_ret = CFileGroup::get(id).get(); 41 41 } 42 42 … … 48 48 if (!cstr2string(_id, _id_len, id)) return; 49 49 50 *_ret = xios::CObjectFactory::HasObject<xios::CFile>(id);50 *_ret = CFile::has(id); 51 51 } 52 52 … … 56 56 if (!cstr2string(_id, _id_len, id)) return; 57 57 58 *_ret = xios::CObjectFactory::HasObject<xios::CFileGroup>(id);58 *_ret = CFileGroup::has(id); 59 59 } 60 60 } // extern "C" -
XIOS/trunk/src/interface/c/icgrid.cpp
r345 r346 30 30 if (!cstr2string(_id, _id_len, id)) return; 31 31 32 *_ret = xios::CObjectFactory::GetObject<xios::CGrid>(id).get();32 *_ret = CGrid::get(id).get(); 33 33 } 34 34 … … 38 38 if (!cstr2string(_id, _id_len, id)) return; 39 39 40 *_ret = xios::CObjectFactory::GetObject<xios::CGridGroup>(id).get();40 *_ret = CGridGroup::get(id).get(); 41 41 } 42 42 … … 48 48 if (!cstr2string(_id, _id_len, id)) return; 49 49 50 *_ret = xios::CObjectFactory::HasObject<xios::CGrid>(id);50 *_ret = CGrid::has(id); 51 51 } 52 52 … … 56 56 if (!cstr2string(_id, _id_len, id)) return; 57 57 58 *_ret = xios::CObjectFactory::HasObject<xios::CGridGroup>(id);58 *_ret = CGridGroup::has(id); 59 59 } 60 60 } // extern "C" -
XIOS/trunk/src/interface/c/icxml_tree.cpp
r345 r346 241 241 // ----------------------- Affichage de l'arborescence ---------------------- 242 242 243 void cxios_xml_tree_show (const char * filename, int filename_size)244 {245 std::string filename_str;246 try247 {248 if (cstr2string(filename, filename_size, filename_str))249 xios::CTreeManager::PrintTreeToFile(filename_str);250 else251 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 // } 259 259 260 260 261 261 // ----------------------- Parsing de document xml -------------------------- 262 262 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 try269 {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 try285 {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 // } 294 294 295 295
Note: See TracChangeset
for help on using the changeset viewer.