mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 15:45:42 +08:00
refs #328 CAircraftParts value classes
This commit is contained in:
committed by
Klaus Basan
parent
16042c1fb2
commit
0a46a4a0bd
49
src/blackmisc/aviation/aircraftpartslist.cpp
Normal file
49
src/blackmisc/aviation/aircraftpartslist.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
/* Copyright (C) 2014
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "aircraftpartslist.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
CAircraftPartsList::CAircraftPartsList() { }
|
||||
|
||||
CAircraftPartsList::CAircraftPartsList(const CSequence<CAircraftParts> &other) :
|
||||
CSequence<CAircraftParts>(other)
|
||||
{ }
|
||||
|
||||
CAircraftPartsList CAircraftPartsList::findBefore(const QDateTime &dateTime) const
|
||||
{
|
||||
return findBy([&](const CAircraftParts & parts)
|
||||
{
|
||||
return parts.getTimestamp() < dateTime;
|
||||
});
|
||||
}
|
||||
|
||||
void CAircraftPartsList::removeBefore(const QDateTime &dateTime)
|
||||
{
|
||||
removeIf([&](const CAircraftParts &parts)
|
||||
{
|
||||
return parts.getTimestamp() < dateTime;
|
||||
});
|
||||
}
|
||||
|
||||
void CAircraftPartsList::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<BlackMisc::CSequence<CAircraftParts>>();
|
||||
qDBusRegisterMetaType<BlackMisc::CSequence<CAircraftParts>>();
|
||||
qRegisterMetaType<BlackMisc::CCollection<CAircraftParts>>();
|
||||
qDBusRegisterMetaType<BlackMisc::CCollection<CAircraftParts>>();
|
||||
qRegisterMetaType<CAircraftPartsList>();
|
||||
qDBusRegisterMetaType<CAircraftPartsList>();
|
||||
registerMetaValueType<CAircraftPartsList>();
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
Reference in New Issue
Block a user