2015-04-16 11:50:07 -05:00
|
|
|
/*
|
|
|
|
Copyright (C) 2010 Srivats P.
|
|
|
|
|
|
|
|
This file is part of "Ostinato"
|
|
|
|
|
|
|
|
This is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PORT_GROUP_LIST_H
|
|
|
|
#define _PORT_GROUP_LIST_H
|
|
|
|
|
2016-02-12 07:40:19 -06:00
|
|
|
#include "devicegroupmodel.h"
|
2015-04-16 11:50:07 -05:00
|
|
|
#include "portgroup.h"
|
|
|
|
#include "portmodel.h"
|
|
|
|
#include "portstatsmodel.h"
|
2016-02-12 07:40:19 -06:00
|
|
|
#include "streammodel.h"
|
2015-04-16 11:50:07 -05:00
|
|
|
|
|
|
|
class PortModel;
|
|
|
|
class StreamModel;
|
|
|
|
|
|
|
|
class PortGroupList : public QObject {
|
|
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
friend class PortModel;
|
|
|
|
friend class StreamModel;
|
|
|
|
friend class PortStatsModel;
|
|
|
|
|
|
|
|
QList<PortGroup*> mPortGroups;
|
|
|
|
PortModel mPortGroupListModel;
|
|
|
|
StreamModel mStreamListModel;
|
|
|
|
PortStatsModel mPortStatsModel;
|
2016-02-12 07:40:19 -06:00
|
|
|
DeviceGroupModel mDeviceGroupModel;
|
2015-04-16 11:50:07 -05:00
|
|
|
|
|
|
|
QObject *streamModelTester_;
|
|
|
|
QObject *portModelTester_;
|
|
|
|
QObject *portStatsModelTester_;
|
2016-02-12 07:40:19 -06:00
|
|
|
QObject *deviceGroupModelTester_;
|
2015-04-16 11:50:07 -05:00
|
|
|
|
|
|
|
// Methods
|
|
|
|
public:
|
|
|
|
PortGroupList();
|
|
|
|
~PortGroupList();
|
|
|
|
|
|
|
|
PortModel* getPortModel() { return &mPortGroupListModel; }
|
|
|
|
PortStatsModel* getPortStatsModel() { return &mPortStatsModel; }
|
|
|
|
StreamModel* getStreamModel() { return &mStreamListModel; }
|
2016-02-12 07:40:19 -06:00
|
|
|
DeviceGroupModel* getDeviceGroupModel() { return &mDeviceGroupModel; }
|
2015-04-16 11:50:07 -05:00
|
|
|
|
|
|
|
bool isPortGroup(const QModelIndex& index);
|
|
|
|
bool isPort(const QModelIndex& index);
|
|
|
|
PortGroup& portGroup(const QModelIndex& index);
|
|
|
|
Port& port(const QModelIndex& index);
|
|
|
|
|
|
|
|
int numPortGroups() { return mPortGroups.size(); }
|
|
|
|
PortGroup& portGroupByIndex(int index) { return *(mPortGroups[index]); }
|
|
|
|
|
|
|
|
void addPortGroup(PortGroup &portGroup);
|
|
|
|
void removePortGroup(PortGroup &portGroup);
|
|
|
|
|
|
|
|
private:
|
|
|
|
int indexOfPortGroup(quint32 portGroupId);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|