15 int main(
int argc,
char* argv[])
18 CORBA::ORB_var orb = CORBA::ORB::_nil();
22 orb = CORBA::ORB_init(argc, argv);
24 CORBA::Object_var
obj;
26 obj = orb->resolve_initial_references(
"RootPOA");
27 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
28 if(CORBA::is_nil(poa)){
29 throw string(
"error: failed to narrow root POA.");
32 PortableServer::POAManager_var poaManager = poa->the_POAManager();
33 if(CORBA::is_nil(poaManager)){
34 throw string(
"error: failed to narrow root POA manager.");
38 poa->activate_object(modelLoaderImpl);
39 ModelLoader_var modelLoader = modelLoaderImpl->_this();
40 modelLoaderImpl->_remove_ref();
42 obj = orb->resolve_initial_references(
"NameService");
43 CosNaming::NamingContext_var namingContext = CosNaming::NamingContext::_narrow(obj);
44 if(CORBA::is_nil(namingContext)){
45 throw string(
"error: failed to narrow naming context.");
50 name[0].id = CORBA::string_dup(
"ModelLoader");
51 name[0].kind = CORBA::string_dup(
"");
52 namingContext->rebind(name, modelLoader);
54 poaManager->activate();
56 cout <<
"ready" << endl;
61 catch (CORBA::SystemException& ex) {
62 cerr << ex._rep_id() << endl;
64 catch (
const string&
error){
65 cerr << error << endl;
png_infop png_charpp name
int main(int argc, char *argv[])
void error(char *msg) const