\r
#include "base.h"\r
#include "XMLToolingConfig.h"\r
+#include "util/ParserPool.h"\r
\r
#include <vector>\r
\r
#define XMLTOOLING_LOGCAT "XMLTooling"\r
\r
-namespace {\r
+namespace xmltooling {\r
\r
class XMLToolingInternalConfig : public xmltooling::XMLToolingConfig\r
{\r
public:\r
- XMLToolingInternalConfig() : m_lock(NULL) {}\r
+ XMLToolingInternalConfig() : m_lock(NULL), m_parserPool(NULL) {}\r
+\r
+ static XMLToolingInternalConfig& getInternalConfig();\r
\r
// global per-process setup and shutdown of runtime\r
bool init();\r
bool load_library(const char* path, void* context=NULL);\r
bool log_config(const char* config=NULL);\r
\r
+ // internal parser pool\r
+ xmltooling::ParserPool* m_parserPool;\r
+\r
private:\r
std::vector<void*> m_libhandles;\r
void* m_lock;\r
//PlugManager m_plugMgr;\r
};\r
\r
+ // Template cleanup functors for use with for_each algorithm\r
+ template<class T> struct cleanup\r
+ {\r
+ void operator()(T* ptr) {delete ptr;}\r
+ void operator()(const T* ptr) {delete const_cast<T*>(ptr);}\r
+ };\r
+\r
+ template<class A,class B> struct cleanup_pair\r
+ {\r
+ void operator()(const std::pair<A,B*>& p) {delete p.second;}\r
+ };\r
};\r
\r
#endif /* __xmltooling_internal_h__ */\r