//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project
//
//File: print.cpp
//
//Version: $Revision: 1.2 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/10/09 11:41:47 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Jussi Turunen
//
//Description:
//      Prints the otMessage::SerializedMessage it receives
//      Use only if absolutely necessary. Soon-to-be-deprecated.
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History: 

#include <OB/CORBA.h>
#include <OB/Util.h>
#include <typeinfo>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_FSTREAM
#   include <fstream>
#else
#   include <fstream.h>
#endif
#include "pf/system.h"
#include "pf/debug.h"

#include "printobject.h"

int main(int argc, char* argv[], char*[])
{
    string file1("printobject.ref");

    pfSystem::init(argc, argv);
    try
    {
	//
	// Create ORB and BOA
	//

        debugOutputCout();
	// Actual printing in printObject
        printObject *test = new printObject();

        // IOR needs to be saved so that pfTestAdapter can use it
        test->saveIOR((pfSystem::instance()->getORB()), file1);
        
	// Run implementation
        pfSystem::instance()->run();
    }
#ifdef __GNUG__
    catch(CORBA_COMM_FAILURE& ex)
#else
    catch(CORBA_SystemException& ex)
#endif
    {
	OBPrintException(ex);
	return 1;
    }
    return 0;
}

