# appenderattachableimpl.h

Go to the documentation of this file.

    00001 // Module:  Log4CPLUS
    00002 // File:    appenderattachableimpl.h
    00003 // Created: 6/2001
    00004 // Author:  Tad E. Smith
    00005 //
    00006 //
    00007 // Copyright (C) Tad E. Smith  All rights reserved.
    00008 //
    00009 // This software is published under the terms of the Apache Software
    00010 // License version 1.1, a copy of which has been included with this
    00011 // distribution in the LICENSE.APL file.
    00012 //
    00013
    00016 #ifndef _LOG4CPLUS_HELPERS_APPENDER_ATTACHABLE_IMPL_HEADER_
    00017 #define _LOG4CPLUS_HELPERS_APPENDER_ATTACHABLE_IMPL_HEADER_
    00018
    00019 #include <log4cplus/config.h>
    00020 #include <log4cplus/layout.h>
    00021 #include <log4cplus/tstring.h>
    00022 #include <log4cplus/helpers/logloguser.h>
    00023 #include <log4cplus/helpers/pointer.h>
    00024 #include <log4cplus/helpers/threads.h>
    00025 #include <log4cplus/spi/appenderattachable.h>
    00026
    00027 #include <memory>
    00028 #include <vector>
    00029
    00030
    00031 namespace log4cplus {
    00032     namespace helpers {
    00033
    00037         class LOG4CPLUS_EXPORT AppenderAttachableImpl
    00038                                    : public log4cplus::spi::AppenderAttachable,
    00039                                      protected log4cplus::helpers::LogLogUser
    00040         {
    00041         public:
    00042           // Data
    00043             LOG4CPLUS_MUTEX_PTR_DECLARE appender_list_mutex;
    00044
    00045           // Ctors
    00046             AppenderAttachableImpl();
    00047
    00048           // Dtor
    00049             virtual ~AppenderAttachableImpl();
    00050
    00051           // Methods
    00056             virtual void addAppender(SharedAppenderPtr newAppender);
    00057
    00061             virtual SharedAppenderPtrList getAllAppenders();
    00062
    00069             virtual SharedAppenderPtr getAppender(const log4cplus::tstring& name);
    00070
    00074             virtual void removeAllAppenders();
    00075
    00079             virtual void removeAppender(SharedAppenderPtr appender);
    00080
    00085             virtual void removeAppender(const log4cplus::tstring& name);
    00086
    00090             int appendLoopOnAppenders(const spi::InternalLoggingEvent& event) const;
    00091
    00092         protected:
    00093           // Types
    00094             typedef std::vector<SharedAppenderPtr> ListType;
    00095
    00096           // Data
    00098             ListType appenderList;
    00099         };  // end class AppenderAttachableImpl
    00100
    00101     } // end namespace helpers
    00102 } // end namespace log4cplus
    00103
    00104 #endif // _LOG4CPLUS_HELPERS_APPENDER_ATTACHABLE_IMPL_HEADER_
    00105