Avionics classes for Transponder, ADF, changed namespace to 2ndlevel

This commit is contained in:
Klaus Basan
2013-04-09 02:00:38 +02:00
parent eb102372f1
commit 9a87731944
42 changed files with 2110 additions and 399 deletions

View File

@@ -1,9 +1,19 @@
/* Copyright (C) 2013 VATSIM Community
* 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/. */
#ifndef AVIOBASE_H
#define AVIOBASE_H
// QtGlobal is required for asserts
#include <QtGlobal>
#include "blackmisc/pqconstants.h"
namespace BlackMisc {
namespace BlackMisc
{
namespace Aviation
{
/*!
* \brief Base class for avionics
@@ -37,11 +47,13 @@ class CAvionicsBase
return log;
}
private:
QString m_name; //!< name of the unit
protected:
/*!
* \brief Default constructor
*/
CAvionicsBase() {}
CAvionicsBase(const QString &name) : m_name(name) {}
/*!
* \brief Meaningful string representation
* \return
@@ -51,16 +63,46 @@ protected:
* \brief Are the set values valid / in range
* \return
*/
virtual bool validValues() { return true; }
public:
virtual bool validValues() {
return true;
}
/*!
* \brief Set name
* \param name
*/
void setName(const QString &name) {
this->m_name = name;
}
/*!
* \brief operator ==
* \param otherSystem
* \return
*/
bool operator ==(const CAvionicsBase &otherSystem) const {
if (this == &otherSystem) return true;
return this->m_name == otherSystem.m_name;
}
/**
* @brief Virtual destructor
public:
/*!
* \brief Virtual destructor
*/
virtual ~CAvionicsBase() {}
/*!
* \brief Cast as QString
*/
operator QString() const {
return this->stringForStreamingOperator();
}
/*!
* \brief Name
* \return
*/
QString getName() const {
return this->m_name;
}
};
} // namespace
} // namespace
#endif // AVIOBASE_H