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

#include <tango/client/EventData.h>

namespace Tango
{

/********************************************************************************
 *                                                                                 *
 *                         EventDataList class                                        *
 *                                                                                 *
 *******************************************************************************/
class EventDataList : public std::vector<EventData *>
{
  public:
    EventDataList() :
        std::vector<EventData *>(0)
    {
    }

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

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

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

} // namespace Tango

#endif // TANGO_CLIENT_EVENTDATALIST_H
