core: Align Callback usage with signature (L309) in CommandLine class

This commit is contained in:
Stefano Avallone
2023-03-03 19:45:41 +01:00
committed by Stefano Avallone
parent 86d90acc3f
commit 7e7f766ff0
4 changed files with 5 additions and 5 deletions

View File

@@ -49,7 +49,7 @@ std::string g_cbArg = "cbArg default";
* \returns \c true.
*/
bool
SetCbArg(std::string val)
SetCbArg(const std::string& val)
{
g_cbArg = val;
return true;

View File

@@ -437,7 +437,7 @@ class DictFiles
* \param [in] file The word file to add.
* \return \c true If the file is new to the list.
*/
bool Add(const std::string file)
bool Add(const std::string& file)
{
if (std::find(m_files.begin(), m_files.end(), file) == m_files.end())
{

View File

@@ -761,7 +761,7 @@ CommandLine::AddValue(const std::string& name,
void
CommandLine::AddValue(const std::string& name,
const std::string& help,
ns3::Callback<bool, std::string> callback,
ns3::Callback<bool, const std::string&> callback,
const std::string& defaultValue /* = "" */)
{

View File

@@ -322,7 +322,7 @@ class CommandLine
*/
void AddValue(const std::string& name,
const std::string& help,
ns3::Callback<bool, std::string> callback,
ns3::Callback<bool, const std::string&> callback,
const std::string& defaultValue = "");
/**
@@ -533,7 +533,7 @@ class CommandLine
bool HasDefault() const override;
std::string GetDefault() const override;
ns3::Callback<bool, std::string> m_callback; /**< The Callback */
ns3::Callback<bool, const std::string&> m_callback; /**< The Callback */
std::string m_default; /**< The default value, as a string, if it exists. */
}; // class CallbackItem