appenderattachableimpl.h
Go to the documentation of this file.
// -*- C++ -*-
// Module: Log4CPLUS
// File: appenderattachableimpl.h
// Created: 6/2001
// Author: Tad E. Smith
//
//
// Copyright 2001-2017 Tad E. Smith
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef LOG4CPLUS_HELPERS_APPENDER_ATTACHABLE_IMPL_HEADER_
#define LOG4CPLUS_HELPERS_APPENDER_ATTACHABLE_IMPL_HEADER_
#include <log4cplus/config.hxx>
#if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
#pragma once
#endif
#include <log4cplus/tstring.h>
#include <log4cplus/helpers/pointer.h>
#include <log4cplus/spi/appenderattachable.h>
#include <log4cplus/thread/syncprims.h>
#include <memory>
#include <vector>
namespace log4cplus {
namespace helpers {
class LOG4CPLUS_EXPORT AppenderAttachableImpl
: public log4cplus::spi::AppenderAttachable
{
public:
// Data
thread::Mutex appender_list_mutex;
// Ctors
AppenderAttachableImpl();
// Dtor
virtual ~AppenderAttachableImpl();
// Methods
virtual void addAppender(SharedAppenderPtr newAppender);
virtual SharedAppenderPtrList getAllAppenders();
virtual SharedAppenderPtr getAppender(const log4cplus::tstring& name);
virtual void removeAllAppenders();
virtual void removeAppender(SharedAppenderPtr appender);
virtual void removeAppender(const log4cplus::tstring& name);
int appendLoopOnAppenders(const spi::InternalLoggingEvent& event) const;
protected:
// Types
typedef std::vector<SharedAppenderPtr> ListType;
// Data
ListType appenderList;
private:
AppenderAttachableImpl(AppenderAttachableImpl const &);
AppenderAttachableImpl & operator = (AppenderAttachableImpl const &);
}; // end class AppenderAttachableImpl
} // end namespace helpers
} // end namespace log4cplus
#endif // LOG4CPLUS_HELPERS_APPENDER_ATTACHABLE_IMPL_HEADER_
appenderattachable.h
log4cplus::helpers::AppenderAttachableImpl::appenderList
ListType appenderList
Array of appenders.
Definition appenderattachableimpl.h:108
log4cplus::helpers::AppenderAttachableImpl::removeAllAppenders
virtual void removeAllAppenders()
Remove all previously added appenders.
log4cplus::helpers::AppenderAttachableImpl::appender_list_mutex
thread::Mutex appender_list_mutex
Definition appenderattachableimpl.h:53
log4cplus::helpers::AppenderAttachableImpl::removeAppender
virtual void removeAppender(const log4cplus::tstring &name)
Remove the appender with the name passed as parameter from the list of appenders.
log4cplus::helpers::AppenderAttachableImpl::appendLoopOnAppenders
int appendLoopOnAppenders(const spi::InternalLoggingEvent &event) const
Call the doAppend method on all attached appenders.
log4cplus::helpers::AppenderAttachableImpl::AppenderAttachableImpl
AppenderAttachableImpl()
log4cplus::helpers::AppenderAttachableImpl::getAppender
virtual SharedAppenderPtr getAppender(const log4cplus::tstring &name)
Look for an attached appender named as name.
log4cplus::helpers::AppenderAttachableImpl::~AppenderAttachableImpl
virtual ~AppenderAttachableImpl()
log4cplus::helpers::AppenderAttachableImpl::ListType
std::vector< SharedAppenderPtr > ListType
Definition appenderattachableimpl.h:104
log4cplus::helpers::AppenderAttachableImpl::addAppender
virtual void addAppender(SharedAppenderPtr newAppender)
Add an appender.
log4cplus::helpers::AppenderAttachableImpl::getAllAppenders
virtual SharedAppenderPtrList getAllAppenders()
Get all previously added appenders as an vectory.
log4cplus::helpers::AppenderAttachableImpl::removeAppender
virtual void removeAppender(SharedAppenderPtr appender)
Remove the appender passed as parameter from the list of appenders.
log4cplus::spi::AppenderAttachable
This Interface is for attaching Appenders to objects.
Definition appenderattachable.h:47
log4cplus::spi::InternalLoggingEvent
The internal representation of logging events.
Definition loggingevent.h:51
log4cplus::thread::Mutex
Definition syncprims.h:83
config.hxx
log4cplus::helpers
Definition appender.h:50
log4cplus
Definition appender.h:46
log4cplus::SharedAppenderPtr
helpers::SharedObjectPtr< Appender > SharedAppenderPtr
This is a pointer to an Appender.
Definition appender.h:336
log4cplus::tstring
std::basic_string< tchar > tstring
Definition tstring.h:39
log4cplus::SharedAppenderPtrList
std::vector< log4cplus::SharedAppenderPtr > SharedAppenderPtrList
Definition appenderattachable.h:40
pointer.h
syncprims.h
tstring.h
LOG4CPLUS_EXPORT
#define LOG4CPLUS_EXPORT
Definition win32.h:141