/* 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_STDNAMEDOBJECT_HPP_
#define _NMM_STDNAMEDOBJECT_HPP_

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/INamedImpl.hpp"

#include "visibility.hpp"

using namespace std;

namespace NMM {
  class DLLEXPORT StdNamedObject : public INamedImpl, public NamedObject {
    public:

    /** Default constructor.
     *
     * @param name name of this object
     */
    StdNamedObject(const string& name = "NMMObject");
    
    /** Destructor.
     */
    virtual ~StdNamedObject();

    /* Both event methods are still public because these methods are used in several nodes. */
    /** Returns name.
     *
     * @return name
     */
    virtual string getName()                                    const { return NamedObject::getName(); }

    /** Sets name.
     *
     * @param name name
     */
    virtual void setName(const string& name)                          { NamedObject::setName(name); }

    protected: //event methods

    /** Enables writing of error messages of given level to fstream with given name.
     *
     * @param filename name of fstream 
     * @param level level of error messages
     */
    virtual void setErrorStream(const string& filename, const nmm_int32& level);
    
    /** Enables writing of debug messages of given level to fstream with given name.
     *
     * @param filename name of fstream 
     * @param level level of error messages
     */
    virtual void setDebugStream(const string& filename, const nmm_int32& level);

    /** Enables writing of warning messages of given level to fstream with given name.
     *
     * @param filename name of fstream 
     * @param level level of error messages
     */
    virtual void setWarningStream(const string& filename, const nmm_int32& level);

    /** Enables writing of general messages of given level to fstream with given name.
     *
     * @param filename name of fstream 
     * @param level level of error messages
     */
    virtual void setMessageStream(const string& filename, const nmm_int32& level);

    private:
    vector<ostream*>          __error_stream;   ///< fstream for every level of error messages
    vector<ostream*>          __warning_stream; ///< fstream for every level of warning messages
    vector<ostream*>          __debug_stream;   ///< fstream for every level of debug messages
    vector<ostream*>          __message_stream; ///< fstream for every level of general messages
  };




}

#include "nmm/nmm_suffix.hpp"

#endif // _StdNamedObject_HPP_
