00001 /*************************************************************************** 00002 ** 00003 ** This file is part of GeopsySLink. 00004 ** 00005 ** This file may be distributed and/or modified under the terms of the 00006 ** GNU General Public License version 2 or 3 as published by the Free 00007 ** Software Foundation and appearing in the file LICENSE.GPL included 00008 ** in the packaging of this file. 00009 ** 00010 ** This file is distributed in the hope that it will be useful, but WITHOUT 00011 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00013 ** more details. 00014 ** 00015 ** You should have received a copy of the GNU General Public License 00016 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 ** 00018 ** See http://www.geopsy.org for more information. 00019 ** 00020 ** Created : 2007-04-24 00021 ** Authors: 00022 ** Marc Wathelet 00023 ** Marc Wathelet (LGIT, Grenoble, France) 00024 ** 00025 ***************************************************************************/ 00026 00027 #ifndef SEEDLINKSTATION_H 00028 #define SEEDLINKSTATION_H 00029 00030 #include <QGpCoreTools.h> 00031 #include "GeopsySLinkDLLExport.h" 00032 00033 namespace GeopsySLink { 00034 00035 class SeedLinkStream; 00036 00037 class GEOPSYSLINK_EXPORT SeedLinkStation : public XMLClass, private QList<SeedLinkStream *> 00038 { 00039 public: 00040 ~SeedLinkStation(); 00041 00042 virtual const QString& xml_tagName() const {return xmlSeedLinkStationTag;} 00043 static const QString xmlSeedLinkStationTag; 00044 00045 static bool lessThan(SeedLinkStation * s1, SeedLinkStation * s2) {return *s1 < *s2;} 00046 inline bool operator<(const SeedLinkStation& o); 00047 00048 virtual void xml_attributes(XML_ATTRIBUTES_ARGS) const; 00049 virtual bool xml_setAttributes(XML_SETATTRIBUTES_ARGS); 00050 00051 QString name() const {return _name;} 00052 void setName(QString n) {_name=n;} 00053 00054 QString network() const {return _network;} 00055 void setNetwork(QString n) {_network=n;} 00056 00057 QString description() const {return _description;} 00058 bool streamCheck() const {return _streamCheck;} 00059 00060 void addStream(SeedLinkStream * stream) {append(stream);} 00061 static QRegExp selectorExpression(const QString& streamSelector); 00062 QList<int> indexOf(QRegExp streamSelector) const; 00063 int count() const {return QList<SeedLinkStream *>::count();} 00064 SeedLinkStream * at(int index) const {return QList<SeedLinkStream *>::at(index);} 00065 protected: 00066 virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const; 00067 virtual XMLMember xml_member(XML_MEMBER_ARGS); 00068 private: 00069 QString _name; 00070 QString _network; 00071 QString _description; 00072 bool _streamCheck; 00073 }; 00074 00075 inline bool SeedLinkStation::operator<(const SeedLinkStation& o) 00076 { 00077 TRACE; 00078 if(_network<o._network) return true; 00079 else if(_network>o._network) return false; 00080 else { 00081 if(_name<o._name) return true; 00082 else return false; 00083 } 00084 } 00085 00086 } // namespace GeopsySLink 00087 00088 #endif // SEEDLINKSTATION_H