Applied modernize-pass-by-value clang-tidy fixes
This commit is contained in:
@@ -18,13 +18,15 @@
|
||||
|
||||
#include "class_element.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace clanguml::class_diagram::model {
|
||||
|
||||
class_element::class_element(common::model::access_t access,
|
||||
const std::string &name, const std::string &type)
|
||||
class_element::class_element(
|
||||
common::model::access_t access, std::string name, std::string type)
|
||||
: access_{access}
|
||||
, name_{name}
|
||||
, type_{type}
|
||||
, name_{std::move(name)}
|
||||
, type_{std::move(type)}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace clanguml::class_diagram::model {
|
||||
class class_element : public common::model::decorated_element,
|
||||
public common::model::source_location {
|
||||
public:
|
||||
class_element(common::model::access_t scope, const std::string &name,
|
||||
const std::string &type);
|
||||
class_element(
|
||||
common::model::access_t scope, std::string name, std::string type);
|
||||
|
||||
common::model::access_t access() const;
|
||||
std::string name() const;
|
||||
|
||||
@@ -20,11 +20,13 @@
|
||||
#include "common/model/enums.h"
|
||||
#include <common/model/namespace.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace clanguml::class_diagram::model {
|
||||
|
||||
template_parameter::template_parameter(const std::string &type,
|
||||
const std::string &name, const std::string &default_value, bool is_variadic)
|
||||
: default_value_{default_value}
|
||||
const std::string &name, std::string default_value, bool is_variadic)
|
||||
: default_value_{std::move(default_value)}
|
||||
, is_variadic_{is_variadic}
|
||||
{
|
||||
set_name(name);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace clanguml::class_diagram::model {
|
||||
class template_parameter {
|
||||
public:
|
||||
template_parameter(const std::string &type = "",
|
||||
const std::string &name = "", const std::string &default_value = "",
|
||||
const std::string &name = "", std::string default_value = "",
|
||||
bool is_variadic = false);
|
||||
|
||||
template_parameter(const template_parameter &right) = default;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "diagram_filter.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "class_diagram/model/class.h"
|
||||
#include "common/model/package.h"
|
||||
#include "include_diagram/model/diagram.h"
|
||||
@@ -155,7 +157,7 @@ tvl::value_t anyof_filter::match(
|
||||
namespace_filter::namespace_filter(
|
||||
filter_t type, std::vector<namespace_> namespaces)
|
||||
: filter_visitor{type}
|
||||
, namespaces_{namespaces}
|
||||
, namespaces_{std::move(namespaces)}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -202,7 +204,7 @@ tvl::value_t namespace_filter::match(
|
||||
|
||||
element_filter::element_filter(filter_t type, std::vector<std::string> elements)
|
||||
: filter_visitor{type}
|
||||
, elements_{elements}
|
||||
, elements_{std::move(elements)}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -218,7 +220,7 @@ tvl::value_t element_filter::match(
|
||||
|
||||
subclass_filter::subclass_filter(filter_t type, std::vector<std::string> roots)
|
||||
: filter_visitor{type}
|
||||
, roots_{roots}
|
||||
, roots_{std::move(roots)}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -268,7 +270,7 @@ tvl::value_t subclass_filter::match(const diagram &d, const element &e) const
|
||||
relationship_filter::relationship_filter(
|
||||
filter_t type, std::vector<relationship_t> relationships)
|
||||
: filter_visitor{type}
|
||||
, relationships_{relationships}
|
||||
, relationships_{std::move(relationships)}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -281,7 +283,7 @@ tvl::value_t relationship_filter::match(
|
||||
|
||||
access_filter::access_filter(filter_t type, std::vector<access_t> access)
|
||||
: filter_visitor{type}
|
||||
, access_{access}
|
||||
, access_{std::move(access)}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -294,7 +296,7 @@ tvl::value_t access_filter::match(
|
||||
|
||||
context_filter::context_filter(filter_t type, std::vector<std::string> context)
|
||||
: filter_visitor{type}
|
||||
, context_{context}
|
||||
, context_{std::move(context)}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "tvl.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <utility>
|
||||
|
||||
namespace clanguml::common::model {
|
||||
|
||||
@@ -140,7 +141,7 @@ struct edge_traversal_filter : public filter_visitor {
|
||||
edge_traversal_filter(filter_t type, relationship_t relationship,
|
||||
std::vector<std::string> roots, bool forward = false)
|
||||
: filter_visitor{type}
|
||||
, roots_{roots}
|
||||
, roots_{std::move(roots)}
|
||||
, relationship_{relationship}
|
||||
, forward_{forward}
|
||||
{
|
||||
|
||||
@@ -21,11 +21,12 @@
|
||||
#include "util/util.h"
|
||||
|
||||
#include <ostream>
|
||||
#include <utility>
|
||||
|
||||
namespace clanguml::common::model {
|
||||
|
||||
element::element(const namespace_ &using_namespace)
|
||||
: using_namespace_{using_namespace}
|
||||
element::element(namespace_ using_namespace)
|
||||
: using_namespace_{std::move(using_namespace)}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace clanguml::common::model {
|
||||
|
||||
class element : public diagram_element {
|
||||
public:
|
||||
element(const namespace_ &using_namespace);
|
||||
element(namespace_ using_namespace);
|
||||
|
||||
virtual ~element() = default;
|
||||
|
||||
|
||||
@@ -18,17 +18,18 @@
|
||||
|
||||
#include "relationship.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace clanguml::common::model {
|
||||
|
||||
relationship::relationship(relationship_t type, int64_t destination,
|
||||
access_t access, const std::string &label,
|
||||
const std::string &multiplicity_source,
|
||||
const std::string &multiplicity_destination)
|
||||
access_t access, std::string label, std::string multiplicity_source,
|
||||
std::string multiplicity_destination)
|
||||
: type_{type}
|
||||
, destination_{destination}
|
||||
, multiplicity_source_{multiplicity_source}
|
||||
, multiplicity_destination_{multiplicity_destination}
|
||||
, label_{label}
|
||||
, multiplicity_source_{std::move(multiplicity_source)}
|
||||
, multiplicity_destination_{std::move(multiplicity_destination)}
|
||||
, label_{std::move(label)}
|
||||
, access_{access}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ class relationship : public common::model::decorated_element,
|
||||
public common::model::stylable_element {
|
||||
public:
|
||||
relationship(relationship_t type, int64_t destination,
|
||||
access_t access = access_t::kPublic, const std::string &label = "",
|
||||
const std::string &multiplicity_source = "",
|
||||
const std::string &multiplicity_destination = "");
|
||||
access_t access = access_t::kPublic, std::string label = "",
|
||||
std::string multiplicity_source = "",
|
||||
std::string multiplicity_destination = "");
|
||||
|
||||
virtual ~relationship() = default;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace clanguml::common::model {
|
||||
|
||||
@@ -25,8 +26,8 @@ class source_location {
|
||||
public:
|
||||
source_location() = default;
|
||||
|
||||
source_location(const std::string &f, unsigned int l)
|
||||
: file_{f}
|
||||
source_location(std::string f, unsigned int l)
|
||||
: file_{std::move(f)}
|
||||
, line_{l}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace clanguml {
|
||||
namespace config {
|
||||
@@ -27,17 +28,17 @@ template <typename T> void append_value(T &l, const T &r) { l = r; }
|
||||
enum class option_inherit_mode { kOverride, kAppend };
|
||||
|
||||
template <typename T> struct option {
|
||||
option(const std::string &name_,
|
||||
option(std::string name_,
|
||||
option_inherit_mode im = option_inherit_mode::kOverride)
|
||||
: name{name_}
|
||||
: name{std::move(name_)}
|
||||
, value{}
|
||||
, inheritance_mode{im}
|
||||
{
|
||||
}
|
||||
option(const std::string &name_, const T &initial_value,
|
||||
option(std::string name_, T initial_value,
|
||||
option_inherit_mode im = option_inherit_mode::kOverride)
|
||||
: name{name_}
|
||||
, value{initial_value}
|
||||
: name{std::move(name_)}
|
||||
, value{std::move(initial_value)}
|
||||
, has_value{true}
|
||||
, inheritance_mode{im}
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user