27# include <tbb/concurrent_unordered_map.h>
35template <
typename KEY,
typename VALUE>
46template <
typename KEY,
typename VALUE>
51#include <boost/serialization/nvp.hpp>
52#include <boost/serialization/split_member.hpp>
53#include <boost/static_assert.hpp>
67template<
typename KEY,
typename VALUE>
78 template<
typename INPUTITERATOR>
88 bool exists(
const KEY& e)
const {
return this->count(e); }
93 void unsafe_erase(
typename Base::iterator position) { ((Base*)
this)->erase(position); }
94 typename Base::size_type unsafe_erase(
const KEY& k) {
return ((Base*)
this)->erase(k); }
95 void unsafe_erase(
typename Base::iterator first,
typename Base::iterator last) {
96 return ((Base*)
this)->erase(first, last); }
105 template<
class Archive>
106 void save(Archive& ar,
const unsigned int )
const
109 FastVector<std::pair<KEY, VALUE> > map(this->size());
110 std::copy(this->begin(), this->end(), map.begin());
111 ar & BOOST_SERIALIZATION_NVP(map);
113 template<
class Archive>
114 void load(Archive& ar,
const unsigned int )
117 FastVector<std::pair<KEY, VALUE> > map;
118 ar & BOOST_SERIALIZATION_NVP(map);
119 this->insert(map.begin(), map.end());
121 BOOST_SERIALIZATION_SPLIT_MEMBER()
A thin wrapper around std::vector that uses a custom allocator.
A thin wrapper around std::map that uses boost's fast_pool_allocator.
Included from all GTSAM files.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
void save(const Matrix &A, const string &s, const string &filename)
save a matrix to file, which can be loaded by matlab
Definition: Matrix.cpp:166
Definition: ConcurrentMap.h:68
ConcurrentMap(INPUTITERATOR first, INPUTITERATOR last)
Constructor from a range, passes through to base class.
Definition: ConcurrentMap.h:79
ConcurrentMap(const ConcurrentMap< KEY, VALUE > &x)
Copy constructor from another ConcurrentMap.
Definition: ConcurrentMap.h:82
bool exists(const KEY &e) const
Handy 'exists' function.
Definition: ConcurrentMap.h:88
ConcurrentMap(const Base &x)
Copy constructor from the base map class.
Definition: ConcurrentMap.h:85
ConcurrentMap()
Default constructor.
Definition: ConcurrentMap.h:75
friend class boost::serialization::access
Serialization function.
Definition: ConcurrentMap.h:104