/// @brief Given an endpoint, retrieve the associated client. Return /// an empty shared pointer if one is not found. mapped_type get(key_type key) const { auto result = clients_.find(key); return clients_.end() != result ? result->second : mapped_type(); }
// Add a new operation to the queue. Returns true if this is the only // operation for the given descriptor, in which case the reactor's event // demultiplexing function call may need to be interrupted and restarted. bool enqueue_operation(Descriptor descriptor, reactor_op* op) { std::pair<iterator, bool> entry = operations_.insert(value_type(descriptor, mapped_type())); entry.first->second.push(op); return entry.second; }
void address_set_type:: track(const void *ptr, const char *file, int line) { m_mutex.lock(); insert(value_type(ptr, mapped_type(file, line))); m_mutex.unlock(); }
CIntervalTree::iterator CIntervalTree::IntervalsOverlapping(const interval_type& interval) { coordinate_type x = interval.GetFrom(); coordinate_type y = interval.GetTo(); iterator it(x, TTraits::GetMaxCoordinate(), 0, &m_Root); TTreeMapI iter = m_ByX.lower_bound(TTreeMapValue(x + 1, 0, mapped_type())); if ( iter != m_ByX.end() && iter->GetKey() <= y ) { it.m_SearchLimit = y; it.m_CurrentMapValue = &TTreeMap::get(iter); } else { it.NextLevel(); } return it; }
static std::string desc() { return desc(mapped_type()); }
static std::string name() { return name(mapped_type()); }
node(key_type const& key, attribute* attr) : m_Value(key, mapped_type()), m_pAttribute(attr) { }
SNode(const key_type& key) : value_type(key, mapped_type()) { }
iterator find(const key_type& k) { return set.find(std::make_pair(k, mapped_type())); }
size_type erase(const key_type& k) { set.erase(std::make_pair(k, mapped_type())); }