Mercurial > hg > orthanc
comparison Core/Cache/MemoryCache.h @ 285:4031f73fe0e4
access to the raw dicom tags
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 12 Dec 2012 17:53:14 +0100 |
parents | 06aa7b7b6723 |
children | bdd72233b105 |
comparison
equal
deleted
inserted
replaced
284:06aa7b7b6723 | 285:4031f73fe0e4 |
---|---|
55 CacheIndex<std::string, Page*> index_; | 55 CacheIndex<std::string, Page*> index_; |
56 | 56 |
57 Page& Load(const std::string& id); | 57 Page& Load(const std::string& id); |
58 | 58 |
59 public: | 59 public: |
60 class Accessor | |
61 { | |
62 friend class MemoryCache; | |
63 | |
64 private: | |
65 Page& element_; | |
66 | |
67 Accessor(Page& element) : | |
68 element_(element) | |
69 { | |
70 } | |
71 | |
72 public: | |
73 const std::string GetId() const | |
74 { | |
75 return element_.id_; | |
76 } | |
77 | |
78 IDynamicObject& GetContent() | |
79 { | |
80 return *element_.content_; | |
81 } | |
82 | |
83 const IDynamicObject& GetContent() const | |
84 { | |
85 return *element_.content_; | |
86 } | |
87 }; | |
88 | |
89 MemoryCache(ICachePageProvider& provider, | 60 MemoryCache(ICachePageProvider& provider, |
90 size_t cacheSize); | 61 size_t cacheSize); |
91 | 62 |
92 ~MemoryCache(); | 63 ~MemoryCache(); |
93 | 64 |
94 Accessor* Access(const std::string& id); | 65 IDynamicObject& Access(const std::string& id); |
95 }; | 66 }; |
96 } | 67 } |