/* 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_IUDPControlImpl_HPP
#define NMM_IUDPControlImpl_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/NMMObject.hpp"
#include "IUDPControl.hpp"

#include "IIPControlImpl.hpp"

#include "visibility.hpp"

namespace NMM
{
  /** UDP control interface.
   * This interface is provided by the UDPStrategy for setting options and reading
   * statistics for the UDP transport protocol.
   *
   * @note Most of these options apply to the PacketINetStream and PacketONetStream
   * @note classes, which are used by the UDPStrategy, rather than the UDP protocol itself.
   * @note When this documetation refers to "packets", packets generated by these streams are meant.
   */

  class DLLEXPORT IUDPControlImpl  : virtual public IIPControlImpl { 
  public:
    IUDPControlImpl() { addInterface(new IUDPControl(*this)); registerEvents(); };

    virtual ~IUDPControlImpl() {};

  protected:
    /** @name Protocol Statistics
     */
//@{
    /** Reset all statistics.
     * This method resets all statistics that can be queried by the other methods
     * to their initial values.
     */

    virtual void resetStatistics() = 0;
    /** Get total number of sent bytes.
     * This method returns the total number of bytes sent over the network.
     *
     * @return Total number of sent bytes
     */

    virtual nmm_uint32 getTotalSentBytes() const = 0;
    /** Get total number of received bytes.
     * This method returns the total number of bytes received over the network.
     *
     * @return Total number of received bytes
     */

    virtual nmm_uint32 getTotalReceivedBytes() const = 0;
    /** Get total number of sent packets.
     * This method returns the total number of packets which have been sent over the network.
     *
     * @return Total number of sent packets
     */

    virtual nmm_uint32 getTotalSentPackets() const = 0;
    /** Get total number of received packets.
     * This method returns the total number of packets which have been received from the network.
     *
     * @return Total number of received packets
     */

    virtual nmm_uint32 getTotalReceivedPackets() const = 0;
    /** Get total number of discarded packets.
     * This method returns the total number of packets which have been discarded because they arrived
     * out of order.
     *
     * @return Total number of discarded packets
     */

    virtual nmm_uint32 getTotalDiscardedPackets() const = 0;
    /** Get total number of lost packets.
     * This method returns the total number of packets which are considered lost because they
     * were expected but did not arrive.
     *
     * @return Total number of lost packets
     */

    virtual nmm_uint32 getTotalLostPackets() const = 0;

//@}

  private:
    void registerEvents();
  };

}

#include "nmm/nmm_suffix.hpp"

#endif
