//  ************************************************************************************************
//
//  qt-mvvm: Model-view-view-model framework for large GUI applications
//
//! @file      mvvm/model/mvvm/signals/itemlistener.h
//! @brief     Defines class CLASS?
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2020
//! @authors   Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifndef BORNAGAIN_MVVM_MODEL_MVVM_SIGNALS_ITEMLISTENER_H
#define BORNAGAIN_MVVM_MODEL_MVVM_SIGNALS_ITEMLISTENER_H

#include "mvvm/signals/itemlistenerbase.h"

namespace ModelView {

class SessionItem;

//! Base class to subscribe to signals generated by SessionItem of certin type.

template <typename T> class ItemListener : public ItemListenerBase {
public:
    T* currentItem() const { return static_cast<T*>(item()); }
};

} // namespace ModelView

#endif // BORNAGAIN_MVVM_MODEL_MVVM_SIGNALS_ITEMLISTENER_H
