Hi,

I just did a little cleanup. Here is a patch against current cvs.

I found out, that the forward-declarations for Appender, AppenderPtr and 
AppenderList in appenderattachable.h are useless, because appender.h is 
included.

I tried to replace std::vector with std::list in AppenderList. This failed 
because of this double-declaration. Using list instead of vector is possible, 
but it makes no big difference here, so I reverted my change.

Another fix I made is to define a typedef in domconfigurator.h for 
std::map<String, AppenderPtr>. I feel, that using typedefs for 
template-classes looks easier and the code is easier to change if needed (as 
replacing vector with list in class appender).


Tommi
Index: include/log4cxx/spi/appenderattachable.h
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/include/log4cxx/spi/appenderattachable.h,v
retrieving revision 1.9
diff -r1.9 appenderattachable.h
21d20
< #include <vector>
28,32d26
<     // Forward Declarations
<     class Appender;
<     typedef helpers::ObjectPtrT<Appender> AppenderPtr;
<     typedef std::vector<AppenderPtr> AppenderList;
< 
Index: include/log4cxx/xml/domconfigurator.h
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/include/log4cxx/xml/domconfigurator.h,v
retrieving revision 1.17
diff -r1.17 domconfigurator.h
74c74,75
< 			std::map<String, AppenderPtr> map;
---
>             typedef std::map<String, AppenderPtr> name_appender_map;
>             name_appender_map map;
Index: src/domconfigurator.cpp
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/src/domconfigurator.cpp,v
retrieving revision 1.15
diff -r1.15 domconfigurator.cpp
75c75
< 	std::map<String, AppenderPtr>::iterator it;
---
>     name_appender_map::iterator it;
88c88
< 	map.insert(std::map<String, AppenderPtr>::value_type(appenderName, appender));
---
>     map[appenderName] = appender;

Reply via email to