/*
 * SPDX-FileCopyrightText: 2000-2002 Copyright LifeLine Networks BV (www.lifeline.nl)
 * SPDX-FileCopyrightText: 2000-2002 Copyright Bastiaan Bakker
 * SPDX-FileCopyrightText: 2004 Copyright contributors to the cppTango project
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#ifndef TANGO_COMMON_LOG4TANGO_LAYOUTAPPENDER_H
#define TANGO_COMMON_LOG4TANGO_LAYOUTAPPENDER_H

#include <tango/common/log4tango/Appender.h>
#include <tango/common/log4tango/PatternLayout.h>
#include <tango/common/log4tango/Portability.h>

#include <string>

namespace log4tango
{

//-----------------------------------------------------------------------------
// class : LayoutAppender (superclass for appenders that require a Layout)
//-----------------------------------------------------------------------------
class LayoutAppender : public Appender
{
  public:
    typedef PatternLayout DefaultLayoutType;

    LayoutAppender(const std::string &name);

    ~LayoutAppender() override;

    bool requires_layout() const override;

    void set_layout(Layout *layout = nullptr) override;

  protected:
    Layout &get_layout();

  private:
    Layout *_layout;
};

} // namespace log4tango

#endif // TANGO_COMMON_LOG4TANGO_LAYOUTAPPENDER_H
