/*
 * SPDX-FileCopyrightText: 2025 Copyright contributors to the cppTango project
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */
#ifndef TANGO_CLIENT_PIPEEVENTDATALIST_H
#define TANGO_CLIENT_PIPEEVENTDATALIST_H

#include <tango/client/PipeEventData.h>

namespace Tango
{

/********************************************************************************
 *                                                                                 *
 *                         PipeEventDataList class                                    *
 *                                                                                 *
 *******************************************************************************/

class PipeEventDataList : public std::vector<PipeEventData *>
{
  public:
    PipeEventDataList() :
        std::vector<PipeEventData *>(0)
    {
    }

    ~PipeEventDataList()
    {
        if(size() > 0)
        {
            PipeEventDataList::iterator vpos;
            for(vpos = begin(); vpos != end(); ++vpos)
            {
                delete(*vpos);
            }
        }
    }

    void clear()
    {
        if(size() > 0)
        {
            PipeEventDataList::iterator vpos;
            for(vpos = begin(); vpos != end(); ++vpos)
            {
                delete(*vpos);
            }

            this->vector<PipeEventData *>::clear();
        }
    }
};

} // namespace Tango

#endif // TANGO_CLIENT_PIPEEVENTDATALIST_H
