[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 7f9eece 07/10: Remove old caching from DBDict
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 7f9eece 07/10: Remove old caching from DBDictionary (VS) |
Date: |
Tue, 2 Aug 2016 12:35:20 +0000 (UTC) |
branch: master
commit 7f9eece46a3d14482c9fe173a13823edbfd732f9
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Remove old caching from DBDictionary (VS)
Reference:
http://lists.nongnu.org/archive/html/lmi/2012-06/msg00008.html
---
dbdict.cpp | 23 -----------------------
dbdict.hpp | 4 ----
2 files changed, 27 deletions(-)
diff --git a/dbdict.cpp b/dbdict.cpp
index c2311fe..acfb0c4 100644
--- a/dbdict.cpp
+++ b/dbdict.cpp
@@ -50,8 +50,6 @@
template class xml_serializable<DBDictionary>;
-std::string DBDictionary::cached_filename_;
-
namespace xml_serialize
{
template<> struct xml_io<database_entity>
@@ -436,41 +434,21 @@ void DBDictionary::ascribe_members()
}
/// Read and cache a database file.
-///
-/// Perform the expensive operation of reading the dictionary from
-/// file only if the cached file name doesn't match the new filename.
void DBDictionary::Init(std::string const& filename)
{
LMI_ASSERT(!filename.empty());
- if(filename == cached_filename_)
- {
- return;
- }
try
{
- cached_filename_ = filename;
load(filename);
}
catch(...)
{
- InvalidateCache();
report_exception();
}
}
-/// Cause next Init() call to read from file instead of using cache.
-///
-/// The implementation simply sets the cached filename to an empty
-/// string, which is its initial value upon (static) construction and
-/// cannot validly name any file.
-
-void DBDictionary::InvalidateCache()
-{
- cached_filename_.clear();
-}
-
/// Save file, invalidating the cache.
///
/// If data are modified (by the GUI product editor) and saved under a
@@ -480,7 +458,6 @@ void DBDictionary::InvalidateCache()
void DBDictionary::WriteDB(std::string const& filename) const
{
- InvalidateCache();
save(filename);
}
diff --git a/dbdict.hpp b/dbdict.hpp
index f825e9e..6069ca7 100644
--- a/dbdict.hpp
+++ b/dbdict.hpp
@@ -69,8 +69,6 @@ class LMI_SO DBDictionary
void Add(database_entity const&);
void InitDB();
- static void InvalidateCache();
-
// xml_serializable required implementation.
virtual int class_version() const;
virtual std::string const& xml_root_name() const;
@@ -90,8 +88,6 @@ class LMI_SO DBDictionary
,std::string const& file_leaf_name
) const;
- static std::string cached_filename_;
-
database_entity MinIssAge ;
database_entity MaxIssAge ;
database_entity MaxIncrAge ;
- [lmi-commits] [lmi] master updated (a60bbf4 -> 4591445), Greg Chicares, 2016/08/02
- [lmi-commits] [lmi] master cc4b3eb 01/10: Expunge superfluous typenames, Greg Chicares, 2016/08/02
- [lmi-commits] [lmi] master fd26a86 05/10: Expunge typedefs that are no longer helpful, Greg Chicares, 2016/08/02
- [lmi-commits] [lmi] master 469307a 03/10: Use 'auto' for iterator type, Greg Chicares, 2016/08/02
- [lmi-commits] [lmi] master 780fb8b 04/10: Deduce pair type rather than specify it, Greg Chicares, 2016/08/02
- [lmi-commits] [lmi] master b178f96 02/10: Improve typedef-names for type retrieved from cache, Greg Chicares, 2016/08/02
- [lmi-commits] [lmi] master 80a031e 06/10: Expunge an intermediate variable, and simplify control flow, Greg Chicares, 2016/08/02
- [lmi-commits] [lmi] master 4591445 10/10: Initialize antediluvian database statically, Greg Chicares, 2016/08/02
- [lmi-commits] [lmi] master 7f9eece 07/10: Remove old caching from DBDictionary (VS),
Greg Chicares <=
- [lmi-commits] [lmi] master 7fffe41 08/10: Use caching for DBDictionary (VS), Greg Chicares, 2016/08/02
- [lmi-commits] [lmi] master 7ea93d3 09/10: Adapt 2012-06-15 patches just applied to renamed caching class, Greg Chicares, 2016/08/02