MICO

client.cc

#include <iostream.h>
#include <fstream.h>
#include "account.h"

int main( int argc, char *argv[] )
{
    // ORB initialization
    CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "mico-local-orb" );
    CORBA::BOA_var boa = orb->BOA_init (argc, argv, "mico-local-boa");

    ifstream in("/tmp/account.objid");
    char ref[1000];
    in >> ref;
    in.close();

    CORBA::Object_var obj = orb->string_to_object(ref);
    Account_var client = Account::_narrow(obj);
    

    client->deposit( 100 );
    client->deposit( 100 );
    client->deposit( 100 );
    client->deposit( 100 );
    client->deposit( 100 );
    client->withdraw( 240 );
    client->withdraw( 10 );
    cout << "Balance is " << client->balance() << endl;

    return 0;
}

José M. Vidal .

8 of 8