- Timestamp:
- 04/12/12 17:02:23 (12 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/client.cpp
r345 r346 129 129 void CClient::registerContext(const string& id,MPI_Comm contextComm) 130 130 { 131 C ObjectFactory::SetCurrentContextId(id);132 shared_ptr<CContext> context=C TreeManager::CreateContext(id) ;131 CContext::setCurrent(id) ; 132 shared_ptr<CContext> context=CContext::create(id) ; 133 133 134 134 if (!CXios::isServer) -
XIOS/trunk/src/context_server.cpp
r345 r346 167 167 int rank ; 168 168 list<CEventServer::SSubEvent>::iterator it ; 169 C TreeManager::SetCurrentContextId(context->getId()) ;169 CContext::setCurrent(context->getId()) ; 170 170 171 171 if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE) -
XIOS/trunk/src/cxios.cpp
r345 r346 4 4 #include "client.hpp" 5 5 #include "server.hpp" 6 #include "tree_manager.hpp" 6 //#include "tree_manager.hpp" 7 #include "xml_parser.hpp" 7 8 #include <boost/functional/hash.hpp> 8 9 #include <mpi.h> … … 25 26 void CXios::initialize() 26 27 { 27 CTreeManager::ParseFile(rootFile);28 parseFile(rootFile); 28 29 usingServer=getin<bool>("using_server",false) ; 29 30 usingOasis=getin<bool>("using_oasis",false) ; … … 65 66 } 66 67 68 void CXios::parseFile(const string& filename) 69 { 70 xml::CXMLParser::ParseFile(filename); 71 } 72 67 73 68 74 } -
XIOS/trunk/src/cxios.hpp
r335 r346 20 20 static void initServerSide(void) ; 21 21 static void clientFinalize(void) ; 22 static void parseFile(const string& filename) ; 22 23 23 24 template <typename T> -
XIOS/trunk/src/cxios_impl.hpp
r335 r346 4 4 #include "xmlioserver_spl.hpp" 5 5 #include "variable.hpp" 6 #include "object_template_impl.hpp" 6 7 7 8 namespace xios … … 10 11 T CXios::getin(const string& id) 11 12 { 12 return C ObjectFactory::GetObject<CVariable>("xios",id)->getData<T>() ;13 return CVariable::get("xios",id)->getData<T>() ; 13 14 } 14 15 … … 16 17 T CXios::getin(const string& id, const T& defaultValue) 17 18 { 18 if (CObjectFactory::HasObject<CVariable>("xios",id)) 19 return CObjectFactory::GetObject<CVariable>("xios",id)->getData<T>() ; 19 if (CVariable::has("xios",id)) return CVariable::get("xios",id)->getData<T>() ; 20 20 else return defaultValue ; 21 21 } -
XIOS/trunk/src/data_output.cpp
r345 r346 23 23 if (grid->axis_ref.isEmpty()) 24 24 { 25 this->writeGrid 26 (CObjectFactory::GetObject<CDomain>(grid->domain_ref.getValue())); 25 this->writeGrid(CDomain::get(grid->domain_ref.getValue())); 27 26 } 28 27 else 29 28 { 30 this->writeGrid 31 (CObjectFactory::GetObject<CDomain>(grid->domain_ref.getValue()), 32 CObjectFactory::GetObject<CAxis>(grid->axis_ref.getValue())); 29 this->writeGrid(CDomain::get(grid->domain_ref.getValue()), 30 CAxis::get(grid->axis_ref.getValue())); 33 31 } 34 32 } … … 75 73 (const boost::shared_ptr<CField> field) 76 74 { 77 boost::shared_ptr<CContext> context = 78 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 75 boost::shared_ptr<CContext> context = CContext::getCurrent() ; 79 76 boost::shared_ptr<CCalendar> calendar = context->getCalendar(); 80 77 … … 95 92 void CDataOutput::writeFieldData(const boost::shared_ptr<CField> field) 96 93 { 97 boost::shared_ptr<CGrid> grid = 98 CObjectFactory::GetObject<CGrid>(field->grid_ref.getValue()); 99 boost::shared_ptr<CDomain> domain = 100 CObjectFactory::GetObject<CDomain>(grid->domain_ref.getValue()); 94 boost::shared_ptr<CGrid> grid = CGrid::get(field->grid_ref.getValue()); 95 boost::shared_ptr<CDomain> domain = CDomain::get(grid->domain_ref.getValue()); 101 96 102 97 // if (domain->isEmpty()) return; -
XIOS/trunk/src/field_impl.hpp
r345 r346 23 23 bool CField::updateData(const ARRAY(double, N) _data) 24 24 { 25 shared_ptr<CContext> context=C ObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());25 shared_ptr<CContext> context=CContext::getCurrent(); 26 26 const CDate & currDate = context->getCalendar()->getCurrentDate(); 27 27 const CDate opeDate = *last_operation + freq_operation; -
XIOS/trunk/src/generate_fortran_interface.cpp
r345 r346 11 11 string path="./interface/" ; 12 12 13 CContext* context=C TreeManager::CreateContext("interface").get();13 CContext* context=CContext::create("interface").get(); 14 14 CAxis axis ; 15 15 CAxisGroup axisgroup ; -
XIOS/trunk/src/group_parser.hpp
r335 r346 67 67 } 68 68 69 DEBUG(<< "Dans le contexte \'" << C ObjectFactory::GetCurrentContextId()69 DEBUG(<< "Dans le contexte \'" << CContext::getCurrent()->getId() 70 70 << "\', un objet de type \'" << V::GetName() 71 71 << "\' ne peut contenir qu'un objet de type \'" << V::GetName() -
XIOS/trunk/src/group_template.hpp
r345 r346 66 66 // static boost::shared_ptr<V> create(const string& id=string("")) ; 67 67 boost::shared_ptr<U> createChild(const string& id="") ; 68 void addChild(shared_ptr<U> child) ; 68 69 boost::shared_ptr<V> createChildGroup(const string& id="") ; 70 void addChildGroup(shared_ptr<V> childGroup) ; 69 71 static bool dispatchEvent(CEventServer& event) ; 70 72 void sendCreateChild(const string& id="") ; -
XIOS/trunk/src/group_template_impl.hpp
r345 r346 341 341 ///-------------------------------------------------------------- 342 342 343 343 344 template <class U, class V, class W> 344 345 boost::shared_ptr<U> CGroupTemplate<U, V, W>::createChild(const string& id) … … 346 347 return CGroupFactory::CreateChild<V>(this->get(), id) ; 347 348 } 349 350 template <class U, class V, class W> 351 void CGroupTemplate<U, V, W>::addChild(shared_ptr<U> child) 352 { 353 return CGroupFactory::AddChild<V>(this->get(),child) ; 354 } 348 355 349 356 template <class U, class V, class W> … … 353 360 } 354 361 362 template <class U, class V, class W> 363 void CGroupTemplate<U, V, W>::addChildGroup(shared_ptr<V> childGroup) 364 { 365 return CGroupFactory::AddGroup<V>(this->get(), childGroup) ; 366 } 367 355 368 356 369 template <class U, class V, class W> 357 370 void CGroupTemplate<U, V, W>::sendCreateChild(const string& id) 358 371 { 359 shared_ptr<CContext> context=CContext:: current() ;372 shared_ptr<CContext> context=CContext::getCurrent() ; 360 373 361 374 if (! context->hasServer ) … … 380 393 void CGroupTemplate<U, V, W>::sendCreateChildGroup(const string& id) 381 394 { 382 shared_ptr<CContext> context=CContext:: current() ;395 shared_ptr<CContext> context=CContext::getCurrent() ; 383 396 if (! context->hasServer ) 384 397 { -
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 -
XIOS/trunk/src/manager/tree_manager.cpp
r345 r346 17 17 boost::shared_ptr<CContext> CTreeManager::CreateContext(const StdString & id) 18 18 { 19 boost::shared_ptr<CContextGroup> group_context = CContext:: GetContextGroup();19 boost::shared_ptr<CContextGroup> group_context = CContext::getRoot(); 20 20 CTreeManager::SetCurrentContextId(id); 21 21 bool hasctxt = CObjectFactory::HasObject<CContext>(id); … … 79 79 CObjectFactory::GetCurrentContextId(); 80 80 std::vector<boost::shared_ptr<CContext> > def_vector = 81 CContext:: GetContextGroup()->getChildList();81 CContext::getRoot()->getChildList(); 82 82 83 83 const StdSize size = def_vector.size(); … … 116 116 ENodeType renum = Unknown; 117 117 118 boost::shared_ptr<CContextGroup> group_context = 119 CContext::GetContextGroup(); 118 boost::shared_ptr<CContextGroup> group_context = CContext::getRoot(); 120 119 121 120 is.read (reinterpret_cast<char*>(&renum), sizeof(ENodeType)); … … 172 171 StdString currentContextId = 173 172 CObjectFactory::GetCurrentContextId(); 174 std::vector<boost::shared_ptr<CContext> > def_vector = 175 CContext::GetContextGroup()->getChildList(); 173 std::vector<boost::shared_ptr<CContext> > def_vector = CContext::getRoot()->getChildList(); 176 174 177 175 const StdSize size = def_vector.size(); … … 262 260 ENodeType renum = Unknown; 263 261 264 boost::shared_ptr<CContextGroup> group_context = 265 CContext::GetContextGroup(); 266 std::vector<boost::shared_ptr<CContext> > def_vector = 267 CContext::GetContextGroup()->getChildList(); 262 boost::shared_ptr<CContextGroup> group_context = CContext::getRoot(); 263 std::vector<boost::shared_ptr<CContext> > def_vector = CContext::getRoot()->getChildList(); 268 264 269 265 const StdSize size = def_vector.size(); -
XIOS/trunk/src/node/context.cpp
r345 r346 12 12 #include "context_server.hpp" 13 13 #include "nc4_data_output.hpp" 14 #include "node_type.hpp" 14 15 15 16 namespace xios { 17 18 shared_ptr<CContextGroup> CContext::root ; 16 19 17 20 /// ////////////////////// Définitions ////////////////////// /// … … 41 44 //---------------------------------------------------------------- 42 45 43 boost::shared_ptr<CContextGroup> CContext:: GetContextGroup(void)46 boost::shared_ptr<CContextGroup> CContext::getRoot(void) 44 47 { 45 static boost::shared_ptr<CContextGroup> group_context 46 (new CContextGroup(xml::CXMLNode::GetRootName())); 47 return (group_context); 48 if (root.get()==NULL) root=shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())) ; 49 return root; 48 50 } 49 51 … … 134 136 #define DECLARE_NODE(Name_, name_) \ 135 137 if (name.compare(C##Name_##Definition::GetDefName()) == 0) \ 136 { CObjectFactory::CreateObject<C##Name_##Definition>(C##Name_##Definition::GetDefName()) -> parse(node); \ 137 continue; } 138 { C##Name_##Definition::create(C##Name_##Definition::GetDefName()) -> parse(node) ; continue; } 138 139 #define DECLARE_NODE_PAR(Name_, name_) 139 140 #include "node_type.conf" 140 141 141 142 DEBUG(<< "L'élément nommé \'" << name 142 << "\' dans le contexte \'" << C ObjectFactory::GetCurrentContextId()143 << "\' dans le contexte \'" << CContext::getCurrent()->getId() 143 144 << "\' ne représente pas une définition !"); 144 145 … … 153 154 void CContext::ShowTree(StdOStream & out) 154 155 { 155 StdString currentContextId = 156 CObjectFactory::GetCurrentContextId(); 156 StdString currentContextId = CContext::getCurrent() -> getId() ; 157 157 std::vector<boost::shared_ptr<CContext> > def_vector = 158 CContext:: GetContextGroup()->getChildList();158 CContext::getRoot()->getChildList(); 159 159 std::vector<boost::shared_ptr<CContext> >::iterator 160 160 it = def_vector.begin(), end = def_vector.end(); … … 166 166 { 167 167 boost::shared_ptr<CContext> context = *it; 168 C TreeManager::SetCurrentContextId(context->getId());168 CContext::setCurrent(context->getId()); 169 169 out << *context << std::endl; 170 170 } 171 171 172 172 out << "</" << xml::CXMLNode::GetRootName() << " >" << std::endl; 173 C TreeManager::SetCurrentContextId(currentContextId);173 CContext::setCurrent(currentContextId); 174 174 } 175 175 … … 179 179 { 180 180 SuperClass::toBinary(os); 181 181 182 182 #define DECLARE_NODE(Name_, name_) \ 183 183 { \ 184 184 ENodeType renum = C##Name_##Definition::GetType(); \ 185 bool val = CObjectFactory::HasObject<C##Name_##Definition> \ 186 (C##Name_##Definition::GetDefName()); \ 185 bool val = C##Name_##Definition::has(C##Name_##Definition::GetDefName()); \ 187 186 os.write (reinterpret_cast<const char*>(&renum), sizeof(ENodeType)); \ 188 187 os.write (reinterpret_cast<const char*>(&val), sizeof(bool)); \ 189 if (val) CObjectFactory::GetObject<C##Name_##Definition> \ 190 (C##Name_##Definition::GetDefName())->toBinary(os); \ 188 if (val) C##Name_##Definition::get(C##Name_##Definition::GetDefName())->toBinary(os); \ 191 189 } 192 190 #define DECLARE_NODE_PAR(Name_, name_) … … 208 206 ERROR("CContext::fromBinary(StdIStream & is)", \ 209 207 << "[ renum = " << renum << "] Bad type !"); \ 210 if (val) CObjectFactory::CreateObject<C##Name_##Definition> \ 211 (C##Name_##Definition::GetDefName()) -> fromBinary(is); \ 208 if (val) C##Name_##Definition::create(C##Name_##Definition::GetDefName()) -> fromBinary(is); \ 212 209 } 213 210 #define DECLARE_NODE_PAR(Name_, name_) … … 233 230 234 231 #define DECLARE_NODE(Name_, name_) \ 235 if (C ObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())) \236 oss << * CObjectFactory::GetObject<C##Name_##Definition>(C##Name_##Definition::GetDefName()) << std::endl;232 if (C##Name_##Definition::has(C##Name_##Definition::GetDefName())) \ 233 oss << * C##Name_##Definition::get(C##Name_##Definition::GetDefName()) << std::endl; 237 234 #define DECLARE_NODE_PAR(Name_, name_) 238 235 #include "node_type.conf" … … 250 247 { 251 248 #define DECLARE_NODE(Name_, name_) \ 252 if (C ObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())) \253 CObjectFactory::GetObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())->solveDescInheritance();249 if (C##Name_##Definition::has(C##Name_##Definition::GetDefName())) \ 250 C##Name_##Definition::get(C##Name_##Definition::GetDefName())->solveDescInheritance(); 254 251 #define DECLARE_NODE_PAR(Name_, name_) 255 252 #include "node_type.conf" … … 262 259 return ( 263 260 #define DECLARE_NODE(Name_, name_) \ 264 C ObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName()) ||261 C##Name_##Definition::has(C##Name_##Definition::GetDefName()) || 265 262 #define DECLARE_NODE_PAR(Name_, name_) 266 263 #include "node_type.conf" … … 273 270 { 274 271 if (!this->hasId()) return; 275 std::vector<boost::shared_ptr<CField> > allField272 std::vector<boost::shared_ptr<CField> >& allField 276 273 = CObjectTemplate<CField>::GetAllVectobject(this->getId()); 277 274 std::vector<boost::shared_ptr<CField> >::iterator … … 379 376 380 377 // Résolution des héritages par référence au niveau des fichiers. 381 const std::vector<boost::shared_ptr<CFile> > & allFiles 382 = CObjectFactory::GetObjectVector<CFile>(); 378 const std::vector<boost::shared_ptr<CFile> > & allFiles=CFile::getAll() ; 383 379 384 380 for (unsigned int i = 0; i < allFiles.size(); i++) … … 388 384 void CContext::findEnabledFiles(void) 389 385 { 390 const std::vector<boost::shared_ptr<CFile> > & allFiles 391 = CObjectFactory::GetObjectVector<CFile>(); 386 const std::vector<boost::shared_ptr<CFile> > & allFiles = CFile::getAll(); 392 387 393 388 for (unsigned int i = 0; i < allFiles.size(); i++) … … 541 536 } 542 537 543 shared_ptr<CContext> CContext:: current(void)538 shared_ptr<CContext> CContext::getCurrent(void) 544 539 { 545 540 return CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ; 546 541 } 547 542 543 void CContext::setCurrent(const string& id) 544 { 545 CObjectFactory::SetCurrentContextId(id); 546 CGroupFactory::SetCurrentContextId(id); 547 } 548 549 boost::shared_ptr<CContext> CContext::create(const StdString& id) 550 { 551 CContext::setCurrent(id) ; 552 553 bool hasctxt = CContext::has(id); 554 boost::shared_ptr<CContext> context = CObjectFactory::CreateObject<CContext>(id); 555 if (!hasctxt) CGroupFactory::AddChild(getRoot(), context); 556 557 #define DECLARE_NODE(Name_, name_) \ 558 C##Name_##Definition::create(C##Name_##Definition::GetDefName()); 559 #define DECLARE_NODE_PAR(Name_, name_) 560 #include "node_type.conf" 561 562 return (context); 563 } 548 564 } // namespace xios -
XIOS/trunk/src/node/context.hpp
r345 r346 127 127 static void recvCreateFileHeader(CEventServer& event) ; 128 128 void recvCreateFileHeader(CBufferIn& buffer) ; 129 static shared_ptr<CContext> current(void) ; 129 static shared_ptr<CContext> getCurrent(void) ; 130 static shared_ptr<CContextGroup> getRoot(void) ; 131 static void setCurrent(const string& id) ; 132 static shared_ptr<CContext> create(const string& id = "") ; 130 133 131 134 public : … … 143 146 144 147 std::vector<boost::shared_ptr<CFile> > enabledFiles; 148 static shared_ptr<CContextGroup> root ; 145 149 146 150 -
XIOS/trunk/src/node/domain.cpp
r345 r346 635 635 { 636 636 if (this->isChecked) return; 637 shared_ptr<CContext> context=C ObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;637 shared_ptr<CContext> context=CContext::getCurrent() ; 638 638 639 639 this->checkGlobalDomain(); … … 696 696 int jend_srv ; 697 697 698 shared_ptr<CContext> context=C ObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;698 shared_ptr<CContext> context=CContext::getCurrent() ; 699 699 CContextClient* client=context->client ; 700 700 int nbServer=client->serverSize ; … … 738 738 jbegin_client=jbegin.getValue() ; jend_client=jend.getValue() ; nj_client=nj.getValue() ; 739 739 740 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;740 shared_ptr<CContext> context = CContext::getCurrent() ; 741 741 CContextClient* client=context->client ; 742 742 int nbServer=client->serverSize ; … … 847 847 void CDomain::sendLonLat(void) 848 848 { 849 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;849 shared_ptr<CContext> context = CContext::getCurrent() ; 850 850 CContextClient* client=context->client ; 851 851 // send lon lat for each connected server -
XIOS/trunk/src/node/field.cpp
r345 r346 94 94 void CField::sendUpdateData(void) 95 95 { 96 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;96 shared_ptr<CContext> context = CContext::getCurrent() ; 97 97 CContextClient* client=context->client ; 98 98 … … 150 150 } 151 151 152 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;152 shared_ptr<CContext> context = CContext::getCurrent() ; 153 153 const CDate & currDate = context->getCalendar()->getCurrentDate(); 154 154 const CDate opeDate = *last_operation_srv + freq_operation_srv; … … 187 187 getRelFile()->checkFile(); 188 188 this->incrementNStep(); 189 getRelFile()->getDataOutput()->writeFieldData(C ObjectFactory::GetObject<CField>(this));189 getRelFile()->getDataOutput()->writeFieldData(CField::get(this)); 190 190 } 191 191 } … … 239 239 return (this->getBaseFieldReference()); 240 240 241 if (! C ObjectFactory::HasObject<CField>(this->field_ref.getValue()))241 if (! CField::has(this->field_ref.getValue())) 242 242 ERROR("CField::getDirectFieldReference(void)", 243 243 << "[ ref_name = " << this->field_ref.getValue() << "]" 244 244 << " invalid field name !"); 245 245 246 return (C ObjectFactory::GetObject<CField>(this->field_ref.getValue()));246 return (CField::get(this->field_ref.getValue())); 247 247 } 248 248 … … 328 328 CField * refer_ptr = this; 329 329 330 this->baseRefObject = C ObjectFactory::GetObject<CField>(this);330 this->baseRefObject = CField::get(this); 331 331 332 332 while (refer_ptr->hasDirectFieldReference()) … … 356 356 357 357 StdString id = this->getBaseFieldReference()->getId(); 358 boost::shared_ptr<CContext> context = 359 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 358 boost::shared_ptr<CContext> context = CContext::getCurrent(); 360 359 361 360 if (operation.isEmpty() || freq_op.isEmpty() || this->file->output_freq.isEmpty()) … … 448 447 if (!domain_ref.isEmpty()) 449 448 { 450 if (C ObjectFactory::HasObject<CDomain>(domain_ref.getValue()))451 domain = C ObjectFactory::GetObject<CDomain>(domain_ref.getValue()) ;449 if (CDomain::has(domain_ref.getValue())) 450 domain = CDomain::get(domain_ref.getValue()) ; 452 451 else 453 452 ERROR("CField::solveGridReference(void)", … … 458 457 if (!axis_ref.isEmpty()) 459 458 { 460 if (C ObjectFactory::HasObject<CAxis>(axis_ref.getValue()))461 axis = C ObjectFactory::GetObject<CAxis>(axis_ref.getValue()) ;459 if (CAxis::has(axis_ref.getValue())) 460 axis = CAxis::get(axis_ref.getValue()) ; 462 461 else 463 462 ERROR("CField::solveGridReference(void)", … … 468 467 if (!grid_ref.isEmpty()) 469 468 { 470 if (C ObjectFactory::HasObject<CGrid>(grid_ref.getValue()))471 this->grid = C ObjectFactory::GetObject<CGrid>(grid_ref.getValue()) ;469 if (CGrid::has(grid_ref.getValue())) 470 this->grid = CGrid::get(grid_ref.getValue()) ; 472 471 else 473 472 ERROR("CField::solveGridReference(void)", … … 514 513 StdString gref = this->group_ref.getValue(); 515 514 516 if (!C ObjectFactory::HasObject<CFieldGroup>(gref))515 if (!CFieldGroup::has(gref)) 517 516 ERROR("CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void)", 518 517 << "[ gref = " << gref << "]" 519 518 << " invalid group name !"); 520 519 521 boost::shared_ptr<CFieldGroup> group 522 = CObjectFactory::GetObject<CFieldGroup>(gref); 523 boost::shared_ptr<CFieldGroup> owner 524 = CObjectFactory::GetObject<CFieldGroup> 525 (boost::polymorphic_downcast<CFieldGroup*>(this)); 520 boost::shared_ptr<CFieldGroup> group = CFieldGroup::get(gref); 521 boost::shared_ptr<CFieldGroup> owner = CFieldGroup::get(boost::polymorphic_downcast<CFieldGroup*>(this)); 526 522 527 523 std::vector<boost::shared_ptr<CField> > allChildren = group->getAllChildren(); … … 532 528 { 533 529 boost::shared_ptr<CField> child = *it; 534 if (child->hasId()) 535 CGroupFactory::CreateChild(owner)->field_ref.setValue(child->getId());530 if (child->hasId()) owner->createChild()->field_ref.setValue(child->getId()) ; 531 536 532 } 537 533 } -
XIOS/trunk/src/node/file.cpp
r345 r346 101 101 (*it)->refObject.push_back(*it); 102 102 // Le champ est finalement actif, on y ajoute la référence au champ de base. 103 (*it)->setRelFile(C ObjectFactory::GetObject(this));103 (*it)->setRelFile(CFile::get(this)); 104 104 (*it)->baseRefObject->refObject.push_back(*it); 105 105 // A faire, ajouter les references intermediaires... … … 121 121 void CFile::setVirtualFieldGroup(void) 122 122 { 123 this->setVirtualFieldGroup 124 (CObjectFactory::CreateObject<CFieldGroup>()); 123 this->setVirtualFieldGroup(CFieldGroup::create()); 125 124 } 126 125 … … 128 127 bool CFile::isSyncTime(void) 129 128 { 130 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;129 shared_ptr<CContext> context = CContext::getCurrent() ; 131 130 CDate& currentDate=context->calendar->getCurrentDate() ; 132 131 if (! sync_freq.isEmpty()) … … 143 142 void CFile::initFile(void) 144 143 { 145 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;144 shared_ptr<CContext> context = CContext::getCurrent() ; 146 145 CDate& currentDate=context->calendar->getCurrentDate() ; 147 146 … … 164 163 bool CFile::checkSync(void) 165 164 { 166 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;165 shared_ptr<CContext> context = CContext::getCurrent() ; 167 166 CDate& currentDate=context->calendar->getCurrentDate() ; 168 167 if (! sync_freq.isEmpty()) … … 181 180 bool CFile::checkSplit(void) 182 181 { 183 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;182 shared_ptr<CContext> context = CContext::getCurrent() ; 184 183 CDate& currentDate=context->calendar->getCurrentDate() ; 185 184 if (! split_freq.isEmpty()) … … 200 199 void CFile::createHeader(void) 201 200 { 202 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;201 shared_ptr<CContext> context = CContext::getCurrent() ; 203 202 CDate& currentDate=context->calendar->getCurrentDate() ; 204 203 … … 258 257 isOpen=true ; 259 258 260 data_out->writeFile(C ObjectFactory::GetObject<CFile>(this));259 data_out->writeFile(CFile::get(this)); 261 260 for (it = this->enabledFields.begin() ;it != end; it++) 262 261 { … … 395 394 void CFile::sendAddField(const string& id) 396 395 { 397 shared_ptr<CContext> context=CContext:: current() ;396 shared_ptr<CContext> context=CContext::getCurrent() ; 398 397 399 398 if (! context->hasServer ) … … 417 416 void CFile::sendAddFieldGroup(const string& id) 418 417 { 419 shared_ptr<CContext> context=CContext:: current() ;418 shared_ptr<CContext> context=CContext::getCurrent() ; 420 419 if (! context->hasServer ) 421 420 { -
XIOS/trunk/src/node/grid.cpp
r345 r346 158 158 { 159 159 if (this->isChecked) return; 160 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;160 shared_ptr<CContext> context = CContext::getCurrent() ; 161 161 CContextClient* client=context->client ; 162 162 … … 187 187 if (!domain_ref.isEmpty()) 188 188 { 189 if (C ObjectFactory::HasObject<CDomain>(domain_ref.getValue()))190 { 191 this->domain = C ObjectFactory::GetObject<CDomain>(domain_ref.getValue()) ;189 if (CDomain::has(domain_ref.getValue())) 190 { 191 this->domain = CDomain::get(domain_ref.getValue()) ; 192 192 domain->checkAttributes() ; 193 193 } … … 206 206 { 207 207 this->withAxis = true ; 208 if (C ObjectFactory::GetObject<CAxis>(axis_ref.getValue()))209 { 210 this->axis = C ObjectFactory::GetObject<CAxis>(axis_ref.getValue()) ;208 if (CAxis::get(axis_ref.getValue())) 209 { 210 this->axis = CAxis::get(axis_ref.getValue()) ; 211 211 axis->checkAttributes() ; 212 212 } … … 310 310 { 311 311 StdString new_id = StdString("__") + domain->getId() + StdString("__") ; 312 boost::shared_ptr<CGrid> grid = 313 CGroupFactory::CreateChild(CObjectFactory::GetObject<CGridGroup> ("grid_definition"), new_id); 312 boost::shared_ptr<CGrid> grid = CGridGroup::get("grid_definition")->createChild(new_id) ; 314 313 grid->domain_ref.setValue(domain->getId()); 315 314 return (grid); … … 321 320 StdString new_id = StdString("__") + domain->getId() + 322 321 StdString("_") + axis->getId() + StdString("__") ; 323 boost::shared_ptr<CGrid> grid = 324 CGroupFactory::CreateChild(CObjectFactory::GetObject<CGridGroup> ("grid_definition"), new_id); 322 boost::shared_ptr<CGrid> grid = CGridGroup::get("grid_definition")->createChild(new_id) ; 325 323 grid->domain_ref.setValue(domain->getId()); 326 324 grid->axis_ref.setValue(axis->getId()); … … 418 416 void CGrid::sendIndex(void) 419 417 { 420 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;418 shared_ptr<CContext> context = CContext::getCurrent() ; 421 419 CContextClient* client=context->client ; 422 420 -
XIOS/trunk/src/node/variable.cpp
r345 r346 83 83 { 84 84 boost::shared_ptr<CVariableGroup> group_ptr = (this->hasId()) 85 ? CObjectFactory::GetObject<CVariableGroup>(this->getId()) 86 : CObjectFactory::GetObject(this); 85 ? CVariableGroup::get(this->getId()) : CVariableGroup::get(this); 87 86 88 87 StdString content; … … 101 100 subdata = content.substr ( begindata, enddata-begindata); 102 101 103 CGroupFactory::CreateChild(group_ptr, subid)->content = subdata;102 group_ptr->createChild(subid)->content = subdata ; 104 103 } 105 104 } -
XIOS/trunk/src/object_template.hpp
r345 r346 67 67 68 68 static bool has(const string& id) ; 69 static bool has(const string& contextId, const string& id) ; 69 70 static boost::shared_ptr<T> get(const string& id) ; 71 static boost::shared_ptr<T> get(const T* ptr) ; 72 static boost::shared_ptr<T> get(const string& contextId, const string& id) ; 70 73 boost::shared_ptr<T> get(void) ; 71 74 static boost::shared_ptr<T> create(const string& id=string("")) ; 72 75 static const vector< boost::shared_ptr<T> >& getAll() ; 76 static const vector< boost::shared_ptr<T> >& getAll(const string& contextId) ; 77 73 78 void generateCInterface(ostream& oss) ; 74 79 void generateFortran2003Interface(ostream& oss) ; -
XIOS/trunk/src/object_template_impl.hpp
r345 r346 146 146 { 147 147 std::vector<boost::shared_ptr<T> > & avect = 148 CObjectTemplate<T>::GetAllVectobject(C ObjectFactory::GetCurrentContextId());148 CObjectTemplate<T>::GetAllVectobject(CContext::getCurrent()->getId()); 149 149 typename std::vector<boost::shared_ptr<T> >::iterator 150 150 it = avect.begin(), end = avect.end(); … … 168 168 void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr) 169 169 { 170 shared_ptr<CContext> context=C ObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;170 shared_ptr<CContext> context=CContext::getCurrent() ; 171 171 172 172 if (!context->hasServer) … … 232 232 233 233 template <typename T> 234 bool CObjectTemplate<T>::has(const string& contextId, const string & id) 235 { 236 return CObjectFactory::HasObject<T>(contextId,id) ; 237 } 238 239 template <typename T> 234 240 boost::shared_ptr<T> CObjectTemplate<T>::get(const string & id) 235 241 { 236 242 return CObjectFactory::GetObject<T>(id) ; 243 } 244 245 template <typename T> 246 boost::shared_ptr<T> CObjectTemplate<T>::get(const T* ptr) 247 { 248 return CObjectFactory::GetObject<T>(ptr) ; 249 } 250 251 252 template <typename T> 253 const vector<boost::shared_ptr<T> >& CObjectTemplate<T>::getAll() 254 { 255 return CObjectFactory::GetObjectVector<T>() ; 256 } 257 258 template <typename T> 259 const vector<boost::shared_ptr<T> >& CObjectTemplate<T>::getAll(const string & id) 260 { 261 return CObjectFactory::GetObjectVector<T>(id) ; 262 } 263 264 template <typename T> 265 boost::shared_ptr<T> CObjectTemplate<T>::get(const string& contextId, const string & id) 266 { 267 return CObjectFactory::GetObject<T>(contextId,id) ; 237 268 } 238 269 … … 247 278 { 248 279 return CObjectFactory::GetObject<T>((T*)this) ; 280 // return shared_ptr<T>((T*)this) ; 249 281 } 250 282 -
XIOS/trunk/src/output/nc4_data_output.cpp
r345 r346 57 57 void CNc4DataOutput::writeDomain_(const boost::shared_ptr<CDomain> domain) 58 58 { 59 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;59 shared_ptr<CContext> context = CContext::getCurrent() ; 60 60 CContextServer* server=context->server ; 61 61 … … 271 271 void CNc4DataOutput::writeField_(const boost::shared_ptr<CField> field) 272 272 { 273 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;273 shared_ptr<CContext> context = CContext::getCurrent() ; 274 274 CContextServer* server=context->server ; 275 275 … … 463 463 void CNc4DataOutput::writeFieldData_ (const boost::shared_ptr<CField> field) 464 464 { 465 shared_ptr<CContext> context =CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;465 shared_ptr<CContext> context = CContext::getCurrent() ; 466 466 // if (field->getRelFile()->isSyncTime()) SuperClassWriter::sync() ; 467 467 -
XIOS/trunk/src/server.cpp
r345 r346 346 346 <<"Context has already been registred") ; 347 347 348 shared_ptr<CContext> context=C TreeManager::CreateContext(contextId) ;348 shared_ptr<CContext> context=CContext::create(contextId) ; 349 349 contextList[contextId]=context.get() ; 350 350 context->initServer(intraComm,contextIntercomm) ; -
XIOS/trunk/src/test/test_xios.cpp
r342 r346 68 68 // CClient::registerContext("tata",CClient::intraComm) ; 69 69 CClient::registerContext("tutu",CClient::intraComm) ; 70 C ObjectFactory::SetCurrentContextId("tutu") ;71 CContext* tutu= (CObjectFactory::GetObject<CContext>("tutu")).get();70 CContext::setCurrent("tutu") ; 71 CContext* tutu=CContext::get("tutu").get() ; 72 72 73 73 74 C ObjectFactory::SetCurrentContextId("toto") ;75 CContext* toto=(C ObjectFactory::GetObject<CContext>("toto")).get();74 CContext::setCurrent("toto") ; 75 CContext* toto=(CContext::get("toto").get() ; 76 76 toto->calendar_type.setValue("NoLeap") ; 77 77 toto->sendAttributToServer("calendar_type" ); … … 101 101 CXios::initClientSide("test2") ; 102 102 CClient::registerContext("tito",CClient::intraComm) ; 103 C ObjectFactory::SetCurrentContextId("tito") ;104 CContext* tito= (CObjectFactory::GetObject<CContext>("tito")).get();103 CContext::setCurrent("tito") ; 104 CContext* tito=CContext::get("tito").get() ; 105 105 106 106 CClient::registerContext("tete",CClient::intraComm) ; 107 C ObjectFactory::SetCurrentContextId("tete") ;108 CContext* tete= (CObjectFactory::GetObject<CContext>("tete")).get();107 CContext::setCurrent("tete") ; 108 CContext* tete=CContext::get("tete").get() ; 109 109 110 110 tito->client->finalize() ; … … 116 116 CXios::initClientSide("test3") ; 117 117 CClient::registerContext("turlututu",CClient::intraComm) ; 118 C ObjectFactory::SetCurrentContextId("turlututu") ;119 CContext* turlututu= (CObjectFactory::GetObject<CContext>("turlututu")).get();118 CContext::setCurrent("turlututu") ; 119 CContext* turlututu=CContext::get("turlututu").get() ; 120 120 turlututu->client->finalize() ; 121 121 CXios::clientFinalize() ; -
XIOS/trunk/src/xml_parser.cpp
r345 r346 52 52 do 53 53 { 54 boost::shared_ptr<CContextGroup> group_context = 55 CContext::GetContextGroup();54 boost::shared_ptr<CContextGroup> group_context = CContext::getRoot() ; 55 56 56 attributes = node.getAttributes(); 57 57 … … 62 62 } 63 63 64 CObjectFactory::SetCurrentContextId(attributes["id"]); 65 CGroupFactory::SetCurrentContextId(attributes["id"]); 64 CContext::setCurrent(attributes["id"]) ; 66 65 67 bool hasctxt = C ObjectFactory::HasObject<CContext>(attributes["id"]);66 bool hasctxt = CContext::has(attributes["id"]); 68 67 69 68 if(hasctxt) … … 74 73 } 75 74 76 boost::shared_ptr<CContext> context = 77 CObjectFactory::CreateObject<CContext>(attributes["id"]); 78 if (!hasctxt) CGroupFactory::AddChild(group_context, context); 75 boost::shared_ptr<CContext> context = CContext::create(attributes["id"]); 76 // if (!hasctxt) group_context->addChild(context); 79 77 context->parse(node); 80 78
Note: See TracChangeset
for help on using the changeset viewer.