summaryrefslogtreecommitdiffstats
path: root/src/net/mcast/McastConfiguration.h
diff options
context:
space:
mode:
authorFabian Schillinger2010-11-01 17:35:27 +0100
committerFabian Schillinger2010-11-01 17:35:27 +0100
commitea3fb17345e5f82db9f2e98a8062e95797700ace (patch)
tree1da0d1a8ec9455364386af78762d0f6fed187824 /src/net/mcast/McastConfiguration.h
parentProcess start/stop/view functionality (diff)
parent[PVSGUI] No X required for --help and --version (diff)
downloadpvs-ea3fb17345e5f82db9f2e98a8062e95797700ace.tar.gz
pvs-ea3fb17345e5f82db9f2e98a8062e95797700ace.tar.xz
pvs-ea3fb17345e5f82db9f2e98a8062e95797700ace.zip
Merge branch 'master' of openslx.org:pvs
Conflicts: CMakeLists.txt src/core/pvsConnectionManager.cpp src/pvs.cpp src/pvs.h
Diffstat (limited to 'src/net/mcast/McastConfiguration.h')
-rw-r--r--src/net/mcast/McastConfiguration.h204
1 files changed, 204 insertions, 0 deletions
diff --git a/src/net/mcast/McastConfiguration.h b/src/net/mcast/McastConfiguration.h
new file mode 100644
index 0000000..53f7a54
--- /dev/null
+++ b/src/net/mcast/McastConfiguration.h
@@ -0,0 +1,204 @@
+/*
+# Copyright (c) 2009 - OpenSLX Project, Computer Center University of Freiburg
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# src/net/mcast/McastConfiguration.h
+# - hold Multicast protocol configuration data
+# -----------------------------------------------------------------------------
+*/
+
+#ifndef MCASTCONFIGURATION_H_
+#define MCASTCONFIGURATION_H_
+
+#include <QObject>
+#include <QString>
+#include <QtGlobal>
+
+#include "McastConstants.h"
+
+class QSettings;
+
+class McastConfiguration: public QObject
+{
+ Q_OBJECT
+public:
+ McastConfiguration(QObject* parent = 0) :
+ QObject(parent),
+ _multicastInterface(DEFAULT_MULTICAST_INTERFACE),
+ _multicastAddress(DEFAULT_MULTICAST_ADDRESS),
+ _multicastRate(DEFAULT_MULTICAST_RATE),
+ _multicastSPort(DEFAULT_MULTICAST_SPORT),
+ _multicastDPort(DEFAULT_MULTICAST_DPORT),
+ _multicastWinSize(DEFAULT_MULTICAST_WSIZ),
+ _multicastMTU(DEFAULT_MULTICAST_MTU),
+ _multicastUDPPortBase(DEFAULT_MULTICAST_UDPPORT),
+ _multicastUseUDP(DEFAULT_MULTICAST_USEUDP)
+ {
+ }
+
+ McastConfiguration(McastConfiguration const& other, QObject* parent = 0) :
+ QObject(parent),
+ _multicastInterface(other._multicastInterface),
+ _multicastAddress(other._multicastAddress),
+ _multicastRate(other._multicastRate),
+ _multicastSPort(other._multicastSPort),
+ _multicastDPort(other._multicastDPort),
+ _multicastWinSize(other._multicastWinSize),
+ _multicastMTU(other._multicastMTU),
+ _multicastUDPPortBase(other._multicastUDPPortBase),
+ _multicastUseUDP(other._multicastUseUDP)
+ {
+ }
+
+ virtual ~McastConfiguration()
+ {
+ }
+
+ QString multicastAddress() const
+ {
+ return _multicastAddress;
+ }
+ McastConfiguration* multicastAddress(QString const& address)
+ {
+ _multicastAddress = address;
+ return this;
+ }
+
+ quint16 multicastSPort() const
+ {
+ return _multicastSPort;
+ }
+ McastConfiguration* multicastSPort(quint16 port)
+ {
+ _multicastSPort = port;
+ return this;
+ }
+
+ quint16 multicastDPort() const
+ {
+ return _multicastDPort;
+ }
+ McastConfiguration* multicastDPort(quint16 port)
+ {
+ _multicastDPort = port;
+ return this;
+ }
+
+ quint32 multicastRate() const
+ {
+ return _multicastRate;
+ }
+ McastConfiguration* multicastRate(quint32 rate)
+ {
+ _multicastRate = rate;
+ return this;
+ }
+
+ quint16 multicastWinSize() const
+ {
+ return _multicastWinSize;
+ }
+ McastConfiguration* multicastWinSize(quint16 size)
+ {
+ _multicastWinSize = size;
+ return this;
+ }
+
+ quint16 multicastMTU() const
+ {
+ return _multicastMTU;
+ }
+ McastConfiguration* multicastMTU(quint16 mtu)
+ {
+ _multicastMTU = mtu;
+ return this;
+ }
+
+ bool multicastUseUDP() const
+ {
+ return _multicastUseUDP;
+ }
+ McastConfiguration* multicastUseUDP(bool useUDP)
+ {
+ _multicastUseUDP = useUDP;
+ return this;
+ }
+
+ quint16 multicastUDPPortBase() const
+ {
+ return _multicastUDPPortBase;
+ }
+ McastConfiguration* multicastUDPPortBase(quint16 port)
+ {
+ _multicastUDPPortBase = port;
+ return this;
+ }
+
+ QString multicastInterface() const
+ {
+ return _multicastInterface;
+ }
+ McastConfiguration* multicastInterface(QString const& interface)
+ {
+ _multicastInterface = interface;
+ return this;
+ }
+
+ quint16 multicastUDPUPort() const
+ {
+ return _multicastUDPPortBase;
+ }
+
+ quint16 multicastUDPMPort() const
+ {
+ return _multicastUDPPortBase;
+ }
+
+ void commit()
+ {
+ emit changed();
+ }
+
+ McastConfiguration& operator=(McastConfiguration const& source)
+ {
+ if(this != &source)
+ {
+ _multicastInterface = source._multicastInterface;
+ _multicastAddress = source._multicastAddress;
+ _multicastRate = source._multicastRate;
+ _multicastSPort = source._multicastSPort;
+ _multicastDPort = source._multicastDPort;
+ _multicastWinSize = source._multicastWinSize;
+ _multicastMTU = source._multicastMTU;
+ _multicastUDPPortBase = source._multicastUDPPortBase;
+ _multicastUseUDP = source._multicastUseUDP;
+ }
+ return *this;
+ }
+
+ void loadFrom(QSettings* settings, char const* group = 0);
+ void writeTo(QSettings* settings, char const* group = 0) const;
+
+signals:
+ void changed();
+
+private:
+ QString _multicastInterface;
+ QString _multicastAddress;
+ quint32 _multicastRate;
+ quint16 _multicastSPort;
+ quint16 _multicastDPort;
+ quint16 _multicastWinSize;
+ quint16 _multicastMTU;
+ quint16 _multicastUDPPortBase;
+ bool _multicastUseUDP;
+};
+
+#endif /* MCASTCONFIGURATION_H_ */