Commit 7a029f9f authored by Emmanuel Promayon's avatar Emmanuel Promayon

UPDATED modernized using pass by value parameter + move semantic in constructor

parent 59baf80b
......@@ -51,7 +51,7 @@ namespace cli
~unknown_option () throw () override;
unknown_option (const std::string& option);
unknown_option (std::string option);
const std::string&
option () const;
......@@ -72,7 +72,7 @@ namespace cli
~unknown_argument () throw () override;
unknown_argument (const std::string& argument);
unknown_argument (std::string argument);
const std::string&
argument () const;
......@@ -93,7 +93,7 @@ namespace cli
~missing_value () throw () override;
missing_value (const std::string& option);
missing_value (std::string option);
const std::string&
option () const;
......@@ -114,8 +114,8 @@ namespace cli
~invalid_value () throw () override;
invalid_value (const std::string& option,
const std::string& value);
invalid_value (std::string option,
std::string value);
const std::string&
option () const;
......
#include <utility>
#include <utility>
// This code was generated by CLI, a command line interface
// compiler for C++.
//
......@@ -24,8 +28,8 @@ namespace cli
// unknown_option
//
inline unknown_option::
unknown_option (const std::string& option)
: option_ (option)
unknown_option (std::string option)
: option_ (std::move(std::move(option)))
{
}
......@@ -38,8 +42,8 @@ namespace cli
// unknown_argument
//
inline unknown_argument::
unknown_argument (const std::string& argument)
: argument_ (argument)
unknown_argument (std::string argument)
: argument_ (std::move(std::move(argument)))
{
}
......@@ -52,8 +56,8 @@ namespace cli
// missing_value
//
inline missing_value::
missing_value (const std::string& option)
: option_ (option)
missing_value (std::string option)
: option_ (std::move(std::move(option)))
{
}
......@@ -66,9 +70,9 @@ namespace cli
// invalid_value
//
inline invalid_value::
invalid_value (const std::string& option,
const std::string& value)
: option_ (option), value_ (value)
invalid_value (std::string option,
std::string value)
: option_ (std::move(std::move(option))), value_ (std::move(std::move(value)))
{
}
......
......@@ -51,7 +51,7 @@ namespace cli
~unknown_option () throw () override;
unknown_option (const std::string& option);
unknown_option (std::string option);
const std::string&
option () const;
......@@ -72,7 +72,7 @@ namespace cli
~unknown_argument () throw () override;
unknown_argument (const std::string& argument);
unknown_argument (std::string argument);
const std::string&
argument () const;
......@@ -93,7 +93,7 @@ namespace cli
~missing_value () throw () override;
missing_value (const std::string& option);
missing_value (std::string option);
const std::string&
option () const;
......@@ -114,8 +114,8 @@ namespace cli
~invalid_value () throw () override;
invalid_value (const std::string& option,
const std::string& value);
invalid_value (std::string option,
std::string value);
const std::string&
option () const;
......
#include <utility>
// This code was generated by CLI, a command line interface
// compiler for C++.
//
......@@ -24,8 +26,8 @@ namespace cli
// unknown_option
//
inline unknown_option::
unknown_option (const std::string& option)
: option_ (option)
unknown_option (std::string option)
: option_ (std::move(option))
{
}
......@@ -38,8 +40,8 @@ namespace cli
// unknown_argument
//
inline unknown_argument::
unknown_argument (const std::string& argument)
: argument_ (argument)
unknown_argument (std::string argument)
: argument_ (std::move(argument))
{
}
......@@ -52,8 +54,8 @@ namespace cli
// missing_value
//
inline missing_value::
missing_value (const std::string& option)
: option_ (option)
missing_value (std::string option)
: option_ (std::move(option))
{
}
......@@ -66,9 +68,9 @@ namespace cli
// invalid_value
//
inline invalid_value::
invalid_value (const std::string& option,
const std::string& value)
: option_ (option), value_ (value)
invalid_value (std::string option,
std::string value)
: option_ (std::move(option)), value_ (std::move(value))
{
}
......
......@@ -51,7 +51,7 @@ namespace cli
~unknown_option () throw () override;
unknown_option (const std::string& option);
unknown_option (std::string option);
const std::string&
option () const;
......@@ -72,7 +72,7 @@ namespace cli
~unknown_argument () throw () override;
unknown_argument (const std::string& argument);
unknown_argument (std::string argument);
const std::string&
argument () const;
......@@ -93,7 +93,7 @@ namespace cli
~missing_value () throw () override;
missing_value (const std::string& option);
missing_value (std::string option);
const std::string&
option () const;
......@@ -114,8 +114,8 @@ namespace cli
~invalid_value () throw () override;
invalid_value (const std::string& option,
const std::string& value);
invalid_value (std::string option,
std::string value);
const std::string&
option () const;
......
#include <utility>
// This code was generated by CLI, a command line interface
// compiler for C++.
//
......@@ -24,8 +26,8 @@ namespace cli
// unknown_option
//
inline unknown_option::
unknown_option (const std::string& option)
: option_ (option)
unknown_option (std::string option)
: option_ (std::move(option))
{
}
......@@ -38,8 +40,8 @@ namespace cli
// unknown_argument
//
inline unknown_argument::
unknown_argument (const std::string& argument)
: argument_ (argument)
unknown_argument (std::string argument)
: argument_ (std::move(argument))
{
}
......@@ -52,8 +54,8 @@ namespace cli
// missing_value
//
inline missing_value::
missing_value (const std::string& option)
: option_ (option)
missing_value (std::string option)
: option_ (std::move(option))
{
}
......@@ -66,9 +68,9 @@ namespace cli
// invalid_value
//
inline invalid_value::
invalid_value (const std::string& option,
const std::string& value)
: option_ (option), value_ (value)
invalid_value (std::string option,
std::string value)
: option_ (std::move(option)), value_ (std::move(value))
{
}
......
......@@ -51,7 +51,7 @@ namespace cli
~unknown_option () throw () override;
unknown_option (const std::string& option);
unknown_option (std::string option);
const std::string&
option () const;
......@@ -72,7 +72,7 @@ namespace cli
~unknown_argument () throw () override;
unknown_argument (const std::string& argument);
unknown_argument (std::string argument);
const std::string&
argument () const;
......@@ -93,7 +93,7 @@ namespace cli
~missing_value () throw () override;
missing_value (const std::string& option);
missing_value (std::string option);
const std::string&
option () const;
......@@ -114,8 +114,8 @@ namespace cli
~invalid_value () throw () override;
invalid_value (const std::string& option,
const std::string& value);
invalid_value (std::string option,
std::string value);
const std::string&
option () const;
......
#include <utility>
// This code was generated by CLI, a command line interface
// compiler for C++.
//
......@@ -24,8 +26,8 @@ namespace cli
// unknown_option
//
inline unknown_option::
unknown_option (const std::string& option)
: option_ (option)
unknown_option (std::string option)
: option_ (std::move(option))
{
}
......@@ -38,8 +40,8 @@ namespace cli
// unknown_argument
//
inline unknown_argument::
unknown_argument (const std::string& argument)
: argument_ (argument)
unknown_argument (std::string argument)
: argument_ (std::move(argument))
{
}
......@@ -52,8 +54,8 @@ namespace cli
// missing_value
//
inline missing_value::
missing_value (const std::string& option)
: option_ (option)
missing_value (std::string option)
: option_ (std::move(option))
{
}
......@@ -66,9 +68,9 @@ namespace cli
// invalid_value
//
inline invalid_value::
invalid_value (const std::string& option,
const std::string& value)
: option_ (option), value_ (value)
invalid_value (std::string option,
std::string value)
: option_ (std::move(option)), value_ (std::move(value))
{
}
......
......@@ -51,7 +51,7 @@ namespace cli
~unknown_option () throw () override;
unknown_option (const std::string& option);
unknown_option (std::string option);
const std::string&
option () const;
......@@ -72,7 +72,7 @@ namespace cli
~unknown_argument () throw () override;
unknown_argument (const std::string& argument);
unknown_argument (std::string argument);
const std::string&
argument () const;
......@@ -93,7 +93,7 @@ namespace cli
~missing_value () throw () override;
missing_value (const std::string& option);
missing_value (std::string option);
const std::string&
option () const;
......@@ -114,8 +114,8 @@ namespace cli
~invalid_value () throw () override;
invalid_value (const std::string& option,
const std::string& value);
invalid_value (std::string option,
std::string value);
const std::string&
option () const;
......
#include <utility>
// This code was generated by CLI, a command line interface
// compiler for C++.
//
......@@ -24,8 +26,8 @@ namespace cli
// unknown_option
//
inline unknown_option::
unknown_option (const std::string& option)
: option_ (option)
unknown_option (std::string option)
: option_ (std::move(option))
{
}
......@@ -38,8 +40,8 @@ namespace cli
// unknown_argument
//
inline unknown_argument::
unknown_argument (const std::string& argument)
: argument_ (argument)
unknown_argument (std::string argument)
: argument_ (std::move(argument))
{
}
......@@ -52,8 +54,8 @@ namespace cli
// missing_value
//
inline missing_value::
missing_value (const std::string& option)
: option_ (option)
missing_value (std::string option)
: option_ (std::move(option))
{
}
......@@ -66,9 +68,9 @@ namespace cli
// invalid_value
//
inline invalid_value::
invalid_value (const std::string& option,
const std::string& value)
: option_ (option), value_ (value)
invalid_value (std::string option,
std::string value)
: option_ (std::move(option)), value_ (std::move(value))
{
}
......
......@@ -51,7 +51,7 @@ namespace cli
~unknown_option () throw () override;
unknown_option (const std::string& option);
unknown_option (std::string option);
const std::string&
option () const;
......@@ -72,7 +72,7 @@ namespace cli
~unknown_argument () throw () override;
unknown_argument (const std::string& argument);
unknown_argument (std::string argument);
const std::string&
argument () const;
......@@ -93,7 +93,7 @@ namespace cli
~missing_value () throw () override;
missing_value (const std::string& option);
missing_value (std::string option);
const std::string&
option () const;
......@@ -114,8 +114,8 @@ namespace cli
~invalid_value () throw () override;
invalid_value (const std::string& option,
const std::string& value);
invalid_value (std::string option,
std::string value);
const std::string&
option () const;
......
#include <utility>
// This code was generated by CLI, a command line interface
// compiler for C++.
//
......@@ -24,8 +26,8 @@ namespace cli
// unknown_option
//
inline unknown_option::
unknown_option (const std::string& option)
: option_ (option)
unknown_option (std::string option)
: option_ (std::move(option))
{
}
......@@ -38,8 +40,8 @@ namespace cli
// unknown_argument
//
inline unknown_argument::
unknown_argument (const std::string& argument)
: argument_ (argument)
unknown_argument (std::string argument)
: argument_ (std::move(argument))
{
}
......@@ -52,8 +54,8 @@ namespace cli
// missing_value
//
inline missing_value::
missing_value (const std::string& option)
: option_ (option)
missing_value (std::string option)
: option_ (std::move(option))
{
}
......@@ -66,9 +68,9 @@ namespace cli
// invalid_value
//
inline invalid_value::
invalid_value (const std::string& option,
const std::string& value)
: option_ (option), value_ (value)
invalid_value (std::string option,
std::string value)
: option_ (std::move(option)), value_ (std::move(value))
{
}
......
......@@ -51,7 +51,7 @@ namespace cli
~unknown_option () throw () override;
unknown_option (const std::string& option);
unknown_option (std::string option);
const std::string&
option () const;
......@@ -72,7 +72,7 @@ namespace cli
~unknown_argument () throw () override;
unknown_argument (const std::string& argument);
unknown_argument (std::string argument);
const std::string&
argument () const;
......@@ -93,7 +93,7 @@ namespace cli
~missing_value () throw () override;
missing_value (const std::string& option);
missing_value (std::string option);
const std::string&
option () const;
......@@ -114,8 +114,8 @@ namespace cli
~invalid_value () throw () override;
invalid_value (const std::string& option,
const std::string& value);
invalid_value (std::string option,
std::string value);
const std::string&
option () const;
......
#include <utility>
#include <utility>
// This code was generated by CLI, a command line interface
// compiler for C++.
//
......@@ -24,8 +28,8 @@ namespace cli
// unknown_option
//
inline unknown_option::
unknown_option (const std::string& option)
: option_ (option)
unknown_option (std::string option)
: option_ (std::move(std::move(option)))
{
}
......@@ -38,8 +42,8 @@ namespace cli
// unknown_argument
//
inline unknown_argument::
unknown_argument (const std::string& argument)
: argument_ (argument)
unknown_argument (std::string argument)
: argument_ (std::move(std::move(argument)))
{
}
......@@ -52,8 +56,8 @@ namespace cli
// missing_value
//
inline missing_value::
missing_value (const std::string& option)
: option_ (option)
missing_value (std::string option)
: option_ (std::move(std::move(option)))
{
}
......@@ -66,9 +70,9 @@ namespace cli
// invalid_value
//
inline invalid_value::
invalid_value (const std::string& option,
const std::string& value)
: option_ (option), value_ (value)
invalid_value (std::string option,
std::string value)
: option_ (std::move(std::move(option))), value_ (std::move(std::move(value)))
{
}
......
......@@ -32,9 +32,10 @@
#include "Log.h"
// -- QT stuff
#include <QSet>
#include <QMetaObject>
#include <QEvent>
#include <QMetaObject>
#include <QSet>
#include <utility>
namespace camitk {
// --------------------------------------------------------
......@@ -44,7 +45,7 @@ QSet<Viewer*> Component::allViewers;
// -------------------- constructor --------------------
Component::Component(const QString& file, const QString& n, Representation s) : myParentNode(nullptr), myFileName(file), myService(s), myName(n) {
Component::Component(QString file, QString n, Representation s) : myParentNode(nullptr), myFileName(std::move(file)), myService(s), myName(std::move(n)) {
init();
}
......
......@@ -321,7 +321,7 @@ public:
* @param name the Component name
* @param rep the representation concretely implemented by this Component (default=NO_REPRESENTATION)
*/
Component(const QString& file, const QString& name, Representation rep = NO_REPRESENTATION);
Component(QString file, QString name, Representation rep = NO_REPRESENTATION);
/** Component constructor for a Component that is a child of another Component
* You should not use this constructor for a top-level component.
......
......@@ -42,6 +42,8 @@
#include <vtkRenderWindowInteractor.h>
#include <QVTKInteractor.h>
#include <utility>
// -- VTK stuff classes
class vtkRenderer;
class vtkInteractorStyle;
......@@ -189,7 +191,7 @@ public :
/// file format description
QString description;
/// Constructor
ScreenshotFormatInfo(ScreenshotFormat t, QString e, QString d) : type(t), extension(e), description(d) {}
ScreenshotFormatInfo(ScreenshotFormat t, QString e, QString d) : type(t), extension(std::move(e)), description(std::move(d)) {}
/// default constructor
ScreenshotFormatInfo() : extension(""), description("Not supported") {}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment