[sword-cvs] sword/bindings/corba/orbitcpp server.cpp,1.2,1.3 swordorb-impl.cpp,1.3,1.4 swordorb-impl.hpp,1.1,1.2 testclient.cpp,1.3,1.4
sword@www.crosswire.org
sword@www.crosswire.org
Mon, 5 May 2003 12:07:40 -0700
Update of /usr/local/cvsroot/sword/bindings/corba/orbitcpp
In directory www:/tmp/cvs-serv18375/bindings/corba/orbitcpp
Modified Files:
server.cpp swordorb-impl.cpp swordorb-impl.hpp testclient.cpp
Log Message:
Index: server.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/corba/orbitcpp/server.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** server.cpp 4 May 2003 01:03:00 -0000 1.2
--- server.cpp 5 May 2003 19:07:38 -0000 1.3
***************
*** 1,5 ****
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
! #include "sword-impl.hpp"
#include <iostream>
#include <swmgr.h>
--- 1,5 ----
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
! #include "swordorb-impl.hpp"
#include <iostream>
#include <swmgr.h>
Index: swordorb-impl.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/corba/orbitcpp/swordorb-impl.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** swordorb-impl.cpp 4 May 2003 08:09:20 -0000 1.3
--- swordorb-impl.cpp 5 May 2003 19:07:38 -0000 1.4
***************
*** 1,3 ****
! #include "sword-impl.hpp"
#include <iostream>
#include <swmgr.h>
--- 1,3 ----
! #include "swordorb-impl.hpp"
#include <iostream>
#include <swmgr.h>
***************
*** 27,32 ****
--- 27,47 ----
}
+
SWModule_ptr SWMgr_impl::getModuleByName(const char *name) throw(CORBA::SystemException) {
+ SWModuleMap::iterator it;
+ SWModule_ptr retVal;
+ it = moduleImpls.find(name);
+ if (it == moduleImpls.end()) {
+ sword::SWModule *mod = delegate->Modules[name];
+ if (mod)
+ moduleImpls[name] = new SWModule_impl(mod);
+ it = moduleImpls.find(name);
+ }
+ if (it != moduleImpls.end()) {
+ retVal = it->second->_this();
+ }
+ return ::swordorb::SWModule::_duplicate(retVal);
}
+
StringList *SWMgr_impl::getGlobalOptionsIterator() throw(CORBA::SystemException) {
Index: swordorb-impl.hpp
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/corba/orbitcpp/swordorb-impl.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** swordorb-impl.hpp 5 May 2003 18:38:55 -0000 1.1
--- swordorb-impl.hpp 5 May 2003 19:07:38 -0000 1.2
***************
*** 1,3 ****
- /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t;c-basic-offset: 4 -*- */
#ifndef _ORBIT_CPP_IDL_sword_IMPL_HH
#define _ORBIT_CPP_IDL_sword_IMPL_HH
--- 1,2 ----
***************
*** 6,9 ****
--- 5,9 ----
#include <swmodule.h>
#include <swmgr.h>
+ #include <map>
***************
*** 31,36 ****
--- 31,39 ----
};
+ typedef std::map<std::string, SWModule_impl *> SWModuleMap;
+
class SWMgr_impl : public POA_swordorb::SWMgr {
sword::SWMgr *delegate;
+ SWModuleMap moduleImpls;
public:
SWMgr_impl(sword::SWMgr *delegate) { this->delegate = delegate; }
Index: testclient.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/corba/orbitcpp/testclient.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** testclient.cpp 4 May 2003 01:16:44 -0000 1.3
--- testclient.cpp 5 May 2003 19:07:38 -0000 1.4
***************
*** 23,36 ****
// command line
CORBA::Object_var obj = orb->string_to_object(argv[1]);
! swordorb::SWMgr_var ptr = swordorb::SWMgr::_narrow(obj);
swordorb::ModInfoList *modInfoList;
! std::cout << "PrefixPath: " << ptr->getPrefixPath() << "\n";
! std::cout << "ConfigPath: " << ptr->getConfigPath() << "\n";
! modInfoList = ptr->getModInfoList();
std::cout << "sequence length: " << modInfoList->length() << "\n";
for (int i = 0; i < modInfoList->length(); i++) {
std::cout << (*modInfoList)[i].name << ": " << (*modInfoList)[i].type << ": " << (*modInfoList)[i].lang << "\n";
}
--- 23,40 ----
// command line
CORBA::Object_var obj = orb->string_to_object(argv[1]);
! swordorb::SWMgr_var mgr = swordorb::SWMgr::_narrow(obj);
swordorb::ModInfoList *modInfoList;
! std::cout << "PrefixPath: " << mgr->getPrefixPath() << "\n";
! std::cout << "ConfigPath: " << mgr->getConfigPath() << "\n";
! modInfoList = mgr->getModInfoList();
std::cout << "sequence length: " << modInfoList->length() << "\n";
+ swordorb::SWModule_ptr module;
for (int i = 0; i < modInfoList->length(); i++) {
std::cout << (*modInfoList)[i].name << ": " << (*modInfoList)[i].type << ": " << (*modInfoList)[i].lang << "\n";
+ module = mgr->getModuleByName((*modInfoList)[i].name);
+ module->setKeyText("jas1:19");
+ std::cout << module->getRenderText() << "\n";
}