summaryrefslogtreecommitdiff
path: root/sap/sapserviceinfo.cc
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2016-01-01 22:05:42 +0100
committerJavier <dev.git@javispedro.com>2016-01-01 22:05:42 +0100
commita45977185a485624095bff1a15024e9199eee676 (patch)
tree6cc57d085bdd01e493477c870dbe0548137998e1 /sap/sapserviceinfo.cc
parenta24034bdfea259cdc09c74217be75d4f9de0dce5 (diff)
downloadsapd-a45977185a485624095bff1a15024e9199eee676.tar.gz
sapd-a45977185a485624095bff1a15024e9199eee676.zip
reorganize source files into SAP and agents
Diffstat (limited to 'sap/sapserviceinfo.cc')
-rw-r--r--sap/sapserviceinfo.cc106
1 files changed, 106 insertions, 0 deletions
diff --git a/sap/sapserviceinfo.cc b/sap/sapserviceinfo.cc
new file mode 100644
index 0000000..a77d2f0
--- /dev/null
+++ b/sap/sapserviceinfo.cc
@@ -0,0 +1,106 @@
+#include <QtCore/QMap>
+#include <QtCore/QSharedData>
+
+#include "sapserviceinfo.h"
+#include "sapchannelinfo.h"
+
+
+class SAPServiceInfoData : public QSharedData {
+public:
+ QString profile;
+ QString friendlyName;
+ SAPServiceInfo::Role role;
+ unsigned short version;
+ unsigned short connectionTimeout;
+
+ QMap<int, SAPChannelInfo> channels;
+};
+
+SAPServiceInfo::SAPServiceInfo() : data(new SAPServiceInfoData)
+{
+}
+
+SAPServiceInfo::SAPServiceInfo(const SAPServiceInfo &rhs) : data(rhs.data)
+{
+}
+
+SAPServiceInfo &SAPServiceInfo::operator=(const SAPServiceInfo &rhs)
+{
+ if (this != &rhs)
+ data.operator=(rhs.data);
+ return *this;
+}
+
+SAPServiceInfo::~SAPServiceInfo()
+{
+}
+
+QString SAPServiceInfo::profile() const
+{
+ return data->profile;
+}
+
+void SAPServiceInfo::setProfile(const QString &profile)
+{
+ data->profile = profile;
+}
+
+QString SAPServiceInfo::friendlyName() const
+{
+ return data->friendlyName;
+}
+
+void SAPServiceInfo::setFriendlyName(const QString &name)
+{
+ data->friendlyName = name;
+}
+
+SAPServiceInfo::Role SAPServiceInfo::role() const
+{
+ return data->role;
+}
+
+void SAPServiceInfo::setRole(SAPServiceInfo::Role role)
+{
+ data->role = role;
+}
+
+unsigned short SAPServiceInfo::version() const
+{
+ return data->version;
+}
+
+void SAPServiceInfo::setVersion(unsigned short version)
+{
+ data->version = version;
+}
+
+void SAPServiceInfo::setVersion(unsigned char maj, unsigned char min)
+{
+ setVersion((maj << 8) | (min & 0xFF));
+}
+
+unsigned short SAPServiceInfo::connectionTimeout() const
+{
+ return data->connectionTimeout;
+}
+
+void SAPServiceInfo::setConnectionTimeout(unsigned short timeout)
+{
+ data->connectionTimeout = timeout;
+}
+
+void SAPServiceInfo::addChannel(const SAPChannelInfo &channel)
+{
+ data->channels.insert(channel.channelId(), channel);
+}
+
+void SAPServiceInfo::removeChannel(unsigned short channelId)
+{
+ data->channels.remove(channelId);
+}
+
+QList<SAPChannelInfo> SAPServiceInfo::channels() const
+{
+ return data->channels.values();
+}