27 # include <tbb/concurrent_unordered_map.h> 28 # undef min // TBB seems to include Windows.h which defines these macros that cause problems 35 template <
typename KEY,
typename VALUE>
46 template <
typename KEY,
typename VALUE>
51 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 52 #include <boost/serialization/nvp.hpp> 53 #include <boost/serialization/split_member.hpp> 68 template<
typename KEY,
typename VALUE>
79 template<
typename INPUTITERATOR>
80 ConcurrentMap(INPUTITERATOR first, INPUTITERATOR last) : Base(first, last) {}
89 bool exists(
const KEY& e)
const {
return this->count(e); }
94 void unsafe_erase(
typename Base::iterator position) { ((Base*)
this)->erase(position); }
95 typename Base::size_type unsafe_erase(
const KEY& k) {
return ((Base*)
this)->erase(k); }
96 void unsafe_erase(
typename Base::iterator first,
typename Base::iterator last) {
97 return ((Base*)
this)->erase(first, last); }
104 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 106 friend class boost::serialization::access;
107 template<
class Archive>
108 void save(Archive& ar,
const unsigned int )
const 112 std::copy(this->begin(), this->end(), map.begin());
113 ar & BOOST_SERIALIZATION_NVP(map);
115 template<
class Archive>
116 void load(Archive& ar,
const unsigned int )
121 ar & BOOST_SERIALIZATION_NVP(map);
122 this->insert(map.begin(), map.end());
124 BOOST_SERIALIZATION_SPLIT_MEMBER()
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
Definition: FastVector.h:34
ConcurrentMap(const ConcurrentMap< KEY, VALUE > &x)
Definition: ConcurrentMap.h:83
bool exists(const KEY &e) const
Definition: ConcurrentMap.h:89
ConcurrentMap(const Base &x)
Definition: ConcurrentMap.h:86
Included from all GTSAM files.
ConcurrentMap(INPUTITERATOR first, INPUTITERATOR last)
Definition: ConcurrentMap.h:80
GTSAM_EXPORT void save(const Matrix &A, const std::string &s, const std::string &filename)
A thin wrapper around std::vector that uses a custom allocator.
Definition: chartTesting.h:28
A thin wrapper around std::map that uses boost's fast_pool_allocator.
Definition: ConcurrentMap.h:69
ConcurrentMap()
Definition: ConcurrentMap.h:76