// **********************************************************************
//
// Copyright (c) 1999
// Object Oriented Concepts, Inc.
// Billerica, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

#include 

#include 

#include 

#ifdef HAVE_STD_IOSTREAM
using namespace std;
#endif

int GetServerProcess(CORBA::ORB_ptr& orb, ProcessHitsCollection_var& aProcess_var)
{
    int argc = 0;
    char** argv = (char**)NULL;
    int status = EXIT_SUCCESS;

    // Object referecne file
    char* refFile = "relfile:/ProcessHitsCollection.ref"; 

    // Initialize ORB
    try
    {
        orb = CORBA::ORB_init(argc, argv);
    }
    catch(const CORBA::Exception& ex)
    {
        cerr << ex << endl;
        status = EXIT_FAILURE;
    }

    // Get "ProcessHitsCollection" object
    CORBA::Object_var obj = orb -> string_to_object(refFile);
    if(CORBA::is_nil(obj))
    {
        cerr << argv[0] << ": cannot read IOR from " << refFile << endl;
        return EXIT_FAILURE;
    }

    aProcess_var =  ProcessHitsCollection::_narrow(obj);
    assert(!CORBA::is_nil(aProcess_var));
    
    return status;
}