From a71658a5f3f1879644ffffa3c1a31a83c2f88927 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 21 Jan 2014 01:45:36 +0100 Subject: [PATCH] Added callsign list --- src/blackmisc/avcallsignlist.cpp | 38 ++++++++++++++++++++ src/blackmisc/avcallsignlist.h | 59 ++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 src/blackmisc/avcallsignlist.cpp create mode 100644 src/blackmisc/avcallsignlist.h diff --git a/src/blackmisc/avcallsignlist.cpp b/src/blackmisc/avcallsignlist.cpp new file mode 100644 index 000000000..66daf2fc1 --- /dev/null +++ b/src/blackmisc/avcallsignlist.cpp @@ -0,0 +1,38 @@ +/* Copyright (C) 2013 VATSIM Community / authors + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "avcallsignlist.h" +#include "predicates.h" + +namespace BlackMisc +{ + namespace Aviation + { + /* + * Empty constructor + */ + CCallsignList::CCallsignList() { } + + /* + * Construct from base class object + */ + CCallsignList::CCallsignList(const CSequence &other) : + CSequence(other) + { } + + /* + * Register metadata + */ + void CCallsignList::registerMetadata() + { + qRegisterMetaType>(); + qDBusRegisterMetaType>(); + qRegisterMetaType>(); + qDBusRegisterMetaType>(); + qRegisterMetaType(); + qDBusRegisterMetaType(); + } + } // namespace +} // namespace diff --git a/src/blackmisc/avcallsignlist.h b/src/blackmisc/avcallsignlist.h new file mode 100644 index 000000000..08bf38f7d --- /dev/null +++ b/src/blackmisc/avcallsignlist.h @@ -0,0 +1,59 @@ +/* Copyright (C) 2013 VATSIM Community / authors + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/*! + \file +*/ + +#ifndef BLACKMISC_CALLSIGNLIST_H +#define BLACKMISC_CALLSIGNLIST_H + +#include "avcallsign.h" +#include "collection.h" +#include "sequence.h" +#include + +namespace BlackMisc +{ + namespace Aviation + { + /*! + * Value object encapsulating a list of callsign. + */ + class CCallsignList : public CSequence + { + public: + /*! + * \brief Default constructor. + */ + CCallsignList(); + + /*! + * \brief Construct from a base class object. + */ + CCallsignList(const CSequence &other); + + /*! + * \copydoc CValueObject::toQVariant() + */ + virtual QVariant toQVariant() const + { + return QVariant::fromValue(*this); + } + + /*! + * \brief Register metadata + */ + static void registerMetadata(); + + }; + } //namespace +} // namespace + +Q_DECLARE_METATYPE(BlackMisc::Aviation::CCallsignList) +Q_DECLARE_METATYPE(BlackMisc::CCollection) +Q_DECLARE_METATYPE(BlackMisc::CSequence) + +#endif //guard