From a45977185a485624095bff1a15024e9199eee676 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 1 Jan 2016 22:05:42 +0100 Subject: reorganize source files into SAP and agents --- sap/sapchannelinfo.cc | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sap/sapchannelinfo.cc (limited to 'sap/sapchannelinfo.cc') diff --git a/sap/sapchannelinfo.cc b/sap/sapchannelinfo.cc new file mode 100644 index 0000000..530341a --- /dev/null +++ b/sap/sapchannelinfo.cc @@ -0,0 +1,89 @@ +#include "sapchannelinfo.h" +#include + +struct SAPChannelInfoData : public QSharedData { + unsigned short id; + SAPChannelInfo::PayloadType payload; + SAPChannelInfo::QoSType qosType; + SAPChannelInfo::QoSPriority qosPriority; + SAPChannelInfo::QoSDataRate qosDataRate; +}; + +SAPChannelInfo::SAPChannelInfo() : data(new SAPChannelInfoData) +{ +} + +SAPChannelInfo::SAPChannelInfo(const SAPChannelInfo &rhs) : data(rhs.data) +{ +} + +SAPChannelInfo &SAPChannelInfo::operator=(const SAPChannelInfo &rhs) +{ + if (this != &rhs) + data.operator=(rhs.data); + return *this; +} + +SAPChannelInfo::~SAPChannelInfo() +{ + +} + +unsigned short SAPChannelInfo::channelId() const +{ + return data->id; +} + +void SAPChannelInfo::setChannelId(unsigned short id) +{ + data->id = id; +} + +SAPChannelInfo::PayloadType SAPChannelInfo::payloadType() const +{ + return data->payload; +} + +void SAPChannelInfo::setPayloadType(PayloadType type) +{ + data->payload = type; +} + +SAPChannelInfo::QoSType SAPChannelInfo::qosType() const +{ + return data->qosType; +} + +void SAPChannelInfo::setQoSType(QoSType type) +{ + data->qosType = type; +} + +SAPChannelInfo::QoSPriority SAPChannelInfo::qosPriority() const +{ + return data->qosPriority; +} + +void SAPChannelInfo::setQoSPriority(QoSPriority priority) +{ + data->qosPriority = priority; +} + +SAPChannelInfo::QoSDataRate SAPChannelInfo::qosDataRate() const +{ + return data->qosDataRate; +} + +void SAPChannelInfo::setQoSDataRate(QoSDataRate rate) +{ + data->qosDataRate = rate; +} + +QDebug operator<<(QDebug debug, const SAPChannelInfo &info) +{ + QDebugStateSaver saver(debug); + Q_UNUSED(saver); + debug.nospace() << "SAPChannelInfo(" << info.channelId() << ", qosType=" << info.qosType() << ", dataRate=" << info.qosDataRate() << ", priority=" << info.qosPriority() + << ", payload=" << info.payloadType() << ")"; + return debug; +} -- cgit v1.2.3