/* 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_INSTREAM_STRATEGY_DESCRIPTION_HPP_
#define _NMM_INSTREAM_STRATEGY_DESCRIPTION_HPP_

#include "nmm/nmm_prefix.hpp"

#include "StrategyDescription.hpp"
#include "nmm/comm/messaging/CEvent.hpp"
#include "visibility.hpp"

namespace NMM {  
  
  /** This class describes an instream TransportStrategy.
   * In addition to a basic strategy description, this class contains the configuration of the
   * upstream and downstream sides of the sub-binding.
   */
  class DLLEXPORT InstreamStrategyDescription
    : public StrategyDescription
  {
  public:
    /** @name Constructor & Destructor
     */
    //@{
    /** Default constructor.
     */
    InstreamStrategyDescription();
    
    /** Copy constructor.
     * @param other reference to InstreamStrategyDescription to copy
     */
    InstreamStrategyDescription(const InstreamStrategyDescription& other);
    
    /** Virtual copy constructor.
     * @return pointer to copy of this InstreamStrategyDescription
     */
    virtual InstreamStrategyDescription* copy() const { return new InstreamStrategyDescription(*this); }
    //@}
    
    /** @name Access Methods
     */
    //@{
    /** Get configuration of the upstream side.
     * @return configuration as CEvent
     */
    inline const CEvent& getUpstreamConfig()   const { return __upstream_config; }
    
    /** Get configuration of the downstream side.
     * @return configuration as CEvent
     */
    inline const CEvent& getDownstreamConfig() const { return __downstream_config; }
    
    /** Get configuration of the upstream side.
     * @return configuration as CEvent 
     */
    inline       CEvent& getUpstreamConfig()         { return __upstream_config; }
    
    /** Get configuration of the downstream side.
     * @return configuration as CEvent
     */
    inline       CEvent& getDownstreamConfig()       { return __downstream_config; }
    
    /** Add a configuration event on the upstream side.
     * @param event Event to be added 
     */
    void addUpstreamConfigEvent(const Event& event);
    
    /** Add a configuration event on the downstream side.
     * @param event Event to be added 
     */
    void addDownstreamConfigEvent(const Event& event);
    //@}
    
  private:
    /** Register attributes for serialization/deserialization.
     */
    void registerAttributes();
    
  private:
    CEvent __upstream_config;          ///< Configuration of the upstream side
    CEvent __downstream_config;        ///< Configuration of the downstream side
  };
}

#include "nmm/nmm_suffix.hpp"

#endif
