@@ -163,9 +163,9 @@ class MultiConsumer : public IConsumer<T>
163163/* !
164164 * \brief Parent class for arbitrary producers of packages.
165165 *
166- * @tparam HeaderT Header type of the produced packages
166+ * @tparam T Type of the produced products
167167 */
168- template <typename HeaderT >
168+ template <typename T >
169169class IProducer
170170{
171171public:
@@ -200,7 +200,7 @@ class IProducer
200200 *
201201 * \returns Success of the package production.
202202 */
203- virtual bool tryGet (std::vector<std::unique_ptr<URPackage<HeaderT> >>& products) = 0;
203+ virtual bool tryGet (std::vector<std::unique_ptr<T >>& products) = 0;
204204};
205205
206206/* !
@@ -228,15 +228,14 @@ class INotifier
228228 * the producer is called and returned packages are saved in a queue. This queue is then either also
229229 * cyclically utilized by the registered consumer or can be externally used.
230230 *
231- * @tparam HeaderT Header type of the managed packages
231+ * @tparam T Type of the managed packages
232232 */
233- template <typename HeaderT >
233+ template <typename T >
234234class Pipeline
235235{
236236public:
237237 typedef std::chrono::high_resolution_clock Clock;
238238 typedef Clock::time_point Time;
239- using _package_type = URPackage<HeaderT>;
240239 /* !
241240 * \brief Creates a new Pipeline object, registering producer, consumer and notifier.
242241 * Additionally, an empty queue is initialized.
@@ -246,8 +245,8 @@ class Pipeline
246245 * \param name The pipeline's name
247246 * \param notifier The notifier to use
248247 */
249- Pipeline (IProducer<HeaderT >& producer, IConsumer<_package_type>& consumer, std::string name, INotifier& notifier)
250- : producer_(producer), consumer_(& consumer), name_(name), notifier_(notifier), queue_{ 32 }, running_{ false }
248+ Pipeline (IProducer<T >& producer, IConsumer<T>* consumer, std::string name, INotifier& notifier)
249+ : producer_(producer), consumer_(consumer), name_(name), notifier_(notifier), queue_{ 32 }, running_{ false }
251250 {
252251 }
253252 /* !
@@ -258,7 +257,7 @@ class Pipeline
258257 * \param name The pipeline's name
259258 * \param notifier The notifier to use
260259 */
261- Pipeline (IProducer<HeaderT >& producer, std::string name, INotifier& notifier)
260+ Pipeline (IProducer<T >& producer, std::string name, INotifier& notifier)
262261 : producer_(producer), consumer_(nullptr ), name_(name), notifier_(notifier), queue_{ 32 }, running_{ false }
263262 {
264263 }
@@ -327,17 +326,17 @@ class Pipeline
327326 *
328327 * \returns
329328 */
330- bool getLatestProduct (std::unique_ptr<URPackage<HeaderT> >& product, std::chrono::milliseconds timeout)
329+ bool getLatestProduct (std::unique_ptr<T >& product, std::chrono::milliseconds timeout)
331330 {
332331 return queue_.waitDequeTimed (product, timeout);
333332 }
334333
335334private:
336- IProducer<HeaderT >& producer_;
337- IConsumer<_package_type >* consumer_;
335+ IProducer<T >& producer_;
336+ IConsumer<T >* consumer_;
338337 std::string name_;
339338 INotifier& notifier_;
340- moodycamel::BlockingReaderWriterQueue<std::unique_ptr<_package_type >> queue_;
339+ moodycamel::BlockingReaderWriterQueue<std::unique_ptr<T >> queue_;
341340 std::atomic<bool > running_;
342341 std::thread pThread_, cThread_;
343342
@@ -396,7 +395,7 @@ class Pipeline
396395 {
397396 LOG_WARN (" No realtime capabilities found. Consider using a realtime system for better performance" );
398397 }
399- std::vector<std::unique_ptr<_package_type >> products;
398+ std::vector<std::unique_ptr<T >> products;
400399 while (running_)
401400 {
402401 if (!producer_.tryGet (products))
@@ -422,7 +421,7 @@ class Pipeline
422421
423422 void runConsumer ()
424423 {
425- std::unique_ptr<_package_type > product;
424+ std::unique_ptr<T > product;
426425 while (running_)
427426 {
428427 // timeout was chosen because we should receive messages
0 commit comments