| 361 | } |
| 362 | |
| 363 | void ProcessGroup::removeConnection(const std::shared_ptr<Connection>& connection) { |
| 364 | std::lock_guard<std::recursive_mutex> lock(mutex_); |
| 365 | |
| 366 | if (connections_.find(connection) != connections_.end()) { |
| 367 | // We do not have the same connection in this process group yet |
| 368 | connections_.erase(connection); |
| 369 | logger_->log_debug("Remove connection %s into process group %s", connection->getName(), name_); |
| 370 | std::shared_ptr<Processor> source = this->findProcessorById(connection->getSourceUUID()); |
| 371 | if (source) |
| 372 | source->removeConnection(connection); |
| 373 | std::shared_ptr<Processor> destination = this->findProcessorById(connection->getDestinationUUID()); |
| 374 | if (destination && destination != source) |
| 375 | destination->removeConnection(connection); |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | void ProcessGroup::drainConnections() { |
| 380 | for (auto&& connection : connections_) { |
nothing calls this directly
no test coverage detected