Use nested namespaces (C++17 feature)

This commit is contained in:
Mat Sutcliffe
2021-09-15 21:44:54 +01:00
parent 3f2e5b0b69
commit 57d32da826
1345 changed files with 146075 additions and 150376 deletions

View File

@@ -19,116 +19,113 @@
#include <QMap>
#include <QReadWriteLock>
namespace BlackMisc
namespace BlackMisc::Simulation
{
namespace Simulation
//! Direct in memory access to interpolation setup, normally implemented by simulator
class BLACKMISC_EXPORT IInterpolationSetupProvider : public IProvider
{
//! Direct in memory access to interpolation setup, normally implemented by simulator
class BLACKMISC_EXPORT IInterpolationSetupProvider : public IProvider
{
public:
using SetupsPerCallsign = QMap<Aviation::CCallsign, CInterpolationAndRenderingSetupPerCallsign>; //!< setups per callsign
public:
using SetupsPerCallsign = QMap<Aviation::CCallsign, CInterpolationAndRenderingSetupPerCallsign>; //!< setups per callsign
//! Get the setup for callsign, if not existing the global setup
//! \threadsafe
CInterpolationAndRenderingSetupPerCallsign getInterpolationSetupPerCallsignOrDefault(const Aviation::CCallsign &callsign) const;
//! Get the setup for callsign, if not existing the global setup
//! \threadsafe
CInterpolationAndRenderingSetupPerCallsign getInterpolationSetupPerCallsignOrDefault(const Aviation::CCallsign &callsign) const;
//! Get all setups per callsign
//! \threadsafe
CInterpolationSetupList getInterpolationSetupsPerCallsign() const;
//! Get all setups per callsign
//! \threadsafe
CInterpolationSetupList getInterpolationSetupsPerCallsign() const;
//! Get all setups per callsign
//! \threadsafe
bool hasSetupsPerCallsign() const;
//! Get all setups per callsign
//! \threadsafe
bool hasSetupsPerCallsign() const;
//! Set all setups per callsign
//! \threadsafe
bool setInterpolationSetupsPerCallsign(const CInterpolationSetupList &setups, bool ignoreSameAsGlobal = true);
//! Set all setups per callsign
//! \threadsafe
bool setInterpolationSetupsPerCallsign(const CInterpolationSetupList &setups, bool ignoreSameAsGlobal = true);
//! The global setup
//! \threadsafe
virtual CInterpolationAndRenderingSetupGlobal getInterpolationSetupGlobal() const;
//! The global setup
//! \threadsafe
virtual CInterpolationAndRenderingSetupGlobal getInterpolationSetupGlobal() const;
//! All callsigns marked to be logged
//! \threadsafe
Aviation::CCallsignSet getLogCallsigns() const;
//! All callsigns marked to be logged
//! \threadsafe
Aviation::CCallsignSet getLogCallsigns() const;
//! Is callsign marked for logging
//! \threadsafe
bool isLogCallsign(const Aviation::CCallsign &callsign) const;
//! Is callsign marked for logging
//! \threadsafe
bool isLogCallsign(const Aviation::CCallsign &callsign) const;
//! Set mode as string
//! \threadsafe
bool setInterpolationMode(const QString &modeAsString, const Aviation::CCallsign &callsign);
//! Set mode as string
//! \threadsafe
bool setInterpolationMode(const QString &modeAsString, const Aviation::CCallsign &callsign);
//! Enable/disable logging
//! \threadsafe
bool setLogInterpolation(bool log, const Aviation::CCallsign &callsign);
//! Enable/disable logging
//! \threadsafe
bool setLogInterpolation(bool log, const Aviation::CCallsign &callsign);
protected:
//! Set the global setup
//! \threadsafe
virtual bool setInterpolationSetupGlobal(const CInterpolationAndRenderingSetupGlobal &setup);
protected:
//! Set the global setup
//! \threadsafe
virtual bool setInterpolationSetupGlobal(const CInterpolationAndRenderingSetupGlobal &setup);
//! Insert specialized setup per callsign
//! \threadsafe
virtual bool setInterpolationSetupPerCallsign(const CInterpolationAndRenderingSetupPerCallsign &setup, const Aviation::CCallsign &callsign, bool removeGlobalSetup = true);
//! Insert specialized setup per callsign
//! \threadsafe
virtual bool setInterpolationSetupPerCallsign(const CInterpolationAndRenderingSetupPerCallsign &setup, const Aviation::CCallsign &callsign, bool removeGlobalSetup = true);
//! Log/un-log given callsign
//! \threadsafe
void setLogCallsign(bool log, const Aviation::CCallsign &callsign);
//! Log/un-log given callsign
//! \threadsafe
void setLogCallsign(bool log, const Aviation::CCallsign &callsign);
//! Remove specialized setup per callsign
bool removeInterpolationSetupPerCallsign(const Aviation::CCallsign &callsign);
//! Remove specialized setup per callsign
bool removeInterpolationSetupPerCallsign(const Aviation::CCallsign &callsign);
//! Clear all interpolation log callsigns
//! \threadsafe
void clearInterpolationLogCallsigns();
//! Clear all interpolation log callsigns
//! \threadsafe
void clearInterpolationLogCallsigns();
//! Clear all setups
//! \threadsafe
int clearInterpolationSetupsPerCallsign();
//! Clear all setups
//! \threadsafe
int clearInterpolationSetupsPerCallsign();
//! Log any callsign?
//! \threadsafe
bool logAnyCallsign() const;
//! Log any callsign?
//! \threadsafe
bool logAnyCallsign() const;
//! The setups per callsign
//! \threadsafe
SetupsPerCallsign getSetupsPerCallsign() const;
//! The setups per callsign
//! \threadsafe
SetupsPerCallsign getSetupsPerCallsign() const;
//! Pseudo signal, override to emit signal
virtual void emitInterpolationSetupChanged() {}
//! Pseudo signal, override to emit signal
virtual void emitInterpolationSetupChanged() {}
private:
CInterpolationAndRenderingSetupGlobal m_globalSetup;
SetupsPerCallsign m_setupsPerCallsign;
mutable QReadWriteLock m_lockSetup; //!< lock clients
};
private:
CInterpolationAndRenderingSetupGlobal m_globalSetup;
SetupsPerCallsign m_setupsPerCallsign;
mutable QReadWriteLock m_lockSetup; //!< lock clients
};
//! Class which can be directly used to access an \sa IInterpolationSetupProvider object
class BLACKMISC_EXPORT CInterpolationSetupAware : public IProviderAware<IInterpolationSetupProvider>
{
virtual void anchor();
//! Class which can be directly used to access an \sa IInterpolationSetupProvider object
class BLACKMISC_EXPORT CInterpolationSetupAware : public IProviderAware<IInterpolationSetupProvider>
{
virtual void anchor();
public:
//! \copydoc IInterpolationSetupProvider::getInterpolationSetupPerCallsignOrDefault
CInterpolationAndRenderingSetupPerCallsign getInterpolationSetupPerCallsignOrDefault(const Aviation::CCallsign &callsign) const;
public:
//! \copydoc IInterpolationSetupProvider::getInterpolationSetupPerCallsignOrDefault
CInterpolationAndRenderingSetupPerCallsign getInterpolationSetupPerCallsignOrDefault(const Aviation::CCallsign &callsign) const;
//! \copydoc IInterpolationSetupProvider::getInterpolationSetupGlobal
CInterpolationAndRenderingSetupGlobal getInterpolationSetupGlobal() const;
//! \copydoc IInterpolationSetupProvider::getInterpolationSetupGlobal
CInterpolationAndRenderingSetupGlobal getInterpolationSetupGlobal() const;
protected:
//! Default constructor
CInterpolationSetupAware() {}
protected:
//! Default constructor
CInterpolationSetupAware() {}
//! Constructor
CInterpolationSetupAware(IInterpolationSetupProvider *setupProvider) : IProviderAware(setupProvider) { }
//! Constructor
CInterpolationSetupAware(IInterpolationSetupProvider *setupProvider) : IProviderAware(setupProvider) { }
//! Provider
void setInterpolationSetupProvider(IInterpolationSetupProvider *provider) { this->setProvider(provider); }
};
} // namespace
//! Provider
void setInterpolationSetupProvider(IInterpolationSetupProvider *provider) { this->setProvider(provider); }
};
} // namespace
Q_DECLARE_INTERFACE(BlackMisc::Simulation::IInterpolationSetupProvider, "org.swift-project.blackmisc::network::iinterpolationsetupprovider")