#include "ct_outstdgroupmodel.h" template CT_OutStdGroupModel::CT_OutStdGroupModel(const QString& displayableName, const QString& shortDescription, const QString& detailledDescription, StdGroup* prototype) : SuperClass(displayableName) { setPrototype((prototype == nullptr) ? new StdGroup() : prototype); setShortDescription(shortDescription); setDetailledDescription(detailledDescription); } template CT_OutStdGroupModel::CT_OutStdGroupModel(const CT_OutStdGroupModel& other) : SuperClass(other) { const SuperClass::GroupCollection& grps = other.groups(); for(const SuperClass::GroupType* group : grps) { this->addGroup(static_cast(group->copy())); } const SuperClass::ItemCollection& its = other.items(); for(const SuperClass::ItemType* item : its) { this->addItem(static_cast(item->copy())); } } template CT_OutAbstractModel* CT_OutStdGroupModel::copy() const { return new CT_OutStdGroupModel(*this); } template typename CT_OutStdGroupModel::GroupType* CT_OutStdGroupModel::findGroup(const int& uniqueIndex) const { const SuperClass::GroupCollection& grps = groups(); for(SuperClass::GroupType* group : grps) { if(group->uniqueIndex() == uniqueIndex) return group; } return nullptr; } template typename CT_OutStdGroupModel::ItemType* CT_OutStdGroupModel::findItem(const int& uniqueIndex) const { const SuperClass::ItemCollection& its = items(); for(SuperClass::ItemType* item : its) { if(item->uniqueIndex() == uniqueIndex) return item; } return nullptr; }