18 #ifndef MULTI_TRACK_SINK_H 19 #define MULTI_TRACK_SINK_H 33 template <
class SINK, const
bool INITIALIZE>
48 Q_ASSERT(INITIALIZE || (tracks == 0));
49 Q_ASSERT(QList<SINK *>::size() == static_cast<int>(tracks));
59 virtual bool done() const Q_DECL_OVERRIDE
62 static_cast< QList<SINK *>
>(*
this))
63 if (s && !s->
done())
return false;
71 virtual unsigned int tracks() const Q_DECL_OVERRIDE
73 return QList<SINK *>::size();
81 inline virtual SINK *
at(
unsigned int track)
const {
82 return QList<SINK *>::at(track);
86 inline virtual SINK *
operator [] (
unsigned int track) Q_DECL_OVERRIDE {
97 virtual bool insert(
unsigned int track, SINK *sink) {
98 QList<SINK *>::insert(track, sink);
99 return (
at(track) == sink);
104 while (!QList<SINK *>::isEmpty())
105 delete QList<SINK *>::takeLast();
113 template <
class SINK>
127 for (
unsigned int i = 0; i <
tracks; i++)
128 this->
insert(i,
new(std::nothrow) SINK());
MultiTrackSink(unsigned int tracks, QObject *parent=Q_NULLPTR)
virtual unsigned int tracks() const Q_DECL_OVERRIDE
virtual ~MultiTrackSink() Q_DECL_OVERRIDE
MultiTrackSink(unsigned int tracks, QObject *parent=Q_NULLPTR)
virtual bool insert(unsigned int track, SINK *sink)
virtual SINK * operator[](unsigned int track) Q_DECL_OVERRIDE
virtual bool done() const Q_DECL_OVERRIDE
virtual ~MultiTrackSink()
virtual bool done() const
virtual SINK * at(unsigned int track) const