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

/**
 *
 * This interface represents a link in a chain.  Each link forwards
 * a message to the next link in the chain, until each link has been
 * visited.
 *
 **/
interface Link
{
    /** An alias for a sequence of octet */
    typedef sequence<octet> MsgData;

    /**
     *
     * A message consists of a unique ID, and some data.
     *
     * @member id The message ID.
     * @member data The message data.
     *
     **/
    struct Message
    {
	long id;
	MsgData data;
    };

    /**
     *
     * Forward this message to the next link.
     * The message should be passed to the next object in the chain
     * until all links have been visited.
     *
     * @param msg The message
     *
     **/
    void forward(in Message msg);

    /**
     *
     * Send nMsgs messages, with msgSize bytes of data.
     *
     * @param nMsgs The number of messages to send.
     * @param msgSize The number of bytes in each message.
     *
     **/
    void send(in long nMsgs, in long msgSize);

    /**
     *
     * Close the chain.  Each link object should call the close_loop
     * of the next in the chain, until the chain has been completed.
     *
     **/

    void close_loop();
};
