feat!: Make Device::fChannels private

BREAKING CHANGE
This commit is contained in:
Dennis Klein 2023-04-05 13:34:45 +02:00
parent 8d155a0a47
commit d107e64f01
2 changed files with 3 additions and 16 deletions

View File

@ -77,9 +77,6 @@ Device::Device(ProgOptions& config, tools::Version version)
: Device(&config, version) : Device(&config, version)
{} {}
/// TODO: Remove this once Device::fChannels is no longer public
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Device::Device(ProgOptions* config, tools::Version version) Device::Device(ProgOptions* config, tools::Version version)
: fTransportFactory(nullptr) : fTransportFactory(nullptr)
, fInternalConfig(config ? nullptr : make_unique<ProgOptions>()) , fInternalConfig(config ? nullptr : make_unique<ProgOptions>())
@ -140,7 +137,6 @@ Device::Device(ProgOptions* config, tools::Version version)
fStateMachine.Start(); fStateMachine.Start();
} }
#pragma GCC diagnostic pop
void Device::InitWrapper() void Device::InitWrapper()
{ {
@ -749,15 +745,11 @@ void Device::ResetWrapper()
} }
} }
/// TODO: Remove this once Device::fChannels is no longer public
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Device::~Device() Device::~Device()
{ {
UnsubscribeFromNewTransition("device"); UnsubscribeFromNewTransition("device");
fStateMachine.StopHandlingStates(); fStateMachine.StopHandlingStates();
LOG(debug) << "Shutting down device " << fId; LOG(debug) << "Shutting down device " << fId;
} }
#pragma GCC diagnostic pop
} // namespace fair::mq } // namespace fair::mq

View File

@ -426,22 +426,17 @@ class Device
std::unordered_map<mq::Transport, std::shared_ptr<TransportFactory>> std::unordered_map<mq::Transport, std::shared_ptr<TransportFactory>>
fTransports; ///< Container for transports fTransports; ///< Container for transports
public: private:
[[deprecated("Use GetChannels() instead.")]]
std::unordered_map<std::string, std::vector<Channel>> fChannels; ///< Device channels std::unordered_map<std::string, std::vector<Channel>> fChannels; ///< Device channels
public:
std::unordered_map<std::string, std::vector<Channel>>& GetChannels() std::unordered_map<std::string, std::vector<Channel>>& GetChannels()
{ {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
return fChannels; return fChannels;
#pragma GCC diagnostic pop
} }
std::unordered_map<std::string, std::vector<Channel>> const& GetChannels() const std::unordered_map<std::string, std::vector<Channel>> const& GetChannels() const
{ {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
return fChannels; return fChannels;
#pragma GCC diagnostic pop
} }
std::unique_ptr<ProgOptions> fInternalConfig; ///< Internal program options configuration std::unique_ptr<ProgOptions> fInternalConfig; ///< Internal program options configuration