Apache Log4cxx  Version 2.0.0
Loading...
Searching...
No Matches
appenderattachable.h
Go to the documentation of this file.
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#include <log4cxx/logstring.h>
23#include <vector>
24
25namespace LOG4CXX_NS
26{
27class Appender;
28LOG4CXX_PTR_DEF(Appender);
29LOG4CXX_LIST_DEF(AppenderList, AppenderPtr);
30
31namespace spi
32{
36class LOG4CXX_EXPORT AppenderAttachable : public virtual helpers::Object
37{
38 public:
39 // Methods
41
42
45 virtual void addAppender(const AppenderPtr& newAppender) = 0;
46
50 virtual AppenderList getAllAppenders() const = 0;
51
55 virtual AppenderPtr getAppender(const LogString& name) const = 0;
56
61 virtual bool isAttached(const AppenderPtr& appender) const = 0;
62
66 virtual void removeAllAppenders() = 0;
67
72 virtual bool removeAppender(const AppenderPtr& appender) = 0;
73
78 virtual bool removeAppender(const LogString& name) = 0;
79
84 virtual bool replaceAppender(const AppenderPtr& oldAppender, const AppenderPtr& newAppender) = 0;
85
89 virtual void replaceAppenders(const AppenderList& newList) = 0;
90
91 // Dtor
92 virtual ~AppenderAttachable() {}
93};
94
96}
97}
98
99#endif //_LOG4CXX_SPI_APPENDER_ATTACHABLE_H_
base class for java-like objects.
Definition object.h:101
This Interface is for attaching Appenders to objects.
Definition appenderattachable.h:37
virtual AppenderList getAllAppenders() const =0
Get all previously added appenders as an AppenderList.
virtual void addAppender(const AppenderPtr &newAppender)=0
Add an appender.
virtual void removeAllAppenders()=0
Remove all previously added appenders.
virtual bool replaceAppender(const AppenderPtr &oldAppender, const AppenderPtr &newAppender)=0
Replace oldAppender with newAppender.
virtual bool isAttached(const AppenderPtr &appender) const =0
Returns true if the specified appender is in list of attached appenders, false otherwise.
virtual bool removeAppender(const AppenderPtr &appender)=0
Remove appender from the list of appenders.
virtual void replaceAppenders(const AppenderList &newList)=0
Replace any previously added appenders with newList.
virtual AppenderPtr getAppender(const LogString &name) const =0
Get an appender by name.
LOG4CXX_PTR_DEF(LoggingEvent)
LOG4CXX_LIST_DEF(AppenderList, AppenderPtr)
std::basic_string< logchar > LogString
Definition logstring.h:51
std::shared_ptr< Appender > AppenderPtr
Definition basicconfigurator.h:29
LOG4CXX_PTR_DEF(Appender)
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition object.h:37