| 121 | // Can throw exception in case of invalid parameters |
| 122 | template <typename T> |
| 123 | shared_ptr<T> create_encoder() { |
| 124 | std::unique_lock lock(mutex_); |
| 125 | |
| 126 | const type_index& tidx = type_index(typeid(T)); |
| 127 | |
| 128 | _encoders[tidx] = make_shared<T>(*this->_context); |
| 129 | |
| 130 | return any_cast<shared_ptr<T>>(_encoders[tidx]); |
| 131 | } |
| 132 | |
| 133 | bool has_encoder(const type_index& tidx) { |
| 134 | std::shared_lock lock(mutex_); |
nothing calls this directly
no outgoing calls
no test coverage detected