Do not use namespace using-directives. Use using-declarations instead.

This commit is contained in:
Thomas Basler 2022-09-13 21:35:51 +02:00
parent 66c28a2e6e
commit de33b9ff88
16 changed files with 26 additions and 22 deletions

View File

@ -9,8 +9,6 @@
#include <nRF24L01.h>
#include <queue>
using namespace std;
// number of fragments hold in buffer
#define FRAGMENT_BUFFER_SIZE 30
@ -57,7 +55,7 @@ public:
template <typename T>
T* enqueCommand()
{
_commandQueue.push(make_shared<T>());
_commandQueue.push(std::make_shared<T>());
return static_cast<T*>(_commandQueue.back().get());
}
@ -89,5 +87,5 @@ private:
bool _busyFlag = false;
queue<shared_ptr<CommandAbstract>> _commandQueue;
std::queue<std::shared_ptr<CommandAbstract>> _commandQueue;
};

View File

@ -68,7 +68,7 @@ void MqttSettingsClass::onMqttDisconnect(espMqttClientTypes::DisconnectReason re
void MqttSettingsClass::performConnect()
{
if (NetworkSettings.isConnected() && Configuration.get().Mqtt_Enabled) {
using namespace std::placeholders;
using std::placeholders::_1;
Serial.println(F("Connecting to MQTT..."));
const CONFIG_T& config = Configuration.get();
willTopic = getPrefix() + config.Mqtt_LwtTopic;
@ -136,7 +136,7 @@ void MqttSettingsClass::publishHass(String subtopic, String payload)
void MqttSettingsClass::init()
{
using namespace std::placeholders;
using std::placeholders::_1;
NetworkSettings.onEvent(std::bind(&MqttSettingsClass::NetworkEvent, this, _1));
createMqttClientObject();

View File

@ -19,7 +19,7 @@ NetworkSettingsClass::NetworkSettingsClass()
void NetworkSettingsClass::init()
{
using namespace std::placeholders;
using std::placeholders::_1;
WiFi.onEvent(std::bind(&NetworkSettingsClass::NetworkEvent, this, _1));
setupMode();

View File

@ -15,8 +15,6 @@ WebApiClass::WebApiClass()
void WebApiClass::init()
{
using namespace std::placeholders;
_server.addHandler(&_events);
_webApiDevInfo.init(&_server);

View File

@ -10,7 +10,7 @@
void WebApiDevInfoClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
_server = server;

View File

@ -10,7 +10,7 @@
void WebApiDtuClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
_server = server;

View File

@ -9,7 +9,7 @@
void WebApiEventlogClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
_server = server;

View File

@ -11,7 +11,12 @@
void WebApiFirmwareClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
using std::placeholders::_2;
using std::placeholders::_3;
using std::placeholders::_4;
using std::placeholders::_5;
using std::placeholders::_6;
_server = server;

View File

@ -12,7 +12,7 @@
void WebApiInverterClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
_server = server;

View File

@ -9,7 +9,7 @@
void WebApiLimitClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
_server = server;

View File

@ -12,7 +12,7 @@
void WebApiMqttClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
_server = server;

View File

@ -11,7 +11,7 @@
void WebApiNetworkClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
_server = server;

View File

@ -11,7 +11,7 @@
void WebApiNtpClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
_server = server;

View File

@ -16,7 +16,7 @@
void WebApiSysstatusClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
_server = server;

View File

@ -16,8 +16,6 @@ extern const uint8_t file_app_js_end[] asm("_binary_webapp_dist_js_app_js_gz_end
void WebApiWebappClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
_server = server;
_server->on("/", HTTP_GET, [](AsyncWebServerRequest* request) {

View File

@ -13,7 +13,12 @@ WebApiWsLiveClass::WebApiWsLiveClass()
void WebApiWsLiveClass::init(AsyncWebServer* server)
{
using namespace std::placeholders;
using std::placeholders::_1;
using std::placeholders::_2;
using std::placeholders::_3;
using std::placeholders::_4;
using std::placeholders::_5;
using std::placeholders::_6;
_server = server;
_server->on("/api/livedata/status", HTTP_GET, std::bind(&WebApiWsLiveClass::onLivedataStatus, this, _1));