log4tango 5.0.2
AppenderAttachable.hh
Go to the documentation of this file.
1//
2// AppenderAttachable.hh
3//
4// Copyright (C) : 2000 - 2002
5// LifeLine Networks BV (www.lifeline.nl). All rights reserved.
6// Bastiaan Bakker. All rights reserved.
7//
8// 2004,2005,2006,2007,2008,2009,2010,2011,2012
9// Synchrotron SOLEIL
10// L'Orme des Merisiers
11// Saint-Aubin - BP 48 - France
12//
13// This file is part of log4tango.
14//
15// Log4ango is free software: you can redistribute it and/or modify
16// it under the terms of the GNU Lesser General Public License as published by
17// the Free Software Foundation, either version 3 of the License, or
18// (at your option) any later version.
19//
20// Log4tango is distributed in the hope that it will be useful,
21// but WITHOUT ANY WARRANTY; without even the implied warranty of
22// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23// GNU Lesser General Public License for more details.
24//
25// You should have received a copy of the GNU Lesser General Public License
26// along with Log4Tango. If not, see <http://www.gnu.org/licenses/>.
27
28#ifndef _LOG4TANGO_APPENDER_ATTACHABLE_H
29#define _LOG4TANGO_APPENDER_ATTACHABLE_H
30
32#include <map>
33#include <vector>
34#include <log4tango/Appender.hh>
36
37namespace log4tango {
38
42typedef std::map<std::string, Appender*> AppenderMap;
43
47typedef AppenderMap::iterator AppenderMapIterator;
48
52typedef std::vector<Appender*> AppenderList;
53
54
55//-----------------------------------------------------------------------------
56// class : AppenderAttachable
57//-----------------------------------------------------------------------------
59{
60 public:
61
66
70 virtual ~AppenderAttachable ();
71
76 void add_appender (Appender* appender);
77
84 AppenderList get_all_appenders (void);
85
93 Appender* get_appender (const std::string& name);
94
99 bool is_attached (Appender* appender);
100
104 void remove_all_appenders();
105
109 void remove_appender(Appender* appender);
110
115 void remove_appender(const std::string& name);
116
117 protected:
118
123
128
131};
132
133} // namespace log4tango
134
135#endif // _LOG4TANGO_APPENDER_ATTACHABLE_H
#define LOG4TANGO_EXPORT
Definition: Export.hh:38
Definition: AppenderAttachable.hh:59
AppenderAttachable & operator=(const AppenderAttachable &other)
AppenderMap _appenders
Appenders repository.
Definition: AppenderAttachable.hh:122
AppenderAttachable(const AppenderAttachable &other)
threading::Mutex _appendersMutex
A mutex to protect the repository against race conditions.
Definition: AppenderAttachable.hh:127
Definition: Appender.hh:46
Definition: MSThreads.hh:75
Definition: Appender.hh:40
AppenderMap::iterator AppenderMapIterator
A map of appenders iterator.
Definition: AppenderAttachable.hh:47
std::vector< Appender * > AppenderList
Define what is a list of appenders.
Definition: AppenderAttachable.hh:52
std::map< std::string, Appender * > AppenderMap
A map of appenders.
Definition: AppenderAttachable.hh:42