void operator()(msgpack::object::with_zone& o, const std::unordered_multimap<K, V, Hash, Compare, Alloc>& v) const {
     o.type = msgpack::type::MAP;
     if(v.empty()) {
         o.via.map.ptr  = nullptr;
         o.via.map.size = 0;
     } else {
         uint32_t size = checked_get_container_size(v.size());
         msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*size));
         msgpack::object_kv* const pend = p + size;
         o.via.map.ptr  = p;
         o.via.map.size = size;
         typename std::unordered_multimap<K, V, Hash, Compare, Alloc>::const_iterator it(v.begin());
         do {
             p->key = msgpack::object(it->first, o.zone);
             p->val = msgpack::object(it->second, o.zone);
             ++p;
             ++it;
         } while(p < pend);
     }
 }
示例#2
0
	~GlobalAttributeDispatcher() {
		//Make sure that all callbacks are de-registered.
		assert(mCallbacks.empty());
	}