| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include <string> |
| 7 | |
| 8 | /// Interface of a data sink. |
| 9 | /// A data sink only receives data. |
| 10 | template<typename... Ts> |
| 11 | class IDataSink |
| 12 | { |
| 13 | public: |
| 14 | /// Where the data goes to. |
| 15 | /// @returns sink name |
| 16 | virtual std::string sink() const = 0; |
| 17 | |
| 18 | /// Write the data to the sink. |
| 19 | /// @return true when the operation succeed |
| 20 | virtual bool write(Ts const &...args) = 0; |
| 21 | |
| 22 | virtual ~IDataSink() = default; |
| 23 | }; |