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

#include <OB/CORBA.h>
#include <OB/Util.h>
#include <Peer_impl.h>

Peer_impl::Peer_impl()
{
}

void
Peer_impl::decrement(CORBA_Long& value, Peer_ptr peer)
{
    cout << value << endl;

    value--;

    if(value > 0)
    {
	Peer_var self = _this();

	try
	{
	    peer -> decrement(value, self);
	}
	catch(CORBA_COMM_FAILURE& ex)
	{
	    cerr << "Got exception while calling `peer -> decrement()':"
		 << endl;
	    OBPrintException(ex);
	}
    }
}
