All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Static Public Attributes | Protected Member Functions
GeopsySLink::SeedLinkServer Class Reference

Brief description of class still missing. More...

#include <SeedLinkServer.h>

Inheritance diagram for GeopsySLink::SeedLinkServer:
QGpCoreTools::XMLClass

List of all members.

Public Member Functions

void addStation (SeedLinkStation *station)
SubSignalPool allSignals () const
const SeedLinkStationat (int index) const
QString beginTime () const
void clear ()
int count () const
int indexOf (SeedLinkStation *station) const
QList< int > indexOf (QRegExp networkStation) const
QString organization () const
QString software () const
virtual void xml_attributes (XML_ATTRIBUTES_ARGS) const
virtual bool xml_setAttributes (XML_SETATTRIBUTES_ARGS)
virtual const QString & xml_tagName () const
 ~SeedLinkServer ()

Static Public Attributes

static const QString xmlSeedLinkServerTag = "seedlink"

Protected Member Functions

virtual XMLMember xml_member (XML_MEMBER_ARGS)
virtual void xml_polish (XML_POLISH_ARGS)
virtual void xml_writeChildren (XML_WRITECHILDREN_ARGS) const

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

Description of destructor still missing

References clear(), and TRACE.

{
  TRACE;
  clear();
}

Member Function Documentation

{append(station);}

References GeopsyCore::SubSignalPool::addSignal(), GeopsySLink::SeedLinkStation::at(), GeopsySLink::SeedLinkStation::count(), GeopsySLink::SeedLinkStream::signal(), and TRACE.

{
  TRACE;
  SubSignalPool subPool;
  for(const_iterator it=begin(); it!=end(); it++) {
    const SeedLinkStation * stat=*it;
    int n=stat->count();
    for(int i=0; i<n; i++) {
      const SeedLinkStream * stream=stat->at(i);
      Signal * sig=stream->signal();
      if(sig) {
        subPool.addSignal(sig);
      }
    }
  }
  return subPool;
}
const SeedLinkStation* GeopsySLink::SeedLinkServer::at ( int  index) const [inline]
QString GeopsySLink::SeedLinkServer::beginTime ( ) const [inline]
{return _beginTime;}

References TRACE.

Referenced by GeopsySLink::SeedLink::stations(), GeopsySLink::SeedLink::streams(), and ~SeedLinkServer().

{
  TRACE;
  qDeleteAll(*static_cast<QList<SeedLinkStation *> *>(this));
  QList<SeedLinkStation *>::clear();
}
int GeopsySLink::SeedLinkServer::count ( ) const [inline]
int GeopsySLink::SeedLinkServer::indexOf ( SeedLinkStation station) const [inline]
QList< int > GeopsySLink::SeedLinkServer::indexOf ( QRegExp  networkStation) const

References at(), count(), GeopsySLink::SeedLinkStation::name(), GeopsySLink::SeedLinkStation::network(), and TRACE.

{
  TRACE;
  QList<int> indexes;
  for(int i=count()-1; i>=0;i-- ) {
    const SeedLinkStation * s=at(i);
    if(networkStation.indexIn(s->network()+"_"+s->name())!=-1) {
      indexes.append(i);
    }
  }
  return indexes;
}
QString GeopsySLink::SeedLinkServer::organization ( ) const [inline]
{return _organization;}
QString GeopsySLink::SeedLinkServer::software ( ) const [inline]
{return _software;}

Reimplemented from QGpCoreTools::XMLClass.

References TRACE.

{
  TRACE;
  Q_UNUSED(context);
  static const QString keys[]={ "software", "organization", "started" };
  attributes.add(keys[0], _software);
  attributes.add(keys[1], _organization);
  attributes.add(keys[2], _beginTime);
}

Re-implement this function to offer XML restore (children and properties) support to your class.

From tag and map (with contains the attibute value) return a unique identifier under the format of a XMLMember. XMLMember is initialized with 3 types of contructors:

  • An integer: id number of a property
  • A XMLClass * : a child of this object identified by tag
  • Default constructor: error, unknow child or property

Map of attributes can be inspected in this way (can be achived also in xml_setProperty()):

    static const QString tmp("childrenName");
    XMLRestoreAttributeIterator it=map.find(tmp);
    if(it!=map.end()) {
      // found attribute "childrenName"
    }

If the map of attributes is not used:

    Q_UNUSED(attributes);
    if(tag=="x1") return XMLMember(0);
    else if(tag=="y1") return XMLMember(1);
    else if(tag=="x2") return XMLMember(2);
    else if(tag=="y2") return XMLMember(3);
    else return XMLMember(XMLMember::Unknown);

Arithmetic operations + and - apply to XMLMember to avoid confusion of property id numbers between inherited objects. Offset 3 corresponds to the number of properties defined in this object.

    if(tag=="anInteger") return XMLMember(0);
    else if(tag=="aString") return XMLMember(1);
    else if(tag=="aDouble") return XMLMember(2);
    return AbstractLine::xml_member(tag, attributes, context)+3;

For the arguments of this function use Macro XML_MEMBER_ARGS.

Reimplemented from QGpCoreTools::XMLClass.

References TRACE.

{
  TRACE;
  Q_UNUSED(attributes);
  Q_UNUSED(context);
  if(tag=="station" ) {
    SeedLinkStation * station=new SeedLinkStation;
    append(station);
    return XMLMember(station);
  } else return XMLMember(XMLMember::Unknown);
}

Reimplemented from QGpCoreTools::XMLClass.

References GeopsySLink::SeedLinkStation::lessThan(), and TRACE.

{
  TRACE;
  Q_UNUSED(context);
  qSort(begin(), end(), SeedLinkStation::lessThan);
}

Reimplemented from QGpCoreTools::XMLClass.

References QGpCoreTools::StringSection::size(), and TRACE.

{
  TRACE;
  Q_UNUSED(context);
  for(XMLRestoreAttributeIterator it=attributes.begin(); it!= attributes.end(); it++ ) {
    const StringSection& att=it.key();
    if(att.size()<2) return false;
    switch (att[1].unicode()) {
    case 't':
      if(att=="started" ) _beginTime=it.value().toString(); else return false;
      break;
    case 'r':
      if(att=="organization" ) _organization=it.value().toString(); else return false;
      break;
    case 'o':
      if(att=="software" ) _software=it.value().toString(); else return false;
      break;
    default:
      return false;
    }
  }
  return true;
}
virtual const QString& GeopsySLink::SeedLinkServer::xml_tagName ( ) const [inline, virtual]

Reimplemented from QGpCoreTools::XMLClass.

References TRACE.

{
  TRACE;
  for(const_iterator it=begin(); it!=end(); it++ ) {
    XMLSaveAttributes attributes;
    (*it)->xml_attributes(attributes, context);
    (*it)->xml_save(s, context, attributes);
  }
}

Member Data Documentation

const QString GeopsySLink::SeedLinkServer::xmlSeedLinkServerTag = "seedlink" [static]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines