Go to the documentation of this file.
53 using Ptr = boost::shared_ptr<TokenImpl>;
74 template <
typename K,
typename V>
78 using Ptr = boost::shared_ptr<MapTokenImpl<K, V>>;
81 boost::weak_ptr<Scroom::Bookkeeping::MapBase<K, V>>
map;
100 boost::shared_ptr<Scroom::Bookkeeping::MapBase<K, V>>
const m =
map.lock();
116 template <
typename V>
120 using Ptr = boost::shared_ptr<ValueType<V>>;
121 using WeakPtr = boost::weak_ptr<ValueType<V>>;
129 :
value(std::move(value_))
137 template <
typename V>
158 explicit operator V() {
return pv->value; }
165 : boost::shared_ptr<
Detail::TokenImpl>(t)
170 : boost::shared_ptr<
Detail::TokenImpl>(t)
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);
268 Token const t(wt.lock());
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)
371 result.push_back(pv->
value);
423 template <
typename K,
typename V>
Definition: bookkeeping.hh:34
LValue & operator=(const V &v)
Definition: bookkeepingimpl.hh:152
MapTokenImpl(boost::shared_ptr< Scroom::Bookkeeping::MapBase< K, V >> map_, K k_)
Definition: bookkeepingimpl.hh:86
void merge(Token &rhs) const
Definition: bookkeepingimpl.hh:195
std::list< Stuff > StuffList
Definition: stuff.hh:20
static Scroom::Bookkeeping::Token create(boost::shared_ptr< Scroom::Bookkeeping::MapBase< K, V >> map, const K &k)
Definition: bookkeepingimpl.hh:108
boost::weak_ptr< ValueType< V > > WeakPtr
Definition: bookkeepingimpl.hh:121
TokenAddition & operator+=(TokenAddition &rhs)
Definition: bookkeepingimpl.hh:43
void set(const K &k, const V &v)
Definition: bookkeepingimpl.hh:313
void merge(StuffList &l_)
Definition: bookkeepingimpl.hh:60
TokenAddition(const Scroom::Bookkeeping::Token &t)
Definition: bookkeepingimpl.hh:20
ValueType(V value_)
Definition: bookkeepingimpl.hh:128
void add(const Stuff &s)
Definition: bookkeepingimpl.hh:56
std::list< K > keys() const
Definition: bookkeepingimpl.hh:350
Definition: assertions.hh:14
boost::shared_ptr< uint8_t > Ptr
Definition: blockallocator.hh:23
static Ptr create(V value)
Definition: bookkeepingimpl.hh:134
Definition: bookkeeping.hh:82
void add(const StuffList &l_)
Definition: bookkeepingimpl.hh:58
TokenAddition & operator+=(const Stuff &rhs)
Definition: bookkeepingimpl.hh:31
Token reserve(const K &k)
Definition: bookkeepingimpl.hh:210
void remove(const K &k)
Definition: bookkeepingimpl.hh:283
boost::shared_ptr< TokenImpl > Ptr
Definition: bookkeepingimpl.hh:53
Detail::LValue< V > at(const K &k)
Definition: bookkeepingimpl.hh:295
WeakToken token
Definition: bookkeepingimpl.hh:125
LValue(VTPtr pv_)
Definition: bookkeepingimpl.hh:147
Definition: bookkeepingimpl.hh:75
void merge(Ptr &rhs)
Definition: bookkeepingimpl.hh:62
~MapTokenImpl()
Definition: bookkeepingimpl.hh:98
Detail::TokenAddition operator+(const Stuff &rhs) const
Definition: bookkeepingimpl.hh:199
Definition: bookkeeping.hh:59
Token reReserve(const K &k)
Definition: bookkeepingimpl.hh:228
boost::shared_ptr< void > Stuff
Definition: stuff.hh:18
boost::weak_ptr< Scroom::Bookkeeping::MapBase< K, V > > map
Definition: bookkeepingimpl.hh:81
TokenAddition & operator+(TokenAddition &rhs)
Definition: bookkeepingimpl.hh:37
Definition: bookkeepingimpl.hh:17
WeakToken t
Definition: bookkeepingimpl.hh:82
boost::shared_ptr< ValueType< V > > Ptr
Definition: bookkeepingimpl.hh:120
TokenAddition & operator+(const Stuff &rhs)
Definition: bookkeepingimpl.hh:25
Definition: bookkeepingimpl.hh:50
std::list< V > values() const
Definition: bookkeepingimpl.hh:362
Token const & operator+=(const Stuff &rhs) const
Definition: bookkeepingimpl.hh:201
V get(const K &k)
Definition: bookkeepingimpl.hh:332
V value
Definition: bookkeepingimpl.hh:124
MapTokenImpl operator=(const MapTokenImpl &)=delete
Definition: async-deleter.hh:12
boost::shared_ptr< Map< K, V > > Ptr
Definition: bookkeeping.hh:85
Token()
Definition: bookkeepingimpl.hh:174
StuffList l
Definition: bookkeepingimpl.hh:71
boost::weak_ptr< Detail::TokenImpl > WeakToken
Definition: bookkeeping.hh:56
Definition: bookkeeping.hh:37
VTPtr pv
Definition: bookkeepingimpl.hh:144
K k
Definition: bookkeepingimpl.hh:83
static Scroom::Bookkeeping::Token create()
Definition: bookkeepingimpl.hh:65
typename ValueType< V >::Ptr VTPtr
Definition: bookkeepingimpl.hh:141
boost::shared_ptr< MapTokenImpl< K, V > > Ptr
Definition: bookkeepingimpl.hh:78
Definition: bookkeeping.hh:20
void add(const Stuff &s) const
Definition: bookkeepingimpl.hh:191
static Ptr create()
Definition: bookkeepingimpl.hh:424
Definition: bookkeeping.hh:31
void create(NewPresentationInterface *interface)
Definition: loader.cc:175