Example: ORB initialization

ORB initialization is demonstrated in this example. You can specify the ORB options as a command line parameters to be passed to the ORB_init method.

#include <stdio.h>
#include <iostream.h>
#include <string.h>
#include <SessionManager.hpp>
#include <CosNaming.hpp>
#include <Jaguar.hpp>
#include <Tutorial.hpp>    // Stubs for interfaces in Tutorial IDL
                           // module.

int main(int argc, char** argv)
{
const char *usage =
  "Usage:\n\tarith -ORBNameServiceURL iiop://
  <host>:<iiop-port>/<initial-context>\n";
const char *tutorial_help =
  "Check EAServer Manager and verify that the"
  "Tutorial/CPPArithmetic component exists "
  "and that it implements the "
  "Tutorial::CPPArithmetic IDL interface.";

const char *ior_prefix = "iiop://";
const char *component_name = "Tutorial/CPPArithmetic";
char *ior = NULL;

try {

cout << "Creating Jaguar session\n\n";

// Initialize the ORB
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, 0);