| 345 | } |
| 346 | |
| 347 | void ProcessGroup::addConnection(const std::shared_ptr<Connection>& connection) { |
| 348 | std::lock_guard<std::recursive_mutex> lock(mutex_); |
| 349 | |
| 350 | if (connections_.find(connection) == connections_.end()) { |
| 351 | // We do not have the same connection in this process group yet |
| 352 | connections_.insert(connection); |
| 353 | logger_->log_debug("Add connection %s into process group %s", connection->getName(), name_); |
| 354 | std::shared_ptr<Processor> source = this->findProcessorById(connection->getSourceUUID()); |
| 355 | if (source) |
| 356 | source->addConnection(connection); |
| 357 | std::shared_ptr<Processor> destination = this->findProcessorById(connection->getDestinationUUID()); |
| 358 | if (destination && destination != source) |
| 359 | destination->addConnection(connection); |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | void ProcessGroup::removeConnection(const std::shared_ptr<Connection>& connection) { |
| 364 | std::lock_guard<std::recursive_mutex> lock(mutex_); |
nothing calls this directly
no test coverage detected