/* Network-Integrated Multimedia Middleware (NMM)
 * http://www.motama.com/nmm.html
 *
 * Copyright (C) 2006-2007
 * Motama GmbH, Saarbruecken, Germany
 * http://www.motama.com
 *
 * This file is part of NMM. 
 * 
 * NMM is free software; you can redistribute it and/or modify it    
 * under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; only version 2 of the License.      
 * 
 * NMM is distributed in the hope that it will be useful, but WITHOUT 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 
 * License for more details.  
 * 
 * You should have received a copy of the GNU General Public License 
 * along with NMM; if not, write to the Free Software Foundation,    
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */

#ifndef NMM_IJack_HPP
#define NMM_IJack_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/Interface.hpp"
#include "nmm/comm/messaging/Event.hpp"
#include "nmm/comm/messaging/IllegalStateException.hpp"
#include <memory>


#include "visibility.hpp"

namespace NMM
{

  class INode;

  class TSAddress;
   /** Interface of a jack.
    * An input or output jack is an instance of an input or output stream of a node.
    */

  class DLLEXPORT IJack : virtual public NMM::Interface { 
  public:
    IJack() : NMM::Interface(IJack::IJack_type, "NMM") { };

    IJack(NMM::NMMObject& parent) : NMM::Interface (parent, IJack::IJack_type, "NMM") { };

    virtual ~IJack() {};

    static const char* IJack_type;

    virtual  string getInterfaceType() const { return IJack_type; }

    NMM::Interface* copy() const { return new IJack(*this); }
    static void used(); 
    static const char* getJackTag_event;
    static const char* isConnected_event;
    static const char* setTransportStrategy_event;
    static const char* disconnect_event;
    /** Get the jack tag of this jack.
     *
     * @return The jack tag of this jack
     */

    virtual string getJackTag() const
      throw(const NMM::SerializedException&);
    /** Check if this jack is connected.
     *
     * @return @c true if this jack is connected, otherwise @c false
     */

    virtual nmm_bool isConnected() const
      throw(const NMM::SerializedException&);
    /** Set the transport strategy used by this jack.
     * This method sets the transport strategy which is used by the jack to communicate with its
     * partner jack. If this method succeeded, the jack is connected to a partner jack through
     * a non-local binding using the given transport strategy.
     *
     * The transport strategy is given as a transport strategy address to connect to.
     *
     * @param address The address to connect to
     */

    virtual void setTransportStrategy(const TSAddress* address)
      throw(const NMM::SerializedException&, const BindingException&);
    /** Disconnect this jack from its partner jack.
     */

    virtual void disconnect()
      throw(const NMM::SerializedException&);


  };

  typedef auto_ptr<IJack> IJack_var;




}

#include "nmm/nmm_suffix.hpp"

#endif
