Apache log4cxx  Version 0.11.0
appenderattachable.h
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _LOG4CXX_SPI_APPENDER_ATTACHABLE_H_
19 #define _LOG4CXX_SPI_APPENDER_ATTACHABLE_H_
20 
21 #if defined(_MSC_VER)
22  #pragma warning ( push )
23  #pragma warning ( disable: 4231 4251 4275 4786 )
24 #endif
25 
26 #include <log4cxx/logstring.h>
27 #include <vector>
28 #include <log4cxx/helpers/objectptr.h>
29 #include <log4cxx/helpers/object.h>
30 #include <log4cxx/appender.h>
31 
32 namespace log4cxx
33 {
34 namespace spi
35 {
39 class LOG4CXX_EXPORT AppenderAttachable : public virtual helpers::Object
40 {
41  public:
42  // Methods
43  DECLARE_ABSTRACT_LOG4CXX_OBJECT(AppenderAttachable)
44 
45 
48  virtual void addAppender(const AppenderPtr& newAppender) = 0;
49 
53  virtual AppenderList getAllAppenders() const = 0;
54 
58  virtual AppenderPtr getAppender(const LogString& name) const = 0;
59 
64  virtual bool isAttached(const AppenderPtr& appender) const = 0;
65 
69  virtual void removeAllAppenders() = 0;
70 
74  virtual void removeAppender(const AppenderPtr& appender) = 0;
75 
80  virtual void removeAppender(const LogString& name) = 0;
81 
82  // Dtor
83  virtual ~AppenderAttachable() {}
84 };
85 
86 LOG4CXX_PTR_DEF(AppenderAttachable);
87 }
88 }
89 
90 #if defined(_MSC_VER)
91  #pragma warning ( pop )
92 #endif
93 
94 #endif //_LOG4CXX_SPI_APPENDER_ATTACHABLE_H_
This Interface is for attaching Appenders to objects.
Definition: appenderattachable.h:39
base class for java-like objects.
Definition: object.h:102
Definition: appender.h:33