Skip to content

Commit

Permalink
Review update
Browse files Browse the repository at this point in the history
  • Loading branch information
lordgamez committed Aug 8, 2023
1 parent 9c5203b commit 38b012a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions libminifi/include/core/Processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <memory>
#include <mutex>
#include <string>
#include <string_view>
#include <unordered_set>
#include <unordered_map>
#include <utility>
Expand Down Expand Up @@ -73,8 +74,8 @@ constexpr std::chrono::microseconds MINIMUM_SCHEDULING_PERIOD{30};

class Processor : public Connectable, public ConfigurableComponent, public state::response::ResponseNodeSource {
public:
Processor(std::string name, const utils::Identifier& uuid, std::shared_ptr<ProcessorMetrics> metrics = nullptr);
explicit Processor(std::string name, std::shared_ptr<ProcessorMetrics> metrics = nullptr);
Processor(std::string_view name, const utils::Identifier& uuid, std::shared_ptr<ProcessorMetrics> metrics = nullptr);
explicit Processor(std::string_view name, std::shared_ptr<ProcessorMetrics> metrics = nullptr);

Processor(const Processor& parent) = delete;
Processor& operator=(const Processor& parent) = delete;
Expand Down
8 changes: 4 additions & 4 deletions libminifi/src/core/Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ using namespace std::literals::chrono_literals;

namespace org::apache::nifi::minifi::core {

Processor::Processor(std::string name, std::shared_ptr<ProcessorMetrics> metrics)
: Connectable(std::move(name)),
Processor::Processor(std::string_view name, std::shared_ptr<ProcessorMetrics> metrics)
: Connectable(name),
logger_(logging::LoggerFactory<Processor>::getLogger(uuid_)),
metrics_(metrics ? std::move(metrics) : std::make_shared<ProcessorMetrics>(*this)) {
has_work_.store(false);
Expand All @@ -59,8 +59,8 @@ Processor::Processor(std::string name, std::shared_ptr<ProcessorMetrics> metrics
logger_->log_debug("Processor %s created UUID %s", name_, getUUIDStr());
}

Processor::Processor(std::string name, const utils::Identifier& uuid, std::shared_ptr<ProcessorMetrics> metrics)
: Connectable(std::move(name), uuid),
Processor::Processor(std::string_view name, const utils::Identifier& uuid, std::shared_ptr<ProcessorMetrics> metrics)
: Connectable(name, uuid),
logger_(logging::LoggerFactory<Processor>::getLogger(uuid_)),
metrics_(metrics ? std::move(metrics) : std::make_shared<ProcessorMetrics>(*this)) {
has_work_.store(false);
Expand Down
6 changes: 3 additions & 3 deletions libminifi/test/DummyProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#pragma once

#include <array>
#include <string>
#include <string_view>
#include <utility>

#include "core/Processor.h"
Expand All @@ -29,8 +29,8 @@ class DummyProcessor : public minifi::core::Processor {
using minifi::core::Processor::Processor;

public:
DummyProcessor(std::string name, const minifi::utils::Identifier& uuid) : Processor(std::move(name), uuid) {}
explicit DummyProcessor(std::string name) : Processor(std::move(name)) {}
DummyProcessor(std::string_view name, const minifi::utils::Identifier& uuid) : Processor(std::move(name), uuid) {}
explicit DummyProcessor(std::string_view name) : Processor(std::move(name)) {}
static constexpr const char* Description = "A processor that does nothing.";
static constexpr auto Properties = std::array<core::PropertyReference, 0>{};
static constexpr auto Relationships = std::array<core::RelationshipDefinition, 0>{};
Expand Down

0 comments on commit 38b012a

Please sign in to comment.