/* 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_INamed_HPP
#define NMM_INamed_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/Interface.hpp"
#include "nmm/comm/messaging/Event.hpp"
#include "nmm/comm/messaging/IllegalStateException.hpp"
#include <memory>


#include "visibility.hpp"

namespace NMM
{
  /** Interface to NamedObject.
   */

  class DLLEXPORT INamed : virtual public NMM::Interface { 
  public:
    INamed() : NMM::Interface(INamed::INamed_type, "NMM") { };

    INamed(NMM::NMMObject& parent) : NMM::Interface (parent, INamed::INamed_type, "NMM") { };

    virtual ~INamed() {};

    static const char* INamed_type;

    virtual  string getInterfaceType() const { return INamed_type; }

    NMM::Interface* copy() const { return new INamed(*this); }
    static void used(); 
    static const char* setName_event;
    static const char* getName_event;
    static const char* setErrorStream_event;
    static const char* setDebugStream_event;
    static const char* setWarningStream_event;
    static const char* setMessageStream_event;
    /** Assigns a name to this object.
     *
     * @param name of the object
     */

    virtual void setName(const string& name)
      throw(const NMM::SerializedException&);
    /** Returns the name of this object.
     *
     * @return name of the object
     */

    virtual string getName() const
      throw(const NMM::SerializedException&);
    /** Redirects the error stream to a file for a given message level.
     *
     * @param filename for error stream
     * @param error_level The message level
     */

    virtual void setErrorStream(const string& filename, const nmm_int32& error_level)
      throw(const NMM::SerializedException&);
    /** Redirects the debug stream to a file for a given message level.
     *
     * @param filename for debug stream
     * @param debug_level The message level
     */

    virtual void setDebugStream(const string& filename, const nmm_int32& debug_level)
      throw(const NMM::SerializedException&);
    /** Redirects the warning stream to a file for a given message level.
     *
     * @param filename for warning stream
     * @param warning_level The message level
     */

    virtual void setWarningStream(const string& filename, const nmm_int32& warning_level)
      throw(const NMM::SerializedException&);
    /** Redirects the message stream to a file for a given message level.
     *
     * @param filename for message stream
     * @param message_level The message level
     */

    virtual void setMessageStream(const string& filename, const nmm_int32& message_level)
      throw(const NMM::SerializedException&);


  };

  typedef auto_ptr<INamed> INamed_var;




}

#include "nmm/nmm_suffix.hpp"

#endif
