Go to the documentation of this file.
37 #ifndef LibMultiSense_details_storage_hh
38 #define LibMultiSense_details_storage_hh
57 template<
class T>
void store(
const T& msg) {
61 if (
m_map.end() != it) {
62 it->second.destroy<T>();
73 if (
m_map.end() == it)
76 it->second.extract(msg);
90 return Holder(
reinterpret_cast<void *
>(
new T(msg)));
96 delete reinterpret_cast<T*
>(
m_refP);
102 msg = *(
reinterpret_cast<T*
>(
m_refP));
110 typedef std::map<wire::IdType, Holder>
Map;
130 template<
class KEY,
class DATA>
140 typename MapType::iterator it =
m_map.begin();
141 for(; it !=
m_map.end();) {
193 typename MapType::iterator it =
m_map.find(key);
195 if (
m_map.end() == it)
207 typename MapType::iterator it =
m_map.find(key);
208 if (it ==
m_map.end()) {
220 typename MapType::iterator it2 =
m_map.find(key);
221 if (
m_map.end() != it2) {
227 for (
typename QueueType::reverse_iterator it =
m_queue.rbegin(); it !=
m_queue.rend();) {
241 typename MapType::iterator it2 =
m_map.find(k);
242 if (
m_map.end() != it2) {
260 return std::pair<bool, KEY>(
will_drop, drop_key);
271 #endif // LibMultiSense_details_storage_hh
void insert(KEY key, DATA *data)
static CRL_CONSTEXPR Status Status_Ok
DepthCache(std::size_t depth)
void insert_(KEY key, DATA *data)
static CRL_CONSTEXPR Status Status_Error
std::pair< bool, KEY > will_drop()
static Holder Create(const T &msg)
std::pair< bool, KEY > will_drop_()
std::deque< KEY > QueueType
#define CRL_EXCEPTION(fmt,...)
void remove_nolock(KEY key)
std::map< wire::IdType, Holder > Map
std::map< KEY, DATA * > MapType
DATA * find_nolock(KEY key)
void insert_nolock(KEY key, DATA *data)
const std::size_t m_depth