/* 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_RESPONSE_HPP
#define NMM_RESPONSE_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/ObjectID.hpp"
#include "RegistryID.hpp"
#include <list>

#include "visibility.hpp"

namespace NMM {

  /** Typedef needed to specify a list of objects and the corresponding registry.
      A registry may return a Response on some requests.
      A Response contains a list of ObjectIDs and the registry, where the corresponding objects are registered.
  */
  typedef std::pair<RegistryID, std::list<ObjectID> > Response;
  
  /** This method writes a Response to an output value stream.
   * @param ov reference to OValueStream to write Responce to
   * @param response reference to Response to be writen
   */
  DLLEXPORT OValueStream& operator<<(OValueStream& ov, const Response& response);
  
  /** This method writes a list of Response to an output value stream.
   * @param ov reference to OValueStream to write Responce to
   * @param string_list list of Response's to be writen 
   */
  DLLEXPORT OValueStream& operator<<(OValueStream& ov, const std::list<Response>& string_list);

  /** This method reads a Response from an input value stream.
   * @param iv reference to IValueStream to read Response from
   * @param response reference to Response variable to read to
   */
  DLLEXPORT IValueStream& operator>>(IValueStream& iv, Response& response);

  /** This method reads a list of Response from an input value stream.
   * @param iv reference to IValueStream to read Response from
   * @param string_list reference to list of Response's to read to
   */
  DLLEXPORT IValueStream& operator>>(IValueStream& iv, std::list<Response>& string_list);
}
#include "nmm/nmm_suffix.hpp"

#endif
