From 846cb12430e9f875cd0454bcdd614275b055ab22 Mon Sep 17 00:00:00 2001 From: jerrrrycho Date: Sat, 10 Oct 2026 16:41:22 +0200 Subject: [PATCH] refactor(sonar): inherit base constructors instead of forwarding them (cpp:S5952) --- McZapkie/Oerlikon_ESt.h | 28 ++++++++----------------- McZapkie/hamulce.h | 45 ++++++++++++++++------------------------- network/message.h | 2 +- 3 files changed, 26 insertions(+), 49 deletions(-) diff --git a/McZapkie/Oerlikon_ESt.h b/McZapkie/Oerlikon_ESt.h index e336dc55..c8f896cc 100644 --- a/McZapkie/Oerlikon_ESt.h +++ b/McZapkie/Oerlikon_ESt.h @@ -74,7 +74,7 @@ class TPrzekladnik : public TReservoir // przekladnik (powtarzacz) std::shared_ptr BrakeRes; std::shared_ptr Next; - TPrzekladnik() : TReservoir() {}; + using TReservoir::TReservoir; virtual void Update(double dt); }; @@ -82,7 +82,7 @@ class TRura : public TPrzekladnik // nieprzekladnik, rura laczaca { public: - TRura() : TPrzekladnik() {}; + using TPrzekladnik::TPrzekladnik; double P(void) override; void Update(double dt) override; }; @@ -116,9 +116,7 @@ class TRapid : public TPrzekladnik { void SetRapidParams(double mult, double size); void SetRapidStatus(bool rs); void Update(double dt) override; - inline TRapid() : - TPrzekladnik() - {} + using TPrzekladnik::TPrzekladnik; }; // AL2 @@ -130,9 +128,7 @@ class TPrzekCiagly : public TPrzekladnik { public: void SetMult(double m); void Update(double dt) override; - inline TPrzekCiagly() : - TPrzekladnik() - {} + using TPrzekladnik::TPrzekladnik; }; // podwojny zawor zwrotny @@ -144,18 +140,14 @@ class TPrzek_PZZ : public TPrzekladnik { public: void SetLBP(double P); void Update(double dt) override; - inline TPrzek_PZZ() : - TPrzekladnik() - {} + using TPrzekladnik::TPrzekladnik; }; class TPrzekZalamany : public TPrzekladnik // Knicksventil { public: - TPrzekZalamany() : - TPrzekladnik() - {} + using TPrzekladnik::TPrzekladnik; }; // przy napelnianiu - rura, przy hamowaniu - upust @@ -167,9 +159,7 @@ class TPrzekED : public TRura { public: void SetP(double P); void Update(double dt) override; - inline TPrzekED() : - TRura() - {} + using TRura::TRura; }; class TNESt3 : public TBrake { @@ -203,9 +193,7 @@ class TNESt3 : public TBrake { double LBP = 0.0; // cisnienie hamulca pomocniczego public: - inline TNESt3(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : - TBrake( i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) - {} + using TBrake::TBrake; void Init( double const PP, double const HPP, double const LPP, double const BP, int const BDF ) override; double GetPF( double const PP, double const dt, double const Vel ) override; // przeplyw miedzy komora wstepna i PG void EStParams(double i_crc) const; // parametry charakterystyczne dla ESt diff --git a/McZapkie/hamulce.h b/McZapkie/hamulce.h index 62c89bc0..3074a2e7 100644 --- a/McZapkie/hamulce.h +++ b/McZapkie/hamulce.h @@ -299,7 +299,7 @@ class TBrakeCyl : public TReservoir /// Cylinder pressure in bar. double P() override; /// Default constructor. - TBrakeCyl() : TReservoir() {}; + using TReservoir::TReservoir; }; /// @@ -558,7 +558,7 @@ class TWest : public TBrake void SetLP(double const TM, double const LM, double const TBP) override; // parametry przystawki wazacej /// Constructs the distributor by forwarding all parameters to TBrake. - inline TWest(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TBrake(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {} + using TBrake::TBrake; }; /// @@ -636,7 +636,7 @@ class TESt3 : public TESt double GetPF(double const PP, double const dt, double const Vel) override; // przeplyw miedzy komora wstepna i PG /// Constructs the ESt3 distributor. - inline TESt3(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TESt(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {} + using TESt::TESt; }; /// @@ -742,7 +742,7 @@ class TLSt : public TESt4R void SetED(double const EDstate) override; // stan hamulca ED do luzowania /// Constructs the LSt distributor. - inline TLSt(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TESt4R(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {} + using TESt4R::TESt4R; }; /// @@ -825,7 +825,7 @@ class TEStEP2 : public TLSt void virtual EPCalc(double dt); /// Constructs the EP2 distributor. - inline TEStEP2(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TLSt(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {} + using TLSt::TLSt; }; /// @@ -844,9 +844,7 @@ class TEStEP1 : public TEStEP2 void SetEPS(double const nEPS) override; // stan hamulca EP /// Constructs the EP1 distributor. - inline TEStEP1(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TEStEP2(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) - { - } + using TEStEP2::TEStEP2; }; /// @@ -1112,7 +1110,7 @@ class TFV4a : public TDriverHandle void Init(double Press) override; /// Default constructor. - inline TFV4a() : TDriverHandle() {} + using TDriverHandle::TDriverHandle; }; /// @@ -1163,7 +1161,7 @@ class TFV4aM : public TDriverHandle /// Returns the regulator pressure (5 + TP*0.08 + RedAdj). double GetRP() override; /// Default constructor. - inline TFV4aM() : TDriverHandle() {} + using TDriverHandle::TDriverHandle; }; /// @@ -1217,8 +1215,7 @@ class TMHZ_EN57 : public TDriverHandle /// Configures handle parameters (auto/manual overcharge, over-pressure, overcharge dynamics). void SetParams(bool AO, bool MO, double OverP, double, double OMP, double OPD) override; /// Default constructor. - inline TMHZ_EN57(void) : TDriverHandle() {} -}; + using TDriverHandle::TDriverHandle;}; /// /// MHZ_K5P — Knorr 5-position combined brake handle. @@ -1269,8 +1266,7 @@ class TMHZ_K5P : public TDriverHandle void SetParams(bool AO, bool MO, double, double, double OMP, double OPD) override; /// Default constructor. - inline TMHZ_K5P(void) : TDriverHandle() {} -}; + using TDriverHandle::TDriverHandle;}; /// /// MHZ_6P — 6-position combined brake handle (similar logic to K5P with one more detent). @@ -1321,8 +1317,7 @@ class TMHZ_6P : public TDriverHandle void SetParams(bool AO, bool MO, double, double, double OMP, double OPD) override; /// Default constructor. - inline TMHZ_6P(void) : TDriverHandle() {} -}; + using TDriverHandle::TDriverHandle;}; /* FBS2= class(TTDriverHandle) private @@ -1461,8 +1456,7 @@ class TSt113 : public TH14K1 void Init(double Press) override; /// Default constructor. - inline TSt113(void) : TH14K1() {} -}; + using TH14K1::TH14K1;}; /// /// Test handle — minimal implementation used during development for verifying @@ -1482,8 +1476,7 @@ class Ttest : public TDriverHandle void Init(double Press) override; /// Default constructor. - inline Ttest(void) : TDriverHandle() {} -}; + using TDriverHandle::TDriverHandle;}; /// /// FD1 auxiliary brake handle — directly drives the cylinder pressure between @@ -1513,8 +1506,7 @@ class TFD1 : public TDriverHandle // procedure Init(press: real; MaxBP: real); overload; /// Default constructor. - inline TFD1(void) : TDriverHandle() {} -}; + using TDriverHandle::TDriverHandle;}; /// /// H1405 — Knorr auxiliary brake handle (continuous, independent brake). @@ -1538,8 +1530,7 @@ class TH1405 : public TDriverHandle // procedure Init(press: real; MaxBP: real); overload; /// Default constructor. - inline TH1405(void) : TDriverHandle() {} -}; + using TDriverHandle::TDriverHandle;}; /// /// FVel6 — combined EP + pneumatic brake handle (Czech, 6+1 positions). @@ -1572,8 +1563,7 @@ class TFVel6 : public TDriverHandle void Init(double Press) override; /// Default constructor. - inline TFVel6(void) : TDriverHandle() {} -}; + using TDriverHandle::TDriverHandle;}; /// /// FVE408 — newer combined EP + pneumatic brake handle (10 positions). @@ -1607,8 +1597,7 @@ class TFVE408 : public TDriverHandle void Init(double Press) override; /// Default constructor. - inline TFVE408(void) : TDriverHandle() {} -}; + using TDriverHandle::TDriverHandle;}; /// /// Pneumatic flow rate from one pressure to another through an orifice of area S. diff --git a/network/message.h b/network/message.h index b6a1bc9d..8fbdfd64 100644 --- a/network/message.h +++ b/network/message.h @@ -50,7 +50,7 @@ struct server_hello : public message struct request_command : public message { - request_command(type_e type) : message(type) {} + using message::message; request_command() : message(REQUEST_COMMAND) {} command_queue::commands_map commands;