|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49264 - trunk/libs/serialization/src
From: ramey_at_[hidden]
Date: 2008-10-11 01:33:44
Author: ramey
Date: 2008-10-11 01:33:43 EDT (Sat, 11 Oct 2008)
New Revision: 49264
URL: http://svn.boost.org/trac/boost/changeset/49264
Log:
Back out previous change
Text files modified:
trunk/libs/serialization/src/extended_type_info.cpp | 18 ++------------
trunk/libs/serialization/src/extended_type_info_typeid.cpp | 49 ++++++++++++++++-----------------------
2 files changed, 23 insertions(+), 44 deletions(-)
Modified: trunk/libs/serialization/src/extended_type_info.cpp
==============================================================================
--- trunk/libs/serialization/src/extended_type_info.cpp (original)
+++ trunk/libs/serialization/src/extended_type_info.cpp 2008-10-11 01:33:43 EDT (Sat, 11 Oct 2008)
@@ -58,19 +58,7 @@
}
};
-struct ktmap :
- public std::multiset<const extended_type_info *, key_compare>
-{
- static bool m_destroyed;
- static bool is_destroyed(){
- return m_destroyed;
- }
- ~ktmap(){
- m_destroyed = true;
- }
-};
-
-bool ktmap::m_destroyed = false;
+typedef std::multiset<const extended_type_info *, key_compare> ktmap;
class extended_type_info_arg : public extended_type_info
{
@@ -97,7 +85,7 @@
BOOST_SERIALIZATION_DECL(void)
extended_type_info::key_unregister() {
assert(NULL != m_key);
- if(detail::ktmap::is_destroyed()){
+ if(! singleton<detail::ktmap>::is_destroyed()){
detail::ktmap & x = singleton<detail::ktmap>::get_mutable_instance();
detail::ktmap::iterator start = x.lower_bound(this);
detail::ktmap::iterator end = x.upper_bound(this);
@@ -108,7 +96,7 @@
if(this == *start)
x.erase(start++);
else
- ++start;
+ ++start;
}while(start != end);
}
m_key = NULL;
Modified: trunk/libs/serialization/src/extended_type_info_typeid.cpp
==============================================================================
--- trunk/libs/serialization/src/extended_type_info_typeid.cpp (original)
+++ trunk/libs/serialization/src/extended_type_info_typeid.cpp 2008-10-11 01:33:43 EDT (Sat, 11 Oct 2008)
@@ -39,20 +39,11 @@
}
};
-struct tkmap :
- public std::multiset<const extended_type_info_typeid_0 *,type_compare>
-{
- static bool m_destroyed;
- static bool is_destroyed(){
- return m_destroyed;
- }
- ~tkmap(){
- m_destroyed = true;
- }
-};
-
-bool tkmap::m_destroyed = false;
-
+typedef std::multiset<
+ const extended_type_info_typeid_0 *,
+ type_compare
+> tkmap;
+
BOOST_SERIALIZATION_DECL(bool)
extended_type_info_typeid_0::is_less_than(
const boost::serialization::extended_type_info & rhs
@@ -91,21 +82,21 @@
BOOST_SERIALIZATION_DECL(void)
extended_type_info_typeid_0::type_unregister()
{
- if(NULL == m_ti)
- return;
- if(! tkmap::is_destroyed()){
- tkmap & x = singleton<tkmap>::get_mutable_instance();
- tkmap::iterator start = x.lower_bound(this);
- tkmap::iterator end = x.upper_bound(this);
- assert(start != end);
-
- // remove entry in map which corresponds to this type
- do{
- if(this == *start)
- x.erase(start++);
- else
- ++start;
- }while(start != end);
+ if(NULL == m_ti){
+ if(! singleton<tkmap>::is_destroyed()){
+ tkmap & x = singleton<tkmap>::get_mutable_instance();
+ tkmap::iterator start = x.lower_bound(this);
+ tkmap::iterator end = x.upper_bound(this);
+ assert(start != end);
+
+ // remove entry in map which corresponds to this type
+ do{
+ if(this == *start)
+ x.erase(start++);
+ else
+ ++start;
+ }while(start != end);
+ }
}
m_ti = NULL;
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk