示例#1
0
文件: main.cpp 项目: CCJY/coliru
 /// @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;
 }
示例#3
0
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();
}
示例#4
0
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;
}
示例#5
0
	  static std::string
	  desc()
	  { return desc(mapped_type()); }
示例#6
0
	  static std::string
	  name()
	  { return name(mapped_type()); }
 node(key_type const& key, attribute* attr)
     : m_Value(key, mapped_type()), m_pAttribute(attr)
 {
 }
示例#8
0
 SNode(const key_type& key)
     : value_type(key, mapped_type())
     {
     }
示例#9
0
 iterator find(const key_type& k) {
   return set.find(std::make_pair(k, mapped_type()));
 }
示例#10
0
 size_type erase(const key_type& k) {
   set.erase(std::make_pair(k, mapped_type()));
 }