17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-07 19:14:46 +01:00

refactor(sonar): pass expensive-to-copy parameters by const reference (cpp:S1238)

Signatures declared in files touched by PR 206 (Driver.h, EU07.cpp) and
virtual overrides are left unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 17:16:40 +02:00
parent 0a7c42c4a9
commit 5d33d89225
26 changed files with 42 additions and 42 deletions

View File

@@ -2287,7 +2287,7 @@ class TMoverParameters
bool AIHintPantUpIfIdle{true}; // whether raise both pantographs if idling for a while bool AIHintPantUpIfIdle{true}; // whether raise both pantographs if idling for a while
double AIHintLocalBrakeAccFactor{1.05}; // suggested acceleration weight for local brake operation double AIHintLocalBrakeAccFactor{1.05}; // suggested acceleration weight for local brake operation
TMoverParameters(double VelInitial, std::string TypeNameInit, std::string NameInit, int Cab); TMoverParameters(double VelInitial, std::string const &TypeNameInit, std::string const &NameInit, int Cab);
// obsługa sprzęgów // obsługa sprzęgów
static double CouplerDist(TMoverParameters const *Left, TMoverParameters const *Right); static double CouplerDist(TMoverParameters const *Left, TMoverParameters const *Right);
static double Distance(const TLocation &Loc1, const TLocation &Loc2, const TDimension &Dim1, const TDimension &Dim2); static double Distance(const TLocation &Loc1, const TLocation &Loc2, const TDimension &Dim1, const TDimension &Dim2);
@@ -2331,12 +2331,12 @@ class TMoverParameters
double EngineMaxRPM() const; double EngineMaxRPM() const;
/*! przesylanie komend sterujacych*/ /*! przesylanie komend sterujacych*/
bool SendCtrlToNext(std::string const CtrlCommand, double const ctrlvalue, double const dir, int const Couplertype = coupling::control); bool SendCtrlToNext(std::string const &CtrlCommand, double const ctrlvalue, double const dir, int const Couplertype = coupling::control);
bool SetInternalCommand(std::string NewCommand, double NewValue1, double NewValue2, int const Couplertype = coupling::control); bool SetInternalCommand(std::string const &NewCommand, double NewValue1, double NewValue2, int const Couplertype = coupling::control);
double GetExternalCommand(std::string &Command) const; double GetExternalCommand(std::string &Command) const;
bool RunCommand(std::string Command, double CValue1, double CValue2, int const Couplertype = coupling::control); bool RunCommand(std::string const &Command, double CValue1, double CValue2, int const Couplertype = coupling::control);
bool RunInternalCommand(); bool RunInternalCommand();
void PutCommand(std::string NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation); void PutCommand(std::string const &NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation);
bool CabActivisation(bool const Enforce = false); bool CabActivisation(bool const Enforce = false);
bool CabDeactivisation(bool const Enforce = false); bool CabDeactivisation(bool const Enforce = false);
bool CabActivisationAuto(bool const Enforce = false); bool CabActivisationAuto(bool const Enforce = false);
@@ -2533,7 +2533,7 @@ class TMoverParameters
bool ChangeOffsetH(double DeltaOffset); bool ChangeOffsetH(double DeltaOffset);
/*funkcje ladujace pliki opisujace pojazd*/ /*funkcje ladujace pliki opisujace pojazd*/
bool LoadFIZ(std::string chkpath); // Q 20160717 bool LoadChkFile(std::string chkpath); bool LoadFIZ(std::string const &chkpath); // Q 20160717 bool LoadChkFile(std::string chkpath);
bool CheckLocomotiveParameters(bool ReadyFlag, int Dir); bool CheckLocomotiveParameters(bool ReadyFlag, int Dir);
std::string EngineDescription(int what) const; std::string EngineDescription(int what) const;
@@ -2569,7 +2569,7 @@ class TMoverParameters
void LoadFIZ_LightsList(std::string const &Input); void LoadFIZ_LightsList(std::string const &Input);
void LoadFIZ_DimmerList(std::string const &Input); void LoadFIZ_DimmerList(std::string const &Input);
void LoadFIZ_CompressorList(std::string const &Input); void LoadFIZ_CompressorList(std::string const &Input);
void LoadFIZ_PowerParamsDecode(TPowerParameters &Powerparameters, std::string const Prefix, std::string const &Input); void LoadFIZ_PowerParamsDecode(TPowerParameters &Powerparameters, std::string const &Prefix, std::string const &Input);
TPowerType LoadFIZ_PowerDecode(std::string const &Power) const; TPowerType LoadFIZ_PowerDecode(std::string const &Power) const;
TPowerSource LoadFIZ_SourceDecode(std::string const &Source) const; TPowerSource LoadFIZ_SourceDecode(std::string const &Source) const;
TEngineType LoadFIZ_EngineDecode(std::string const &Engine) const; TEngineType LoadFIZ_EngineDecode(std::string const &Engine) const;

View File

@@ -460,7 +460,7 @@ double TMoverParameters::Current(double n, double U)
// ************************************************************************************************* // *************************************************************************************************
// główny konstruktor // główny konstruktor
// ************************************************************************************************* // *************************************************************************************************
TMoverParameters::TMoverParameters(double VelInitial, std::string TypeNameInit, std::string NameInit, int Cab) : TypeName(TypeNameInit), Name(NameInit), CabOccupied(Cab) TMoverParameters::TMoverParameters(double VelInitial, std::string const &TypeNameInit, std::string const &NameInit, int Cab) : TypeName(TypeNameInit), Name(NameInit), CabOccupied(Cab)
{ {
WriteLog("------------------------------------------------------"); WriteLog("------------------------------------------------------");
WriteLog("init default physic values for " + NameInit + ", [" + TypeNameInit + "]"); WriteLog("init default physic values for " + NameInit + ", [" + TypeNameInit + "]");
@@ -9607,7 +9607,7 @@ void TMoverParameters::BrakeSubsystemDecode()
// TDynamicObject::Init() // TDynamicObject::Init()
// Po niej wykonywana jest CreateBrakeSys(), ktora jest odpowiednikiem CheckLocomotiveParameters() // Po niej wykonywana jest CreateBrakeSys(), ktora jest odpowiednikiem CheckLocomotiveParameters()
// ************************************************************************************************* // *************************************************************************************************
bool TMoverParameters::LoadFIZ(std::string chkpath) bool TMoverParameters::LoadFIZ(std::string const &chkpath)
{ {
chkPath = chkpath; // assign class path for reloading chkPath = chkpath; // assign class path for reloading
@@ -11547,7 +11547,7 @@ void TMoverParameters::LoadFIZ_CompressorList(std::string const &Input)
extract_value(CompressorListDefPos, "Default", Input, ""); extract_value(CompressorListDefPos, "Default", Input, "");
} }
void TMoverParameters::LoadFIZ_PowerParamsDecode(TPowerParameters &Powerparameters, std::string const Prefix, std::string const &Line) void TMoverParameters::LoadFIZ_PowerParamsDecode(TPowerParameters &Powerparameters, std::string const &Prefix, std::string const &Line)
{ {
switch (Powerparameters.SourceType) switch (Powerparameters.SourceType)
@@ -12106,7 +12106,7 @@ bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int /*Dir*/)
// Q: 20160714 // Q: 20160714
// Wstawia komendę z parametrem, od sprzęgu i w lokalizacji do pojazdu // Wstawia komendę z parametrem, od sprzęgu i w lokalizacji do pojazdu
// ************************************************************************************************* // *************************************************************************************************
void TMoverParameters::PutCommand(std::string NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation) void TMoverParameters::PutCommand(std::string const &NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation)
{ {
CommandLast = NewCommand; // zapamiętanie komendy CommandLast = NewCommand; // zapamiętanie komendy
@@ -12131,7 +12131,7 @@ double TMoverParameters::GetExternalCommand(std::string &Command) const
// Q: 20160714 // Q: 20160714
// Ustawienie komendy wraz z parametrami // Ustawienie komendy wraz z parametrami
// ************************************************************************************************* // *************************************************************************************************
bool TMoverParameters::SetInternalCommand(std::string NewCommand, double NewValue1, double NewValue2, int const Couplertype) bool TMoverParameters::SetInternalCommand(std::string const &NewCommand, double NewValue1, double NewValue2, int const Couplertype)
{ {
bool SIC; bool SIC;
if (CommandIn.Command == NewCommand && CommandIn.Value1 == NewValue1 && CommandIn.Value2 == NewValue2 && CommandIn.Coupling == Couplertype) if (CommandIn.Command == NewCommand && CommandIn.Value1 == NewValue1 && CommandIn.Value2 == NewValue2 && CommandIn.Coupling == Couplertype)
@@ -12153,7 +12153,7 @@ bool TMoverParameters::SetInternalCommand(std::string NewCommand, double NewValu
// Q: 20160714 // Q: 20160714
// wysyłanie komendy w kierunku dir (1=przód, -1=tył) do kolejnego pojazdu (jednego) // wysyłanie komendy w kierunku dir (1=przód, -1=tył) do kolejnego pojazdu (jednego)
// ************************************************************************************************* // *************************************************************************************************
bool TMoverParameters::SendCtrlToNext(std::string const CtrlCommand, double const ctrlvalue, double const dir, int const Couplertype) bool TMoverParameters::SendCtrlToNext(std::string const &CtrlCommand, double const ctrlvalue, double const dir, int const Couplertype)
{ {
bool OK; bool OK;
int d; // numer sprzęgu w kierunku którego wysyłamy int d; // numer sprzęgu w kierunku którego wysyłamy
@@ -12193,7 +12193,7 @@ bool TMoverParameters::SendCtrlToNext(std::string const CtrlCommand, double cons
// Komenda musi być zdefiniowana tutaj, a jeśli się wywołuje funkcję, to ona nie może // Komenda musi być zdefiniowana tutaj, a jeśli się wywołuje funkcję, to ona nie może
// sama przesyłać do kolejnych pojazdów. Należy też się zastanowić, czy dla uzyskania // sama przesyłać do kolejnych pojazdów. Należy też się zastanowić, czy dla uzyskania
// jakiejś zmiany (np. IncMainCtrl) lepiej wywołać funkcję, czy od razu wysłać komendę. // jakiejś zmiany (np. IncMainCtrl) lepiej wywołać funkcję, czy od razu wysłać komendę.
bool TMoverParameters::RunCommand(std::string Command, double CValue1, double CValue2, int const Couplertype) bool TMoverParameters::RunCommand(std::string const &Command, double CValue1, double CValue2, int const Couplertype)
{ {
bool OK{false}; bool OK{false};

View File

@@ -108,7 +108,7 @@ public:
offset() const; offset() const;
// sound source name setter/getter // sound source name setter/getter
void void
name( std::string Name ); name( std::string const &Name );
std::string const & std::string const &
name() const; name() const;
// playback starting point shift setter/getter // playback starting point shift setter/getter
@@ -252,7 +252,7 @@ inline TDynamicObject const * sound_source::owner() const { return m_owner; }
inline void sound_source::offset( glm::vec3 const Offset ) { m_offset = Offset; } inline void sound_source::offset( glm::vec3 const Offset ) { m_offset = Offset; }
inline glm::vec3 const & sound_source::offset() const { return m_offset; } inline glm::vec3 const & sound_source::offset() const { return m_offset; }
// sound source name setter/getter // sound source name setter/getter
inline void sound_source::name( std::string Name ) { m_name = Name; } inline void sound_source::name( std::string const &Name ) { m_name = Name; }
inline std::string const & sound_source::name() const { return m_name; } inline std::string const & sound_source::name() const { return m_name; }
// playback starting point shift setter/getter // playback starting point shift setter/getter
inline void sound_source::start( float const Offset ) { m_startoffset = Offset; } inline void sound_source::start( float const Offset ) { m_startoffset = Offset; }

View File

@@ -7,7 +7,7 @@
#include "utilities/Logs.h" #include "utilities/Logs.h"
#ifdef __unix__ #ifdef __unix__
piped_proc::piped_proc(std::string cmd, bool write) piped_proc::piped_proc(std::string const &cmd, bool write)
{ {
file = popen(cmd.c_str(), write ? "w" : "r"); file = popen(cmd.c_str(), write ? "w" : "r");
} }
@@ -34,7 +34,7 @@ size_t piped_proc::write(unsigned char const *buf, size_t len)
return fwrite(buf, 1, len, file); return fwrite(buf, 1, len, file);
} }
#elif _WIN32 #elif _WIN32
piped_proc::piped_proc(std::string cmd, bool write) piped_proc::piped_proc(std::string const &cmd, bool write)
{ {
PROCESS_INFORMATION process; PROCESS_INFORMATION process;
STARTUPINFO siStartInfo; STARTUPINFO siStartInfo;

View File

@@ -23,7 +23,7 @@ HANDLE pipe_wr = nullptr;
#endif #endif
public: public:
explicit piped_proc(std::string cmd, bool write = false); explicit piped_proc(std::string const &cmd, bool write = false);
size_t read(unsigned char *buf, size_t len); size_t read(unsigned char *buf, size_t len);
size_t write(unsigned char const *buf, size_t len); size_t write(unsigned char const *buf, size_t len);
~piped_proc(); ~piped_proc();

View File

@@ -368,7 +368,7 @@ gl::program::program()
**this = glCreateProgram(); **this = glCreateProgram();
} }
gl::program::program(std::vector<std::reference_wrapper<const gl::shader>> shaders) : program() gl::program::program(std::vector<std::reference_wrapper<const gl::shader>> const &shaders) : program()
{ {
for (const gl::shader &s : shaders) for (const gl::shader &s : shaders)
attach(s); attach(s);

View File

@@ -85,7 +85,7 @@ namespace gl
{ {
public: public:
program(); program();
explicit program(std::vector<std::reference_wrapper<const gl::shader>>); explicit program(std::vector<std::reference_wrapper<const gl::shader>> const &);
~program(); ~program();
using bindable::bind; using bindable::bind;

View File

@@ -124,7 +124,7 @@ gamepad_input::poll() {
} }
void void
gamepad_input::bind( std::vector< std::reference_wrapper<user_command> > const &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point ) const { gamepad_input::bind( std::vector< std::reference_wrapper<user_command> > const &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const &Point ) const {
for( auto const &bindingtarget : Targets ) { for( auto const &bindingtarget : Targets ) {
// grab command(s) associated with the input pin // grab command(s) associated with the input pin

View File

@@ -77,7 +77,7 @@ private:
using inputaxis_sequence = std::vector<input_axis>; using inputaxis_sequence = std::vector<input_axis>;
// methods // methods
bool recall_bindings(); bool recall_bindings();
void bind( std::vector< std::reference_wrapper<user_command> > const &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point ) const; void bind( std::vector< std::reference_wrapper<user_command> > const &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const &Point ) const;
void on_button( int const Button, int const Action ); void on_button( int const Button, int const Action );
void process_axes(); void process_axes();

View File

@@ -218,7 +218,7 @@ std::tuple<double, double, command_queue::commands_map> network::client::get_nex
} }
} }
void network::client::send_commands(command_queue::commands_map commands) const void network::client::send_commands(command_queue::commands_map const &commands) const
{ {
if (!conn || conn->state == connection::DEAD || commands.empty()) if (!conn || conn->state == connection::DEAD || commands.empty())
return; return;

View File

@@ -98,7 +98,7 @@ namespace network
public: public:
void update(); void update();
std::tuple<double, double, command_queue::commands_map> get_next_delta(int counter); std::tuple<double, double, command_queue::commands_map> get_next_delta(int counter);
void send_commands(command_queue::commands_map commands) const; void send_commands(command_queue::commands_map const &commands) const;
int get_frame_counter() const { int get_frame_counter() const {
return static_cast<int>(resume_frame_counter); return static_cast<int>(resume_frame_counter);
} }

View File

@@ -24,7 +24,7 @@ public:
update_frustum() { update_frustum( m_projection, m_modelview ); } update_frustum() { update_frustum( m_projection, m_modelview ); }
inline inline
void void
update_frustum(glm::mat4 frustumtest_proj) { update_frustum(glm::mat4 const &frustumtest_proj) {
update_frustum(frustumtest_proj, m_modelview); } update_frustum(frustumtest_proj, m_modelview); }
void void
update_frustum( glm::mat4 const &Projection, glm::mat4 const &Modelview ); update_frustum( glm::mat4 const &Projection, glm::mat4 const &Modelview );

View File

@@ -226,7 +226,7 @@ void sn_utils::s_uint8(std::ostream &s, uint8_t v)
s.write((char*)&v, 1); s.write((char*)&v, 1);
} }
void sn_utils::s_str(std::ostream &s, std::string v) void sn_utils::s_str(std::ostream &s, std::string const &v)
{ {
const char* buf = v.c_str(); const char* buf = v.c_str();
s.write(buf, v.size() + 1); s.write(buf, v.size() + 1);

View File

@@ -29,7 +29,7 @@ public:
static void ls_float32(std::ostream&, float); static void ls_float32(std::ostream&, float);
static void ls_float64(std::ostream&, double); static void ls_float64(std::ostream&, double);
static void s_uint8(std::ostream&, uint8_t); static void s_uint8(std::ostream&, uint8_t);
static void s_str(std::ostream&, std::string); static void s_str(std::ostream&, std::string const &);
static void s_bool(std::ostream&, bool); static void s_bool(std::ostream&, bool);
static void s_dvec3(std::ostream&, glm::dvec3 const &); static void s_dvec3(std::ostream&, glm::dvec3 const &);
static void s_vec3(std::ostream&, glm::vec3 const &); static void s_vec3(std::ostream&, glm::vec3 const &);

View File

@@ -470,7 +470,7 @@ void python_taskqueue::release_lock() const
PyEval_SaveThread(); PyEval_SaveThread();
} }
auto python_taskqueue::fetch_renderer(std::string const Renderer) -> PyObject * auto python_taskqueue::fetch_renderer(std::string const &Renderer) -> PyObject *
{ {
if (auto const lookup{m_renderers.find(Renderer)}; lookup != std::end(m_renderers)) if (auto const lookup{m_renderers.find(Renderer)}; lookup != std::end(m_renderers))

View File

@@ -131,7 +131,7 @@ class python_taskqueue
using rendertask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>; using rendertask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>;
using uploadtask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>; using uploadtask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>;
// methods // methods
auto fetch_renderer(std::string const Renderer) -> PyObject *; auto fetch_renderer(std::string const &Renderer) -> PyObject *;
void run(GLFWwindow *Context, rendertask_sequence &Tasks, uploadtask_sequence &Upload_Tasks, threading::condition_variable &Condition, std::atomic<bool> const &Exit); void run(GLFWwindow *Context, rendertask_sequence &Tasks, uploadtask_sequence &Upload_Tasks, threading::condition_variable &Condition, std::atomic<bool> const &Exit);
void error(); void error();

View File

@@ -164,7 +164,7 @@ basic_controller::deserialize_operation( cParser &Input ) -> bool {
} }
auto auto
basic_controller::insert( std::string const Name, basic_element Element ) -> element_handle { basic_controller::insert( std::string const &Name, basic_element Element ) -> element_handle {
m_elements.push_back( Element ); m_elements.push_back( Element );
m_elementnames.push_back( Name ); m_elementnames.push_back( Name );

View File

@@ -100,7 +100,7 @@ private:
// methods // methods
auto deserialize_operation( cParser &Input ) -> bool; auto deserialize_operation( cParser &Input ) -> bool;
// adds provided item to the collection. returns: true if there's no duplicate with the same name, false otherwise // adds provided item to the collection. returns: true if there's no duplicate with the same name, false otherwise
auto insert( std::string const Name, basic_element Element ) -> element_handle; auto insert( std::string const &Name, basic_element Element ) -> element_handle;
// runs one cycle of current program. returns: error code or 0 if there's no error // runs one cycle of current program. returns: error code or 0 if there's no error
auto run() -> int; auto run() -> int;
void log_error( std::string const &Error, int const Line = -1 ) const; void log_error( std::string const &Error, int const Line = -1 ) const;

View File

@@ -29,7 +29,7 @@ void texture_window_cursor_pos(GLFWwindow *win, double x, double y)
texwindow->notify_cursor_pos(win, x, y); texwindow->notify_cursor_pos(win, x, y);
} }
python_screen_viewer::python_screen_viewer(std::shared_ptr<python_rt> rt, std::shared_ptr<std::vector<glm::vec2>> touchlist, std::string surfacename) python_screen_viewer::python_screen_viewer(std::shared_ptr<python_rt> rt, std::shared_ptr<std::vector<glm::vec2>> touchlist, std::string const &surfacename)
: m_rt(rt), m_touchlist(touchlist) : m_rt(rt), m_touchlist(touchlist)
{ {

View File

@@ -35,7 +35,7 @@ class python_screen_viewer
void threadfunc(); void threadfunc();
public: public:
python_screen_viewer(std::shared_ptr<python_rt> rt, std::shared_ptr<std::vector<glm::vec2>> touchlist, std::string name); python_screen_viewer(std::shared_ptr<python_rt> rt, std::shared_ptr<std::vector<glm::vec2>> touchlist, std::string const &name);
~python_screen_viewer(); ~python_screen_viewer();
void notify_window_size(GLFWwindow const *window, int w, int h) const; void notify_window_size(GLFWwindow const *window, int w, int h) const;

View File

@@ -55,7 +55,7 @@ to_string( comparison_operator const Operator ) {
inline inline
comparison_pass comparison_pass
comparison_pass_from_string( std::string const Input ) { comparison_pass_from_string( std::string const &Input ) {
using enum comparison_pass; using enum comparison_pass;
if( Input == "all" ) { return all; } if( Input == "all" ) { return all; }
else if( Input == "any" ) { return any; } else if( Input == "any" ) { return any; }
@@ -66,7 +66,7 @@ comparison_pass_from_string( std::string const Input ) {
inline inline
comparison_operator comparison_operator
comparison_operator_from_string( std::string const Input ) { comparison_operator_from_string( std::string const &Input ) {
using enum comparison_operator; using enum comparison_operator;
if( Input == "==" ) { return equal; } if( Input == "==" ) { return equal; }
else if( Input == "!=" ) { return not_equal; } else if( Input == "!=" ) { return not_equal; }

View File

@@ -28,6 +28,6 @@ struct dictionary_source {
inline void insert( std::string const &Key, double const Value ) { floats.emplace_back( Key, Value ); } inline void insert( std::string const &Key, double const Value ) { floats.emplace_back( Key, Value ); }
inline void insert( std::string const &Key, int const Value ) { integers.emplace_back( Key, Value ); } inline void insert( std::string const &Key, int const Value ) { integers.emplace_back( Key, Value ); }
inline void insert( std::string const &Key, bool const Value ) { bools.emplace_back( Key, Value ); } inline void insert( std::string const &Key, bool const Value ) { bools.emplace_back( Key, Value ); }
inline void insert( std::string const &Key, std::string const Value ) { strings.emplace_back( Key, Value ); } inline void insert( std::string const &Key, std::string const &Value ) { strings.emplace_back( Key, Value ); }
inline void insert( std::string const &Key, std::vector<glm::vec2> const Value ) { vec2_lists.emplace_back( Key, Value ); } inline void insert( std::string const &Key, std::vector<glm::vec2> const &Value ) { vec2_lists.emplace_back( Key, Value ); }
}; };

View File

@@ -76,7 +76,7 @@ std::string control_mapper::find(TSubModel const *Control) const
} }
} }
bool control_mapper::contains(std::string const Control) const bool control_mapper::contains(std::string const &Control) const
{ {
return m_names.find(Control) != m_names.end(); return m_names.find(Control) != m_names.end();

View File

@@ -71,7 +71,7 @@ public:
std::string std::string
find( TSubModel const *Control ) const; find( TSubModel const *Control ) const;
bool bool
contains( std::string const Control ) const; contains( std::string const &Control ) const;
}; };
class TTrain { class TTrain {

View File

@@ -245,7 +245,7 @@ void TTrainParameters::UpdateVelocity(int Stationcount, double vActual)
// return false; // return false;
//} //}
bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax) bool TTrainParameters::LoadTTfile(std::string const &scnpath, int iPlus, double vmax)
// wczytanie pliku-tabeli z rozkładem przesuniętym o (fPlus); (vMax) nie ma znaczenia // wczytanie pliku-tabeli z rozkładem przesuniętym o (fPlus); (vMax) nie ma znaczenia
{ {
std::string lines; std::string lines;

View File

@@ -84,7 +84,7 @@ class TTrainParameters
explicit TTrainParameters( std::string const &NewTrainName = "none" ); explicit TTrainParameters( std::string const &NewTrainName = "none" );
void NewName(std::string const &NewTrainName); void NewName(std::string const &NewTrainName);
void UpdateVelocity(int StationCount, double vActual); void UpdateVelocity(int StationCount, double vActual);
bool LoadTTfile(std::string scnpath, int iPlus, double vmax); bool LoadTTfile(std::string const &scnpath, int iPlus, double vmax);
bool DirectionChange() const; bool DirectionChange() const;
void StationIndexInc(); void StationIndexInc();
void serialize( dictionary_source *Output ) const; void serialize( dictionary_source *Output ) const;