/* 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_VALUE_STREAM_CONSTRUCTOR_HPP
#define NMM_VALUE_STREAM_CONSTRUCTOR_HPP NMM_VALUE_STREAM_CONSTRUCTOR_HPP

#include "nmm/nmm_prefix.hpp"

#include <string>

namespace NMM {

  class IValueStream;
  class OValueStream;

  /** Value stream constructor.
   * This class is an abstract factory object for instantiating a pair of value stream classes.
   * A value stream constructor can create the input and output value stream objects of a value stream type,
   * such as MagicNumberIValueStream and MagicNumberOValueStream.
   *
   * A value constructor is created as a global object. It automatically registers and unregisters
   * itself at the ValueFactory.
   */
  class ValueStreamConstructor {
  public:
    /** @name Constructor & Destructor
     */
    //@{
    /** Constructor.
     *
     * @param i_stream Type name of the IValueStream class
     * @param o_stream Type name of the OValueStream class
     */
    ValueStreamConstructor(const std::string& i_stream, const std::string& o_stream);

    /** Virtual destructor.
     */
    virtual ~ValueStreamConstructor() {}

    /** Virtual copy constructor.
     *
     * @return A copy of this object which has the same type
     */
    virtual ValueStreamConstructor* copy() const = 0;
    //@}

    /** @name Factory Methods
     */
    //@{
    /** Create an input value stream.
     * This method creates an instance of the input value stream class of this value stream type.
     *
     * @return A new input value stream
     */
    virtual IValueStream* createIValueStream()     const = 0;

    /** Create an output value stream.
     * This method creates an instance of the output value stream class of this value stream type.
     *
     * @return A new output value stream
     */
    virtual OValueStream* createOValueStream()     const = 0;
    //@}
  private:
    std::string __i_stream;        ///< Type name of the IValueStream class
    std::string __o_stream;        ///< Type name of the OValueStream class
  };
  
}

#include "nmm/nmm_suffix.hpp"

#endif
