/* 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_OUTOFBAND_STRATEGY_DESCRIPTION_HPP_
#define _NMM_OUTOFBAND_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 out-of-band TransportStrategy.
   *
   * In addition to a basic strategy description, this class contains the configuration of the
   * request and reply sides of the sub-binding.
   */
  class DLLEXPORT OutOfBandStrategyDescription
    : public StrategyDescription
  {
  public:
    /** @name Constructor & Destructor
     */
    //@{
    /** Default constructor.
     */
    OutOfBandStrategyDescription();
    
    /** Copy constructor.
     *
     * @param obsd OutOfBandStrategyDescription to coyp
     */
    OutOfBandStrategyDescription(const OutOfBandStrategyDescription& obsd);
    
    /** Virtual copy constructor.
     *
     * @return pointer to copy of this OutOfBandStrategyDescription
     */
    virtual OutOfBandStrategyDescription* copy() const { return new OutOfBandStrategyDescription(*this); }
    //@}
    
    /** @name Access Methods
     */
    //@{
    /** Returns configuration of the request side.
     *
     * @return CEvent which contains Events to configure request side
     */
    inline const CEvent& getRequestConfig() const { return __request_config; }
    
    /** Returns configuration of the reply side.
     *
     * @return CEvent which contains Events to configure reply side
     */
    inline const CEvent& getReplyConfig()   const { return __reply_config; }
    
    /** Returns configuration of the request side.
     *
     * @return CEvent which contains Events to configure request side
     */
    inline       CEvent& getRequestConfig()       { return __request_config; }
    
    /** Returns configuration of the reply side.
     *
     * @return CEvent which contains Events to configure reply side
     */
    inline       CEvent& getReplyConfig()         { return __reply_config; }
    
    /** Adds a configuration event on the request side.
     *
     * @param event configuration event to add
     */
    void addRequestConfigEvent(const Event& event);
    
    /** Adds a configuration event on the reply side.
     *
     * @param event configuration event to add
     */
    void addReplyConfigEvent(const Event& event);
    //@}
    
  private:
    /** Register attributes for serialization/deserialization.
     */
    void registerAttributes();
    
  private:
    CEvent __request_config;          ///< Configuration of the request side
    CEvent __reply_config;            ///< Configuration of the reply side
  };
}
#include "nmm/nmm_suffix.hpp"

#endif
