9 #ifndef _CACHED_LIST_H_
10 #define _CACHED_LIST_H_
17 #include <tr1/functional>
19 #include <QtCore/QMutex>
20 #include <QtCore/QMutexLocker>
41 typedef std::tr1::shared_ptr<item_type>
item_sp;
62 const item_type &
item(
const id_type &
id)
66 if (
_list.end() == it)
110 findId(
id)->first.locked =
false;
151 for (
size_t i=0; i<
size; ++i)
152 _list.push_back(std::make_pair(info,item->clone()));
164 iter_type it(
_list.begin());
165 iter_type End(
_list.end());
182 using std::tr1::bind;
183 using std::tr1::placeholders::_1;
186 std::tr1::bind(equal_to<id_type>(),
id,
188 std::tr1::bind<const item_info&>(&entry_type::first,_1))));
iter_type _current
iterator the currently used entry
void latest(const iter_type it)
set which one is the latest item
const item_type & latest() const
retrieve the latest item
file contains declaration of the CASSEvent
void clearItems()
clear the items in the list
uint64_t id_t
define the id type
things written only at end of run H5Dump ProcessorSummary size
item_type & latest()
retrieve the latest item
QMutex _mutex
mutex for locking the internal list
file contains custom exceptions used in cass
a list of results for caching
iter_type newItem(const id_type &id)
get an item for processing
iter_type findId(const id_type &id)
get an iterator to the item for id
void setup(item_sp item, size_t size)
create the list of items
void release(const id_type &id)
unlock the item with id
CASSEvent::id_t id_type
define the type of the id used
iter_type _latest
iterator to the latest entry
std::pair< item_info, item_sp > entry_type
define an entry in the list
std::tr1::shared_ptr< item_type > item_sp
define a shared pointer of the item
list_type::iterator iter_type
define an iterator for the list
std::vector< entry_type > list_type
define the container of items with their ids
Exception thrown when accessing invalid histogram.
const item_type & item(const id_type &id)
retrieve an item with the right id
Result< float > item_type
define the type of which the list is for
bundeling the lock status and the id