// Editor-info: -*- C++ -*-

#include <OB/CORBA.h>
#include "loopconduit_impl.h"
#include "democlasses.h"


//
// Method: constructor
//
// Description:
//     Calls parent class constructors.
//

loopAdapter::loopAdapter()
    : loopConduit_skel(),
      pfAdapter(),
      _id(0)
{
    return;
}


//
// Method: inject
//
// Description:
//     Implements the method defined in the IDL interface. Creates a new
//     loopMessage instance and sends it to whatever conduit is connected
//     to the A side of the adapter.
//

void loopAdapter::inject(CORBA_Long rounds_)
{
    cout << "LoopAdapter: Request received for " << rounds_
         << " loops, message #" << _id << " to A side... " << endl;
    loopMessage *msg = new loopMessage(_id, rounds_);
    toA(msg);
    _id++;
    return;
}
