log4cplus  2.0.5
appenderattachableimpl.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 // Module: Log4CPLUS
3 // File: appenderattachableimpl.h
4 // Created: 6/2001
5 // Author: Tad E. Smith
6 //
7 //
8 // Copyright 2001-2017 Tad E. Smith
9 //
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 // http://www.apache.org/licenses/LICENSE-2.0
15 //
16 // Unless required by applicable law or agreed to in writing, software
17 // distributed under the License is distributed on an "AS IS" BASIS,
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 // See the License for the specific language governing permissions and
20 // limitations under the License.
21 
24 #ifndef LOG4CPLUS_HELPERS_APPENDER_ATTACHABLE_IMPL_HEADER_
25 #define LOG4CPLUS_HELPERS_APPENDER_ATTACHABLE_IMPL_HEADER_
26 
27 #include <log4cplus/config.hxx>
28 
29 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
30 #pragma once
31 #endif
32 
33 #include <log4cplus/tstring.h>
37 
38 #include <memory>
39 #include <vector>
40 
41 
42 namespace log4cplus {
43  namespace helpers {
44 
50  {
51  public:
52  // Data
54 
55  // Ctors
57 
58  // Dtor
60 
61  // Methods
66  virtual void addAppender(SharedAppenderPtr newAppender);
67 
72 
80 
84  virtual void removeAllAppenders();
85 
89  virtual void removeAppender(SharedAppenderPtr appender);
90 
95  virtual void removeAppender(const log4cplus::tstring& name);
96 
101 
102  protected:
103  // Types
104  typedef std::vector<SharedAppenderPtr> ListType;
105 
106  // Data
109 
110  private:
112  AppenderAttachableImpl & operator = (AppenderAttachableImpl const &);
113  }; // end class AppenderAttachableImpl
114 
115  } // end namespace helpers
116 } // end namespace log4cplus
117 
118 #endif // LOG4CPLUS_HELPERS_APPENDER_ATTACHABLE_IMPL_HEADER_
119 
tstring.h
log4cplus::helpers::AppenderAttachableImpl
This Interface is for attaching Appenders to objects.
Definition: appenderattachableimpl.h:50
log4cplus
Definition: appender.h:46
log4cplus::tstring
std::basic_string< tchar > tstring
Definition: tstring.h:39
log4cplus::helpers::SharedObjectPtr
Definition: pointer.h:101
log4cplus::helpers::AppenderAttachableImpl::AppenderAttachableImpl
AppenderAttachableImpl()
log4cplus::helpers::AppenderAttachableImpl::getAllAppenders
virtual SharedAppenderPtrList getAllAppenders()
Get all previously added appenders as an vectory.
log4cplus::helpers::AppenderAttachableImpl::~AppenderAttachableImpl
virtual ~AppenderAttachableImpl()
log4cplus::helpers::AppenderAttachableImpl::appenderList
ListType appenderList
Array of appenders.
Definition: appenderattachableimpl.h:108
log4cplus::helpers::AppenderAttachableImpl::addAppender
virtual void addAppender(SharedAppenderPtr newAppender)
Add an appender.
log4cplus::helpers::AppenderAttachableImpl::ListType
std::vector< SharedAppenderPtr > ListType
Definition: appenderattachableimpl.h:104
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::getAppender
virtual SharedAppenderPtr getAppender(const log4cplus::tstring &name)
Look for an attached appender named as name.
config.hxx
pointer.h
log4cplus::helpers::AppenderAttachableImpl::appendLoopOnAppenders
int appendLoopOnAppenders(const spi::InternalLoggingEvent &event) const
Call the doAppend method on all attached appenders.
log4cplus::helpers::AppenderAttachableImpl::appender_list_mutex
thread::Mutex appender_list_mutex
Definition: appenderattachableimpl.h:53
appenderattachable.h
log4cplus::helpers::AppenderAttachableImpl::removeAppender
virtual void removeAppender(SharedAppenderPtr appender)
Remove the appender passed as parameter from the list of appenders.
log4cplus::spi::InternalLoggingEvent
The internal representation of logging events.
Definition: loggingevent.h:51
log4cplus::spi::AppenderAttachable
This Interface is for attaching Appenders to objects.
Definition: appenderattachable.h:47
LOG4CPLUS_EXPORT
#define LOG4CPLUS_EXPORT
Definition: win32.h:141
log4cplus::helpers::AppenderAttachableImpl::removeAllAppenders
virtual void removeAllAppenders()
Remove all previously added appenders.
log4cplus::SharedAppenderPtrList
std::vector< log4cplus::SharedAppenderPtr > SharedAppenderPtrList
Definition: appenderattachable.h:40
log4cplus::thread::Mutex
Definition: syncprims.h:64
syncprims.h