diff options
Diffstat (limited to 'src/support/dom/document_cache.h')
-rw-r--r-- | src/support/dom/document_cache.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/support/dom/document_cache.h b/src/support/dom/document_cache.h index 287a316..af99102 100644 --- a/src/support/dom/document_cache.h +++ b/src/support/dom/document_cache.h @@ -1,8 +1,11 @@ #ifndef INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_CACHE_H_ #define INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_CACHE_H_ -#include <unordered_map> +#include <xercesc/dom/DOMDocument.hpp> + #include <string> +#include <mutex> +#include <unordered_map> #include <memory> namespace InputXSLT { @@ -10,12 +13,15 @@ namespace InputXSLT { class DomDocumentCache { public: class item; + typedef std::pair<bool, item*> optional_item; DomDocumentCache(); - item* get(const std::string&); + optional_item get(const std::string&); + optional_item create(const std::string&, xercesc::DOMDocument*); private: + std::mutex write_mutex_; std::unordered_map<std::string, std::unique_ptr<item>> map_; }; |