| 35 | #include <exception> |
| 36 | |
| 37 | int main(int argc, char *argv[]) { |
| 38 | if (argc < 2) { |
| 39 | std::cerr << "Must supply a plugin name to load." << std::endl; |
| 40 | return 1; |
| 41 | } |
| 42 | osvr::pluginhost::RegistrationContext ctx; |
| 43 | osvr::connection::ConnectionPtr conn = |
| 44 | osvr::connection::Connection::createLocalConnection(); |
| 45 | osvr::connection::Connection::storeConnection(ctx, conn); |
| 46 | |
| 47 | try { |
| 48 | std::cout << "Trying to load plugin " << argv[1] << std::endl; |
| 49 | ctx.loadPlugin(argv[1]); |
| 50 | std::cout << "Successfully loaded plugin, control returned to host " |
| 51 | "application!" << std::endl; |
| 52 | } catch (std::exception &e) { |
| 53 | std::cerr << "Caught exception tring to load " << argv[1] << ": " |
| 54 | << e.what() << std::endl; |
| 55 | return 1; |
| 56 | } |
| 57 | int count = 20; |
| 58 | std::cout << "Running connection processing " << count << " times" |
| 59 | << std::endl; |
| 60 | for (int i = 0; i < count; ++i) { |
| 61 | conn->process(); |
| 62 | } |
| 63 | |
| 64 | return 0; |
| 65 | } |
nothing calls this directly
no test coverage detected