From e83bbb457c98a0b77ca04e2832d7d0601912acd7 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Fri, 9 May 2014 20:24:12 +0200 Subject: Marked DomDocumentCache::item class as private * as the xerces document is not instantiated by DomDocumentCache::item and the class only exports a pointer to the converted xalan document, it makes no sense to expose the class to the outside in the first place --- src/support/dom/document_cache.cc | 4 ++-- src/support/dom/document_cache.h | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/support/dom') diff --git a/src/support/dom/document_cache.cc b/src/support/dom/document_cache.cc index c4c57d3..81d90aa 100644 --- a/src/support/dom/document_cache.cc +++ b/src/support/dom/document_cache.cc @@ -14,7 +14,7 @@ DomDocumentCache::optional_item DomDocumentCache::get(const std::string& key) { if ( itemIter == this->map_.end() ) { return optional_item(false, nullptr); } else { - return optional_item(true, (*itemIter).second.get()); + return optional_item(true, (*itemIter).second->getXalanDocument()); } } @@ -29,7 +29,7 @@ DomDocumentCache::optional_item DomDocumentCache::create( ); if ( result.second ) { - return optional_item(true, (*(result.first)).second.get()); + return optional_item(true, (*(result.first)).second->getXalanDocument()); } else { return optional_item(false, nullptr); } diff --git a/src/support/dom/document_cache.h b/src/support/dom/document_cache.h index af99102..cbac5c7 100644 --- a/src/support/dom/document_cache.h +++ b/src/support/dom/document_cache.h @@ -1,6 +1,8 @@ #ifndef INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_CACHE_H_ #define INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_CACHE_H_ +#include + #include #include @@ -8,12 +10,13 @@ #include #include +#include "common.h" + namespace InputXSLT { class DomDocumentCache { public: - class item; - typedef std::pair optional_item; + typedef std::pair optional_item; DomDocumentCache(); @@ -21,6 +24,8 @@ class DomDocumentCache { optional_item create(const std::string&, xercesc::DOMDocument*); private: + class item; + std::mutex write_mutex_; std::unordered_map> map_; -- cgit v1.2.3