//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / TESTING
//
//File: swmain.cpp
//
//Version: $Revision: 1.26 $
//
//State: $State: Exp $
//
//Date: $Date: 1999/03/02 12:21:44 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Timo Pärnänen
//
//Description:
//      Main program for TOVE/SCOMS switch controller.
//
//Copyright:
//
//
//Licence:
//
//
//History: 

#include <typeinfo>
#include <iostream.h>

#include "pf/system.h"
#include "pf/exception.h"

#include "sw/swswitch.h"

//
//Function: printUsage
//
//Description:
//    Prints usage to standard output.
//

void printUsage(const char *name_)
{
    cout << endl;
    cout << "Usage: " << name_ << endl;
    exit(0);
}

//
// main function
//

int main(int argc, char *argv[])
{
    if (argc != 1)
    {
        printUsage(argv[0]);
    }
    
    try
    {
        string param1("-ORBconfig");
        string param2("orbacus.cfg");
        char *parameters[3];
        parameters[0] = argv[0];
        parameters[1] = (char *)param1.c_str();
        parameters[2] = (char *)param2.c_str();
        
        // Init scheduler
        pfSystem::init(3, parameters);

        // Init switch
        swSwitch::initSwitch();

        // Run the system
        pfSystem::instance()->run();
    }
    catch (pfException &exception)
    {
        cerr << "Exception catched in main (exit)" << endl;
        exception.printInfo();
    }
    
    return 0;
}


