void GroupNodeImpl::peers(PeerList& ps) const { ps.clear(); zlist_t* zpeers = zyre_peers(node_); char* uuid; while ((uuid = static_cast<char*>(zlist_next(zpeers))) != NULL) { char* desc = zyre_peer_header_value(node_, uuid, "desc"); PeerPtr p(new Peer(uuid, desc)); ps.push_back(p); free(desc); } zlist_destroy(&zpeers); }
vector<PeerInfoEntry>& PeerInfoCacheManager::get_peers() { PeerList* result = new PeerList(); map<string, PeerInfoEntry>::const_iterator it; it = m_stream_names.begin(); while(it!=m_stream_names.end()) { PeerInfoEntry p; p.peer = it->second.peer; result->push_back(p); } return *result; }