Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00014 #include "DynamicsSimulator_impl.h"
00015
00016 #ifdef _WIN32
00017 #include "winbase.h"
00018 #else
00019 #include <unistd.h>
00020 #endif
00021
00022 #include <iostream>
00023
00024 using namespace std;
00025
00026
00027 int main(int argc, char* argv[])
00028 {
00029 CORBA::ORB_var orb;
00030 try {
00031 orb = CORBA::ORB_init(argc, argv);
00032
00033
00034
00035 CORBA::Object_var poaObj = orb -> resolve_initial_references("RootPOA");
00036 PortableServer::POA_var rootPOA = PortableServer::POA::_narrow(poaObj);
00037
00038
00039
00040
00041 PortableServer::POAManager_var manager = rootPOA -> the_POAManager();
00042
00043 CosNaming::NamingContext_var cxT;
00044 CORBA::Object_var nS = orb->resolve_initial_references("NameService");
00045 cxT = CosNaming::NamingContext::_narrow(nS);
00046
00047 CORBA::Object_var integratorFactory;
00048 DynamicsSimulatorFactory_impl* integratorFactoryImpl = new DynamicsSimulatorFactory_impl(orb);
00049 integratorFactory = integratorFactoryImpl -> _this();
00050 CosNaming::Name nc;
00051 nc.length(1);
00052 nc[0].id = CORBA::string_dup("DynamicsSimulatorFactory");
00053 nc[0].kind = CORBA::string_dup("");
00054 cxT -> rebind(nc, integratorFactory);
00055
00056 manager -> activate();
00057 cout << "ready" << endl;
00058
00059 orb -> run();
00060 } catch (CORBA::SystemException& ex) {
00061 cerr << ex._rep_id() << endl;
00062 return 1;
00063 }
00064 orb->destroy();
00065 return 0;
00066 }