refs #91 & #124 doxygen fixes, style/comment changes, typos, and override keywords

This commit is contained in:
Klaus Basan
2014-02-06 03:22:42 +01:00
parent 2356708b63
commit 526cd916a8
9 changed files with 162 additions and 413 deletions

View File

@@ -166,7 +166,6 @@ namespace BlackCore
*/ */
virtual void runSquelchTest() const; virtual void runSquelchTest() const;
private: private:
CVoiceVatlib *m_voice; //!< underlying voice lib CVoiceVatlib *m_voice; //!< underlying voice lib
}; };

View File

@@ -40,9 +40,7 @@ namespace BlackCore
*/ */
CVoiceVatlib(QObject *parent = nullptr); CVoiceVatlib(QObject *parent = nullptr);
/*! //! \brief Destructor
* \brief Destructor
*/
virtual ~CVoiceVatlib(); virtual ~CVoiceVatlib();
// Hardware devices // Hardware devices
@@ -50,133 +48,85 @@ namespace BlackCore
// to different voice rooms and send their audio to different devices, e.g. ATIS to loudspeakers // to different voice rooms and send their audio to different devices, e.g. ATIS to loudspeakers
// and ATC to headspeakers. Is not important to implement that now, if ever. // and ATC to headspeakers. Is not important to implement that now, if ever.
/*! //! \copydoc IVoice::audioDevices()
* \copydoc IVoice::audioDevices() virtual const BlackMisc::Voice::CAudioDeviceList &audioDevices() const override;
*/
virtual const BlackMisc::Voice::CAudioDeviceList &audioDevices() const ;
/*! //! \copydoc IVoice::defaultAudioInputDevice()
* \copydoc IVoice::defaultAudioInputDevice() virtual const BlackMisc::Voice::CAudioDevice defaultAudioInputDevice() const override;
*/
virtual const BlackMisc::Voice::CAudioDevice defaultAudioInputDevice() const;
/*! //! \copydoc IVoice::defaultAudioOutputDevice()
* \copydoc IVoice::defaultAudioOutputDevice() virtual const BlackMisc::Voice::CAudioDevice defaultAudioOutputDevice() const override;
*/
virtual const BlackMisc::Voice::CAudioDevice defaultAudioOutputDevice() const;
/************************************************ /************************************************
* SETUP TESTS * SETUP TESTS
* *********************************************/ ***********************************************/
/*! //! \copydoc IVoice::runSquelchTest
* \copydoc IVoice::runSquelchTest virtual void runSquelchTest() override;
*/
virtual void runSquelchTest();
/*! //! \copydoc IVoice::runMicTest
* \copydoc IVoice::runMicTest virtual void runMicrophoneTest() override;
*/
virtual void runMicrophoneTest();
/*! //! \copydoc IVoice::inputSquelch
* \copydoc IVoice::inputSquelch virtual float inputSquelch() const override;
*/
virtual float inputSquelch() const;
/*! //! \copydoc IVoice::micTestResult()
* \copydoc IVoice::micTestResult() virtual qint32 micTestResult() const override;
*/
virtual qint32 micTestResult() const;
/*! //! \copydoc IVoice::micTestResultAsString
* \copydoc IVoice::micTestResultAsString virtual QString micTestResultAsString() const override;
*/
virtual QString micTestResultAsString() const;
public slots: public slots:
/*! //! \copydoc IVoice::setMyAircraftCallsign()
* \copydoc IVoice::setMyAircraftCallsign() virtual void setMyAircraftCallsign(const BlackMisc::Aviation::CCallsign &callsign) override;
*/
virtual void setMyAircraftCallsign(const BlackMisc::Aviation::CCallsign &callsign);
/*! //! \copydoc IVoice::joinVoiceRoom()
* \copydoc IVoice::joinVoiceRoom() virtual void joinVoiceRoom(const ComUnit comUnit, const BlackMisc::Voice::CVoiceRoom &voiceRoom) override;
*/
virtual void joinVoiceRoom(const ComUnit comUnit, const BlackMisc::Voice::CVoiceRoom &voiceRoom);
/*! //! \copydoc IVoice::leaveVoiceRoom()
* \copydoc IVoice::leaveVoiceRoom() virtual void leaveVoiceRoom(const ComUnit comUnit) override;
*/
virtual void leaveVoiceRoom(const ComUnit comUnit);
/*! //! \copydoc IVoice::leaveAllVoiceRooms()
* \copydoc IVoice::leaveAllVoiceRooms() virtual void leaveAllVoiceRooms() override;
*/
virtual void leaveAllVoiceRooms();
/*! //! \copydoc IVoice::setRoomOutputVolume()
* \copydoc IVoice::setRoomOutputVolume() virtual void setRoomOutputVolume(const ComUnit comUnit, const qint32 volumne) override;
*/
virtual void setRoomOutputVolume(const ComUnit comUnit, const qint32 volumne);
/*! //! \copydoc IVoice::startTransmitting()
* \copydoc IVoice::startTransmitting() virtual void startTransmitting(const ComUnit comUnit) override;
*/
virtual void startTransmitting(const ComUnit comUnit);
/*! //! \copydoc IVoice::stopTransmitting()
* \copydoc IVoice::stopTransmitting() virtual void stopTransmitting(const ComUnit comUnit) override;
*/
virtual void stopTransmitting(const ComUnit comUnit);
/*! //! \copydoc IVoice::getComVoiceRoomsWithAudioStatus()
* \copydoc IVoice::getComVoiceRoomsWithAudioStatus() virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRoomsWithAudioStatus() const override;
*/
virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRoomsWithAudioStatus() const;
/*! //! \copydoc IVoice::getComVoiceRooms()
* \copydoc IVoice::getComVoiceRooms() virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRooms() const override
*/
virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRooms() const
{ {
return this->m_voiceRooms; return this->m_voiceRooms;
} }
/*! //! \copydoc IVoice::getVoiceRoomCallsigns()
* \copydoc IVoice::getVoiceRoomCallsigns() virtual BlackMisc::Aviation::CCallsignList getVoiceRoomCallsigns(const ComUnit comUnit) const override;
*/
virtual BlackMisc::Aviation::CCallsignList getVoiceRoomCallsigns(const ComUnit comUnit) const;
/*! //! \copydoc IVoice::setInputDevice
* \copydoc IVoice::setInputDevice virtual void setInputDevice(const BlackMisc::Voice::CAudioDevice &device) override;
*/
virtual void setInputDevice(const BlackMisc::Voice::CAudioDevice &device);
/*! //! \copydoc IVoice::setOutputDevice
* \copydoc IVoice::setOutputDevice virtual void setOutputDevice(const BlackMisc::Voice::CAudioDevice &device) override;
*/
virtual void setOutputDevice(const BlackMisc::Voice::CAudioDevice &device);
/*! //! \copydoc IVoice::getCurrentInputDevice()
* \brief Current input device virtual BlackMisc::Voice::CAudioDevice getCurrentInputDevice() const override;
*/
virtual BlackMisc::Voice::CAudioDevice getCurrentInputDevice() const;
/*! //! \copydoc IVoice::getCurrentOutputDevice()
* \brief Current output device virtual BlackMisc::Voice::CAudioDevice getCurrentOutputDevice() const override;
*/
virtual BlackMisc::Voice::CAudioDevice getCurrentOutputDevice() const;
/*! //! \copydoc IVoice::switchAudioOutput
* \copydoc IVoice::switchAudioOutput virtual void switchAudioOutput(const ComUnit comUnit, bool enable) override;
*/
virtual void switchAudioOutput(const ComUnit comUnit, bool enable);
/*! //! \copydoc IVoice::isMuted
* \copydoc IVoice::isMuted virtual bool isMuted() const override
*/
virtual bool isMuted() const
{ {
if (this->m_outputEnabled.isEmpty()) return false; if (this->m_outputEnabled.isEmpty()) return false;
bool enabled = this->m_outputEnabled[COM1] || this->m_outputEnabled[COM2]; bool enabled = this->m_outputEnabled[COM1] || this->m_outputEnabled[COM2];

View File

@@ -50,35 +50,19 @@ namespace BlackGui
*/ */
QString columnToName(int column) const; QString columnToName(int column) const;
/*! //! \brief Column to property index
* \brief Column to property index
* \param index
*/
int columnToPropertyIndex(int column) const; int columnToPropertyIndex(int column) const;
/*! //! \brief Property index to column
* \brief Property index to column
* \param propertyIndex
* \return
*/
int propertyIndexToColumn(int propertyIndex) const; int propertyIndexToColumn(int propertyIndex) const;
/*! //! \brief Column index to property index
* \brief Column index to property index
* \param index
*/
int indexToPropertyIndex(int index) const; int indexToPropertyIndex(int index) const;
/*! //! \brief Column index to name
* \brief Column index to name
* \param index
*/
int nameToPropertyIndex(const QString &name) const; int nameToPropertyIndex(const QString &name) const;
/*! //! \brief Size (number of columns)
* \brief Size (number of columns)
* \return
*/
int size() const; int size() const;
/*! /*!

View File

@@ -287,20 +287,14 @@ namespace BlackMisc
IndexIcao IndexIcao
}; };
/*! //! \copydoc CValueObject::propertyByIndex()
* \copydoc CValueObject::propertyByIndex() virtual QVariant propertyByIndex(int index) const override;
*/
virtual QVariant propertyByIndex(int index) const;
/*! //! \copydoc CValueObject::propertyByIndexAsString()
* \copydoc CValueObject::propertyByIndexAsString() virtual QString propertyByIndexAsString(int index, bool i18n) const override;
*/
virtual QString propertyByIndexAsString(int index, bool i18n) const;
/*! //! \copydoc CValueObject::setPropertyByIndex(variant, index)
* \copydoc CValueObject::setPropertyByIndex() virtual void setPropertyByIndex(const QVariant &variant, int index) override;
*/
virtual void setPropertyByIndex(const QVariant &variant, int index);
protected: protected:
/*! /*!
@@ -343,7 +337,6 @@ namespace BlackMisc
CAircraftIcao m_icao; CAircraftIcao m_icao;
BlackMisc::PhysicalQuantities::CLength m_distanceToPlane; BlackMisc::PhysicalQuantities::CLength m_distanceToPlane;
}; };
} // namespace } // namespace
} // namespace } // namespace

View File

@@ -81,128 +81,79 @@ namespace BlackMisc
bool isOnline = false, const QDateTime &bookedFromUtc = QDateTime(), const QDateTime &bookedUntilUtc = QDateTime(), bool isOnline = false, const QDateTime &bookedFromUtc = QDateTime(), const QDateTime &bookedUntilUtc = QDateTime(),
const CInformationMessage &atis = CInformationMessage(CInformationMessage::ATIS), const CInformationMessage &metar = CInformationMessage(CInformationMessage::METAR)); const CInformationMessage &atis = CInformationMessage(CInformationMessage::ATIS), const CInformationMessage &metar = CInformationMessage(CInformationMessage::METAR));
/*! //! \copydoc CValueObject::toQVariant()
* \copydoc CValueObject::toQVariant()
*/
virtual QVariant toQVariant() const virtual QVariant toQVariant() const
{ {
return QVariant::fromValue(*this); return QVariant::fromValue(*this);
} }
/*! //! \brief Equal operator ==
* \brief Equal operator ==
*/
bool operator ==(const CAtcStation &other) const; bool operator ==(const CAtcStation &other) const;
/*! //! \brief Unequal operator !=
* \brief Unequal operator ==
*/
bool operator !=(const CAtcStation &other) const; bool operator !=(const CAtcStation &other) const;
/*! //! \brief Has booking times?
* \brief Has booking times?
*/
bool hasBookingTimes() const bool hasBookingTimes() const
{ {
return !(this->m_bookedFromUtc.isNull() && this->m_bookedUntilUtc.isNull()); return !(this->m_bookedFromUtc.isNull() && this->m_bookedUntilUtc.isNull());
} }
/*! //! \brief Has ATIS?
* \brief Has ATIS?
*/
bool hasAtis() const bool hasAtis() const
{ {
return this->m_atis.hasMessage(); return this->m_atis.hasMessage();
} }
/*! //! \brief Has METAR?
* \brief Has Metar?
*/
bool hasMetar() const bool hasMetar() const
{ {
return this->m_metar.hasMessage(); return this->m_metar.hasMessage();
} }
/*! //! Get callsign.
* Get callsign.
* \return
*/
const CCallsign &getCallsign() const { return m_callsign; } const CCallsign &getCallsign() const { return m_callsign; }
/*! //! Get callsign as string.
* Get callsign as string.
*/
QString getCallsignAsString() const { return m_callsign.asString(); } QString getCallsignAsString() const { return m_callsign.asString(); }
/*! //! Set callsign
* Set callsign
*/
void setCallsign(const CCallsign &callsign) { this->m_callsign = callsign; this->m_controller.setCallsign(callsign);} void setCallsign(const CCallsign &callsign) { this->m_callsign = callsign; this->m_controller.setCallsign(callsign);}
/*! //! Get controller
* Get controller
* \return
*/
const BlackMisc::Network::CUser &getController() const { return m_controller; } const BlackMisc::Network::CUser &getController() const { return m_controller; }
/*! //! Get controller name.
* Get controller name.
* \return
*/
QString getControllerRealName() const { return m_controller.getRealName(); } QString getControllerRealName() const { return m_controller.getRealName(); }
/*! //! Get controller name.
* Get controller name.
* \return
*/
QString getControllerId() const { return m_controller.getId(); } QString getControllerId() const { return m_controller.getId(); }
/*! //! Set controller
* Set controller
* \param controller
*/
void setController(const BlackMisc::Network::CUser &controller) { this->m_controller = controller; this->m_controller.setCallsign(this->m_callsign); } void setController(const BlackMisc::Network::CUser &controller) { this->m_controller = controller; this->m_controller.setCallsign(this->m_callsign); }
/*! //! Set controller's name
* Set controller's name
* \param controllerName
*/
void setControllerRealName(const QString &controllerName) { this->m_controller.setRealName(controllerName); } void setControllerRealName(const QString &controllerName) { this->m_controller.setRealName(controllerName); }
/*! //! Set controller's id
* Set controller's id
*/
void setControllerId(const QString &controllerId) { this->m_controller.setId(controllerId); } void setControllerId(const QString &controllerId) { this->m_controller.setId(controllerId); }
/*! //! \brief Has valid realname?
* \brief Has valid realname?
*/
bool hasValidRealName() const { return this->m_controller.hasValidRealName(); } bool hasValidRealName() const { return this->m_controller.hasValidRealName(); }
/*! //! \brief Has valid id?
* \brief Has valid id?
*/
bool hasValidId() const { return this->m_controller.hasValidId(); } bool hasValidId() const { return this->m_controller.hasValidId(); }
/*! //! Get frequency.
* Get frequency.
*/
const BlackMisc::PhysicalQuantities::CFrequency &getFrequency() const { return m_frequency; } const BlackMisc::PhysicalQuantities::CFrequency &getFrequency() const { return m_frequency; }
/*! //! Set frequency
* Set frequency
*/
void setFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency) { this->m_frequency = frequency; } void setFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency) { this->m_frequency = frequency; }
/*! //! Get the position of the center of the controller's area of visibility.
* Get the position of the center of the controller's area of visibility.
*/
const BlackMisc::Geo::CCoordinateGeodetic &getPosition() const { return m_position; } const BlackMisc::Geo::CCoordinateGeodetic &getPosition() const { return m_position; }
/*! //! Set position
* Set position
* \param position
*/
void setPosition(const BlackMisc::Geo::CCoordinateGeodetic &position) { this->m_position = position; } void setPosition(const BlackMisc::Geo::CCoordinateGeodetic &position) { this->m_position = position; }
/*! /*!
@@ -212,80 +163,50 @@ namespace BlackMisc
*/ */
void syncronizeControllerData(CAtcStation &otherStation); void syncronizeControllerData(CAtcStation &otherStation);
/*! //! \brief Get the radius of the controller's area of visibility.
* Get the radius of the controller's area of visibility.
* \return
*/
const BlackMisc::PhysicalQuantities::CLength &getRange() const { return m_range; } const BlackMisc::PhysicalQuantities::CLength &getRange() const { return m_range; }
/*! //! \brief Set range
* Set range
* \param range
*/
void setRange(const BlackMisc::PhysicalQuantities::CLength &range) { this->m_range = range; } void setRange(const BlackMisc::PhysicalQuantities::CLength &range) { this->m_range = range; }
/*! //! Get the distance to own plane
* Get the distance to own plane
*/
const BlackMisc::PhysicalQuantities::CLength &getDistanceToPlane() const { return m_distanceToPlane; } const BlackMisc::PhysicalQuantities::CLength &getDistanceToPlane() const { return m_distanceToPlane; }
/*! //! Set distance to own plane
* Set distance to own plane
*/
void setDistanceToPlane(const BlackMisc::PhysicalQuantities::CLength &distance) { this->m_distanceToPlane = distance; } void setDistanceToPlane(const BlackMisc::PhysicalQuantities::CLength &distance) { this->m_distanceToPlane = distance; }
/*! //! \brief Valid distance?
* \brief Valid distance?
*/
bool hasValidDistance() const { return !this->m_distanceToPlane.isNegativeWithEpsilonConsidered();} bool hasValidDistance() const { return !this->m_distanceToPlane.isNegativeWithEpsilonConsidered();}
/*! /*!
* \brief Calculcate distance to plane, set it, and also return it * \brief Calculcate distance to plane, set it, and also return it
* \param position * \param position other position
* \return * \return
*/ */
const BlackMisc::PhysicalQuantities::CLength &calculcateDistanceToPlane(const BlackMisc::Geo::CCoordinateGeodetic &position); const BlackMisc::PhysicalQuantities::CLength &calculcateDistanceToPlane(const BlackMisc::Geo::CCoordinateGeodetic &position);
/*! //! \brief Is station online (or just booked)?
* \brief Is station online (or just booked)
* \return
*/
bool isOnline() const { return m_isOnline; } bool isOnline() const { return m_isOnline; }
/*! //! Set online
* Set online
* \param online
*/
void setOnline(bool online) { this->m_isOnline = online; } void setOnline(bool online) { this->m_isOnline = online; }
/*! //! \brief Get voice room
* \brief Get voice room
* \return
*/
const BlackMisc::Voice::CVoiceRoom &getVoiceRoom() const { return this->m_voiceRoom; } const BlackMisc::Voice::CVoiceRoom &getVoiceRoom() const { return this->m_voiceRoom; }
/*! //! \brief Set voice room
* \brief Set voice room
* \param
*/
void setVoiceRoom(const BlackMisc::Voice::CVoiceRoom &voiceRoom) { this->m_voiceRoom = voiceRoom; } void setVoiceRoom(const BlackMisc::Voice::CVoiceRoom &voiceRoom) { this->m_voiceRoom = voiceRoom; }
/*! //! \brief Valid voice room?
* \brief Valid voice room?
* \return
*/
bool hasValidVoiceRoom() const { return this->m_voiceRoom.isValid(); } bool hasValidVoiceRoom() const { return this->m_voiceRoom.isValid(); }
/*! /*!
* Booked date/time if any. * Booked date/time if any.
* This represents the closest booking within a time frame as there can be multiple bookings. * This represents the closest booking within a time frame as there can be multiple bookings.
* \return
*/ */
const QDateTime &getBookedFromUtc() const { return m_bookedFromUtc; } const QDateTime &getBookedFromUtc() const { return m_bookedFromUtc; }
/*! //! Set booked from
* Set booked from
*/
void setBookedFromUtc(const QDateTime &from) { this->m_bookedFromUtc = from; } void setBookedFromUtc(const QDateTime &from) { this->m_bookedFromUtc = from; }
/*! /*!
@@ -294,34 +215,24 @@ namespace BlackMisc
*/ */
const QDateTime &getBookedUntilUtc() const { return m_bookedUntilUtc; } const QDateTime &getBookedUntilUtc() const { return m_bookedUntilUtc; }
/*! //! \brief Has valid booking times?
* \brief Has valid booking times?
*/
bool hasValidBookingTimes() const bool hasValidBookingTimes() const
{ {
return !this->m_bookedFromUtc.isNull() && this->m_bookedFromUtc.isValid() && return !this->m_bookedFromUtc.isNull() && this->m_bookedFromUtc.isValid() &&
!this->m_bookedUntilUtc.isNull() && this->m_bookedUntilUtc.isValid(); !this->m_bookedUntilUtc.isNull() && this->m_bookedUntilUtc.isValid();
} }
/*! //! \brief Transfer booking times
* \brief Transfer booking times
* \param otherStation
*/
void setBookedFromUntil(const CAtcStation &otherStation) void setBookedFromUntil(const CAtcStation &otherStation)
{ {
this->setBookedFromUtc(otherStation.getBookedFromUtc()); this->setBookedFromUtc(otherStation.getBookedFromUtc());
this->setBookedUntilUtc(otherStation.getBookedUntilUtc()); this->setBookedUntilUtc(otherStation.getBookedUntilUtc());
} }
/*! //! \brief Booked now?
* \brief Booked now
* \return
*/
bool isBookedNow() const; bool isBookedNow() const;
/*! //! \brief Tuned in within 25KHz channel spacing
* \brief Tuned in within 25KHz channel spacing
*/
bool isComUnitTunedIn25KHz(const BlackMisc::Aviation::CComSystem &comUnit) const bool isComUnitTunedIn25KHz(const BlackMisc::Aviation::CComSystem &comUnit) const
{ {
return comUnit.isActiveFrequencyWithin25kHzChannel(this->getFrequency()); return comUnit.isActiveFrequencyWithin25kHzChannel(this->getFrequency());
@@ -336,117 +247,72 @@ namespace BlackMisc
*/ */
BlackMisc::PhysicalQuantities::CTime bookedWhen() const; BlackMisc::PhysicalQuantities::CTime bookedWhen() const;
/*! //! \brief Get ATIS
* \brief Get ATIS
* \return
*/
const CInformationMessage &getAtis() const { return m_atis; } const CInformationMessage &getAtis() const { return m_atis; }
/*! //! \brief Set ATIS
* \brief Set ATIS
*/
void setAtis(const CInformationMessage &atis) { this->m_atis = atis;} void setAtis(const CInformationMessage &atis) { this->m_atis = atis;}
/*! //! \brief Set ATIS Message
* \brief Set ATIS Message
*/
void setAtisMessage(const QString &atis) { this->m_atis.setMessage(atis); } void setAtisMessage(const QString &atis) { this->m_atis.setMessage(atis); }
/*! //! \brief Get METAR
* \brief Get METAR
*/
const CInformationMessage &getMetar() const { return m_metar; } const CInformationMessage &getMetar() const { return m_metar; }
/*! //! \brief Set METAR
* \brief Set METAR
*/
void setMetar(const CInformationMessage &metar) { this->m_metar = metar;} void setMetar(const CInformationMessage &metar) { this->m_metar = metar;}
/*! //! \brief Set METAR Message
* \brief Set METAR Message
*/
void setMetarMessage(const QString &metar) { this->m_metar.setMessage(metar); } void setMetarMessage(const QString &metar) { this->m_metar.setMessage(metar); }
/*! //! Set booked until
* Set booked until
*/
void setBookedUntilUtc(const QDateTime &until) { this->m_bookedUntilUtc = until; } void setBookedUntilUtc(const QDateTime &until) { this->m_bookedUntilUtc = until; }
/*! //! \brief Latitude
* \brief Latitude virtual const BlackMisc::Geo::CLatitude &latitude() const override
* \return
*/
virtual const BlackMisc::Geo::CLatitude &latitude() const
{ {
return this->getPosition().latitude(); return this->getPosition().latitude();
} }
/*! //! \brief Longitude
* \brief Longitude virtual const BlackMisc::Geo::CLongitude &longitude() const override
* \return
*/
virtual const BlackMisc::Geo::CLongitude &longitude() const
{ {
return this->getPosition().longitude(); return this->getPosition().longitude();
} }
/*! //! \copydoc CValueObject::getValueHash()
* \copydoc CValueObject::getValueHash() virtual uint getValueHash() const override;
*/
virtual uint getValueHash() const;
/*! //! \copydoc CValueObject::propertyByIndex()
* \coypdoc CValueObject::propertyByIndex() virtual QVariant propertyByIndex(int index) const override;
*/
virtual QVariant propertyByIndex(int index) const;
/*! //! \copydoc CValueObject::setPropertyByIndex(variant, index)
* \copydoc CValueObject::setPropertyByIndex(const QVariant &, int) virtual void setPropertyByIndex(const QVariant &variant, int index) override;
*/
virtual void setPropertyByIndex(const QVariant &variant, int index);
/*! //! \copydoc CValueObject::propertyByIndexAsString()
* \copydoc CValueObject::propertyByIndexAsString() virtual QString propertyByIndexAsString(int index, bool i18n = false) const override;
*/
virtual QString propertyByIndexAsString(int index, bool i18n = false) const;
/*! //! \brief Register metadata
* \brief Register metadata
*/
static void registerMetadata(); static void registerMetadata();
protected: protected:
/*! //! \copydoc CValueObject::convertToQString
* \brief Meaningful string representation
* \param i18n
* \return
*/
virtual QString convertToQString(bool i18n = false) const; virtual QString convertToQString(bool i18n = false) const;
/*! //! \copydoc CValueObject::getMetaTypeId
* \copydoc CValueObject::getMetaTypeId virtual int getMetaTypeId() const override;
*/
virtual int getMetaTypeId() const;
/*! //! \copydoc CValueObject::isA
* \copydoc CValueObject::isA virtual bool isA(int metaTypeId) const override;
*/
virtual bool isA(int metaTypeId) const;
/*! //! \copydoc CValueObject::compareImpl
* \copydoc CValueObject::compareImpl virtual int compareImpl(const CValueObject &other) const override;
*/
virtual int compareImpl(const CValueObject &other) const;
/*! //! \copydoc CValueObject::marshallToDbus()
* \copydoc CValueObject::marshallToDbus() virtual void marshallToDbus(QDBusArgument &argument) const override;
*/
virtual void marshallToDbus(QDBusArgument &argument) const;
/*! //! \copydoc CValueObject::unmarshallFromDbus()
* \copydoc CValueObject::unmarshallFromDbus() virtual void unmarshallFromDbus(const QDBusArgument &argument) override;
*/
virtual void unmarshallFromDbus(const QDBusArgument &argument);
private: private:
CCallsign m_callsign; CCallsign m_callsign;

View File

@@ -150,7 +150,7 @@ namespace BlackMisc
*/ */
static QString unifyCallsign(const QString &callsign); static QString unifyCallsign(const QString &callsign);
//! \representing icon //! \brief representing icon
static const QPixmap &convertToIcon(const CCallsign &callsign); static const QPixmap &convertToIcon(const CCallsign &callsign);
private: private:

View File

@@ -150,22 +150,16 @@ namespace BlackMisc
removeIf(BlackMisc::Predicates::MemberEqual<T>(key1, value1)); removeIf(BlackMisc::Predicates::MemberEqual<T>(key1, value1));
} }
public: // CValueObject overrides public:
/*! //! \copydoc CValueObject::toQVariant()
* \copydoc CValueObject::toQVariant() virtual QVariant toQVariant() const override { return QVariant::fromValue(derived()); }
*/
virtual QVariant toQVariant() const { return QVariant::fromValue(derived()); }
/*! //! copydoc CValueObject::getValueHash
* \brief Comparing containers by hash will only compare their addresses virtual uint getValueHash() const override { return qHash(&derived()); }
*/
virtual uint getValueHash() const { return qHash(&derived()); }
protected: // CValueObject overrides protected: // CValueObject overrides
/*! //! \copydoc CValueObject::convertToQString()
* \copydoc CValueObject::convertToQString() virtual QString convertToQString(bool i18n = false) const override
*/
virtual QString convertToQString(bool i18n = false) const
{ {
QString str; QString str;
// qualifying stringify with this-> to workaround bug in GCC 4.7.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56402 // qualifying stringify with this-> to workaround bug in GCC 4.7.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56402
@@ -174,25 +168,21 @@ namespace BlackMisc
return str += "}"; return str += "}";
} }
/*! //! \copydoc CValueObject::getMetaTypeId
* \copydoc CValueObject::getMetaTypeId virtual int getMetaTypeId() const override { return qMetaTypeId<C<T>>(); }
*/
virtual int getMetaTypeId() const { return qMetaTypeId<C<T>>(); }
/*! //! \copydoc CValueObject::isA override
* \copydoc CValueObject::isA virtual bool isA(int metaTypeId) const override
*/
virtual bool isA(int metaTypeId) const
{ {
if (metaTypeId == qMetaTypeId<C<T>>()) { return true; } if (metaTypeId == qMetaTypeId<C<T>>()) { return true; }
return CValueObject::isA(metaTypeId); return CValueObject::isA(metaTypeId);
} }
/*! //! \copydoc CValueObject::compareImpl()
* \copydoc CValueObject::compareImpl virtual int compareImpl(const CValueObject &other) const override
*/
virtual int compareImpl(const CValueObject &/*other*/) const
{ {
Q_UNUSED(other);
//const auto &o = static_cast<const CContainerBase &>(other); //const auto &o = static_cast<const CContainerBase &>(other);
//if (derived().size() < o.derived().size()) { return -1; } //if (derived().size() < o.derived().size()) { return -1; }
//if (derived().size() > o.derived().size()) { return 1; } //if (derived().size() > o.derived().size()) { return 1; }
@@ -204,14 +194,16 @@ namespace BlackMisc
return 0; return 0;
} }
virtual void marshallToDbus(QDBusArgument &argument) const //! \copydoc CValueObject::marshallToDbus
virtual void marshallToDbus(QDBusArgument &argument) const override
{ {
argument.beginArray(qMetaTypeId<T>()); argument.beginArray(qMetaTypeId<T>());
std::for_each(derived().cbegin(), derived().cend(), [ & ](const T & value) { argument << value; }); std::for_each(derived().cbegin(), derived().cend(), [ & ](const T & value) { argument << value; });
argument.endArray(); argument.endArray();
} }
virtual void unmarshallFromDbus(const QDBusArgument &argument) //! \copydoc CValueObject::unmarshallFromDbus
virtual void unmarshallFromDbus(const QDBusArgument &argument) override
{ {
argument.beginArray(); argument.beginArray();
while (!argument.atEnd()) { T value; argument >> value; derived().insert(value); } while (!argument.atEnd()) { T value; argument >> value; derived().insert(value); }

View File

@@ -124,7 +124,7 @@ namespace BlackMisc
//! \brief Unspecific info message //! \brief Unspecific info message
static CStatusMessage getInfoMessage(const QString &message); static CStatusMessage getInfoMessage(const QString &message);
//! \representing icon //! \brief representing icon
static const QPixmap &convertToIcon(const CStatusMessage &statusMessage); static const QPixmap &convertToIcon(const CStatusMessage &statusMessage);
protected: protected:

View File

@@ -46,12 +46,7 @@ namespace BlackMisc
return textStream; return textStream;
} }
/*! //! \brief Operator << when there is no debug stream
* \brief Operator << when there is no debug stream
* \param nodebug
* \param uc
* \return
*/
friend QNoDebug operator<<(QNoDebug nodebug, const CValueObject & /* uc */) friend QNoDebug operator<<(QNoDebug nodebug, const CValueObject & /* uc */)
{ {
return nodebug; return nodebug;
@@ -81,52 +76,22 @@ namespace BlackMisc
return ostr; return ostr;
} }
/*! //! \brief Unmarshalling operator >>, DBus to object
* \brief Unmarshalling operator >>, DBus to object
* \param argument
* \param uc
* \return
*/
friend const QDBusArgument &operator>>(const QDBusArgument &argument, CValueObject &uc); friend const QDBusArgument &operator>>(const QDBusArgument &argument, CValueObject &uc);
/*! //! \brief Marshalling operator <<, object to DBus
* \brief Marshalling operator <<, object to DBus
* \param argument
* \param pq
* \return
*/
friend QDBusArgument &operator<<(QDBusArgument &argument, const CValueObject &uc); friend QDBusArgument &operator<<(QDBusArgument &argument, const CValueObject &uc);
/*! //! \brief Operator == with value map
* \brief Operator == with value map
* \param valueMap
* \param uc
* \return
*/
friend bool operator==(const CValueMap &valueMap, const CValueObject &uc); friend bool operator==(const CValueMap &valueMap, const CValueObject &uc);
/*! //! \brief Operator != with value map
* \brief Operator != with value map
* \param valueMap
* \param uc
* \return
*/
friend bool operator!=(const CValueMap &valueMap, const CValueObject &uc); friend bool operator!=(const CValueMap &valueMap, const CValueObject &uc);
/*! //! \brief Operator == with value map
* \brief Operator == with value map
* \param uc
* \param valueMap
* \return
*/
friend bool operator==(const CValueObject &uc, const CValueMap &valueMap); friend bool operator==(const CValueObject &uc, const CValueMap &valueMap);
/*! //! \brief Operator != with value map
* \brief Operator != with value map
* \param uc
* \param valueMap
* \return
*/
friend bool operator!=(const CValueObject &uc, const CValueMap &valueMap); friend bool operator!=(const CValueObject &uc, const CValueMap &valueMap);
/*! /*!