/* 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_IJackImpl_HPP
#define NMM_IJackImpl_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/NMMObject.hpp"
#include "IJack.hpp"


#include "visibility.hpp"

namespace NMM
{
   /** Interface of a jack.
    * An input or output jack is an instance of an input or output stream of a node.
    */

  class DLLEXPORT IJackImpl  : public virtual NMM::NMMObject { 
  public:
    IJackImpl() { addInterface(new IJack(*this)); registerEvents(); };

    virtual ~IJackImpl() {};

  protected:
    /** Get the jack tag of this jack.
     *
     * @return The jack tag of this jack
     */

    virtual string getJackTag() const = 0;
    /** Check if this jack is connected.
     *
     * @return @c true if this jack is connected, otherwise @c false
     */

    virtual nmm_bool isConnected() const = 0;
    /** 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 BindingException&) = 0;
    /** Disconnect this jack from its partner jack.
     */

    virtual void disconnect() = 0;


  private:
    void registerEvents();
  };

}

#include "nmm/nmm_suffix.hpp"

#endif
