/* 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_BINDING_EXCEPTION_HPP
#define NMM_BINDING_EXCEPTION_HPP NMM_BINDING_EXCEPTION_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/serialize/SerializedException.hpp"

#include "visibility.hpp"

namespace NMM {
  
  class InputJack;
  class OutputJack;
  
  /** This exception is thrown if a binding between two Nodes can not be established.
   */
  class DLLEXPORT BindingException : public SerializedException {
  public:
    /** Constructor.
     */
    BindingException();
    
    /** Constructor with extra comment.
     *
     * @param s describes the error 
     */
    BindingException(const std::string& s);
    
    /** Constructor with extra comment and the involved jacks specified.
     *
     * @param i_jack InputJack of the Node that should receive instream data from the other node
     * @param o_jack OutputJack of the Node that should send instream data to the other node 
     * @param s describes the error 
     */
    BindingException(const InputJack* i_jack, const OutputJack* o_jack, const std::string& s = std::string());
    
    /** Virtual copy constructor.
     *
     * @return pointer to a copy 
     */
    BindingException* copy() const;
 
    /** Returns the InputJack
     *
     * @return pointer to InputJack
     */    
    inline const InputJack* getInputJack()    const { return __input_jack;}
    
    /** Returns the OutputJack.
     *
     * @return pointer to OutputJack
     */    
    inline const OutputJack* getOutputJack()  const { return __output_jack;}
    
  private:
    const InputJack*  __input_jack;    ///< InputJack of the node that should receive instream data from the other node. 
    const OutputJack* __output_jack;   ///< OutputJack of the first Node that should send instream data to the other node 
  };
  
}

#include "nmm/nmm_suffix.hpp"

#endif
