| 303 | |
| 304 | template <class T> |
| 305 | void findQueue(T& connection, std::string& qn) { |
| 306 | if (qn.empty()) { |
| 307 | // Dynamic queue creation |
| 308 | std::ostringstream os; |
| 309 | os << "_dynamic_" << next_id_++; |
| 310 | qn = os.str(); |
| 311 | } |
| 312 | Queue* q = 0; |
| 313 | auto i = queues_.find(qn); |
| 314 | if (i==queues_.end()) { |
| 315 | q = new Queue(container_, qn); |
| 316 | queues_[qn] = q; |
| 317 | } else { |
| 318 | q = i->second; |
| 319 | } |
| 320 | connection.add([=, &connection] {connection.boundQueue(q, qn);}); |
| 321 | } |
| 322 | |
| 323 | void queueMessage(proton::message m, std::string address) { |
| 324 | Queue* q = 0; |