53 using Ptr = std::shared_ptr<TokenImpl>;
56 void add(
const Stuff&
s) {
l.push_back(
s); }
58 void add(
const StuffList& l_) {
l.insert(
l.end(), l_.begin(), l_.end()); }
60 void merge(StuffList& l_) {
l.splice(
l.end(), l_); }
74 template <
typename K,
typename V>
78 using Ptr = std::shared_ptr<MapTokenImpl<K, V>>;
81 std::weak_ptr<Scroom::Bookkeeping::MapBase<K, V>>
map;
100 std::shared_ptr<Scroom::Bookkeeping::MapBase<K, V>>
const m =
map.lock();
116 template <
typename V>
120 using Ptr = std::shared_ptr<ValueType<V>>;
137 template <
typename V>
158 explicit operator V() {
return pv->value; }
209 template <
typename K,
typename V>
212 boost::mutex::scoped_lock
const lock(mut);
213 if(map.end() != map.find(k))
215 throw std::invalid_argument(
"Key already exists");
227 template <
typename K,
typename V>
230 boost::mutex::scoped_lock
const lock(mut);
231 auto i = map.find(k);
257 template <
typename K,
typename V>
260 boost::mutex::scoped_lock
const lock(mut);
261 auto i = map.find(k);
282 template <
typename K,
typename V>
285 boost::mutex::scoped_lock lock(mut);
286 typename MapType::iterator i = map.find(k);
294 template <
typename K,
typename V>
297 boost::mutex::scoped_lock
const lock(mut);
298 auto i = map.find(k);
309 throw std::invalid_argument(
"Invalid key");
312 template <
typename K,
typename V>
315 boost::mutex::scoped_lock
const lock(mut);
316 auto i = map.find(k);
328 throw std::invalid_argument(
"Invalid key");
331 template <
typename K,
typename V>
334 boost::mutex::scoped_lock
const lock(mut);
335 auto i = map.find(k);
346 throw std::invalid_argument(
"Invalid key");
349 template <
typename K,
typename V>
352 boost::mutex::scoped_lock
const lock(mut);
354 for(
const typename MapType::value_type& el: map)
356 result.push_back(el.first);
361 template <
typename K,
typename V>
364 boost::mutex::scoped_lock
const lock(mut);
366 for(
const typename MapType::value_type& el: map)
423 template <
typename K,
typename V>
Definition bookkeepingimpl.hh:139
LValue(VTPtr pv_)
Definition bookkeepingimpl.hh:147
typename ValueType< V >::Ptr VTPtr
Definition bookkeepingimpl.hh:141
VTPtr pv
Definition bookkeepingimpl.hh:144
LValue & operator=(const V &v)
Definition bookkeepingimpl.hh:152
Definition bookkeepingimpl.hh:76
K k
Definition bookkeepingimpl.hh:83
~MapTokenImpl()
Definition bookkeepingimpl.hh:98
WeakToken t
Definition bookkeepingimpl.hh:82
static Scroom::Bookkeeping::Token create(const std::shared_ptr< Scroom::Bookkeeping::MapBase< K, V > > &map, const K &k)
Definition bookkeepingimpl.hh:108
MapTokenImpl operator=(MapTokenImpl &&)=delete
MapTokenImpl(MapTokenImpl &&)=delete
MapTokenImpl(const MapTokenImpl &)=delete
MapTokenImpl operator=(const MapTokenImpl &)=delete
std::weak_ptr< Scroom::Bookkeeping::MapBase< K, V > > map
Definition bookkeepingimpl.hh:81
std::shared_ptr< MapTokenImpl< K, V > > Ptr
Definition bookkeepingimpl.hh:78
Definition bookkeepingimpl.hh:18
TokenAddition & operator+(TokenAddition &rhs)
Definition bookkeepingimpl.hh:37
TokenAddition & operator+=(const Stuff &rhs)
Definition bookkeepingimpl.hh:31
TokenAddition & operator+=(TokenAddition &rhs)
Definition bookkeepingimpl.hh:43
TokenAddition & operator+(const Stuff &rhs)
Definition bookkeepingimpl.hh:25
TokenAddition(const Scroom::Bookkeeping::Token &t)
Definition bookkeepingimpl.hh:20
Definition bookkeepingimpl.hh:51
std::shared_ptr< TokenImpl > Ptr
Definition bookkeepingimpl.hh:53
void add(const Stuff &s)
Definition bookkeepingimpl.hh:56
void merge(StuffList &l_)
Definition bookkeepingimpl.hh:60
void add(const StuffList &l_)
Definition bookkeepingimpl.hh:58
StuffList l
Definition bookkeepingimpl.hh:71
static Scroom::Bookkeeping::Token create()
Definition bookkeepingimpl.hh:65
void merge(Ptr &rhs)
Definition bookkeepingimpl.hh:62
Definition bookkeepingimpl.hh:118
std::weak_ptr< ValueType< V > > WeakPtr
Definition bookkeepingimpl.hh:121
WeakToken token
Definition bookkeepingimpl.hh:125
V value
Definition bookkeepingimpl.hh:124
std::shared_ptr< ValueType< V > > Ptr
Definition bookkeepingimpl.hh:120
ValueType(V value_)
Definition bookkeepingimpl.hh:128
static Ptr create(V value)
Definition bookkeepingimpl.hh:134
Definition bookkeeping.hh:74
void remove(const K &k)
Definition bookkeepingimpl.hh:283
V get(const K &k)
Definition bookkeepingimpl.hh:332
Token reReserve(const K &k)
Definition bookkeepingimpl.hh:228
void set(const K &k, const V &v)
Definition bookkeepingimpl.hh:313
Detail::LValue< V > at(const K &k)
Definition bookkeepingimpl.hh:295
Token reserve(const K &k)
Definition bookkeepingimpl.hh:210
std::list< V > values() const
Definition bookkeepingimpl.hh:362
std::list< K > keys() const
Definition bookkeepingimpl.hh:350
Definition bookkeeping.hh:95
std::shared_ptr< Map< K, V > > Ptr
Definition bookkeeping.hh:97
static Ptr create()
Definition bookkeepingimpl.hh:424
Definition bookkeeping.hh:50
Token()
Definition bookkeepingimpl.hh:174
Token const & operator+=(const Stuff &rhs) const
Definition bookkeepingimpl.hh:201
void add(const Stuff &s) const
Definition bookkeepingimpl.hh:191
void merge(Token &rhs) const
Definition bookkeepingimpl.hh:195
Detail::TokenAddition operator+(const Stuff &rhs) const
Definition bookkeepingimpl.hh:199
ThreadPtr add()
Definition threadpoolimpl.cc:241
PageList const l
Definition compression-tests.cc:33
void create(NewPresentationInterface *interface)
Definition loader.cc:172
Definition bookkeeping.hh:20
std::weak_ptr< Detail::TokenImpl > WeakToken
Definition bookkeeping.hh:68
Definition blockallocator.hh:18
SampleIterator< const uint8_t > result
Definition sampleiterator-tests.cc:94