diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-05-02 17:34:45 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-05-02 17:34:45 +0000 |
commit | 4bc0f1f2475d28d5e3e86d3a43cd50413300fb5b (patch) | |
tree | 0a183eb32423ca1177e59042d23b04fb8452452e /cpp/src/IceGrid/NodeCache.cpp | |
parent | modifying property name a bit (diff) | |
download | ice-4bc0f1f2475d28d5e3e86d3a43cd50413300fb5b.tar.bz2 ice-4bc0f1f2475d28d5e3e86d3a43cd50413300fb5b.tar.xz ice-4bc0f1f2475d28d5e3e86d3a43cd50413300fb5b.zip |
Cleaned up the server, adapter and object cache classes.
Diffstat (limited to 'cpp/src/IceGrid/NodeCache.cpp')
-rw-r--r-- | cpp/src/IceGrid/NodeCache.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp index afcedbe09f0..0005462bbf8 100644 --- a/cpp/src/IceGrid/NodeCache.cpp +++ b/cpp/src/IceGrid/NodeCache.cpp @@ -173,8 +173,13 @@ NodeEntryPtr NodeCache::get(const string& name, bool create) const { Lock sync(*this); - NodeCache& self = const_cast<NodeCache&>(*this); - NodeEntryPtr entry = self.getImpl(name, create); + NodeEntryPtr entry = getImpl(name); + if(!entry && create) + { + NodeCache& self = const_cast<NodeCache&>(*this); + entry = new NodeEntry(self, name); + self.addImpl(name, entry); + } if(!entry) { NodeNotExistException ex; @@ -184,7 +189,7 @@ NodeCache::get(const string& name, bool create) const return entry; } -NodeEntry::NodeEntry(Cache<string, NodeEntry>& cache, const std::string& name) : +NodeEntry::NodeEntry(NodeCache& cache, const std::string& name) : _cache(cache), _name(name) { |