[
https://issues.apache.org/jira/browse/MINIFICPP-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16286443#comment-16286443
]
ASF GitHub Bot commented on MINIFICPP-41:
-----------------------------------------
Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/217#discussion_r156176001
--- Diff: libminifi/include/capi/Instance.h ---
@@ -0,0 +1,135 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef LIBMINIFI_INCLUDE_CAPI_INSTANCE_H_
+#define LIBMINIFI_INCLUDE_CAPI_INSTANCE_H_
+
+#include <memory>
+#include <type_traits>
+#include <string>
+#include "core/Property.h"
+#include "properties/Configure.h"
+#include "io/StreamFactory.h"
+#include "RemoteProcessorGroupPort.h"
+#include "core/ContentRepository.h"
+#include "core/repository/VolatileContentRepository.h"
+#include "core/Repository.h"
+
+#include "core/Connectable.h"
+#include "core/ProcessorNode.h"
+#include "core/ProcessContext.h"
+#include "core/ProcessSession.h"
+#include "core/ProcessSessionFactory.h"
+#include "core/controller/ControllerServiceProvider.h"
+#include "core/FlowConfiguration.h"
+#include "ReflexiveSession.h"
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+
+class ProcessorLink {
+ public:
+ explicit ProcessorLink(const std::shared_ptr<core::Processor> &processor)
+ : processor_(processor) {
+
+ }
+
+ const std::shared_ptr<core::Processor> &getProcessor() {
+ return processor_;
+ }
+
+ protected:
+ std::shared_ptr<core::Processor> processor_;
+};
+
+class Instance {
+ public:
+
+ explicit Instance(const std::string &url, const std::string &port)
+ : configure_(std::make_shared<Configure>()),
+ url_(url),
+ initialized_(false),
+
content_repo_(std::make_shared<minifi::core::repository::FileSystemRepository>()),
+ no_op_repo_(std::make_shared<minifi::core::Repository>()) {
+ stream_factory_ =
std::make_shared<minifi::io::StreamFactory>(configure_);
+ uuid_t uuid;
+ uuid_parse(port.c_str(), uuid);
+ rpg_ =
std::make_shared<minifi::RemoteProcessorGroupPort>(stream_factory_, url, url,
configure_, uuid);
+ proc_node_ = std::make_shared<core::ProcessorNode>(rpg_);
+ core::FlowConfiguration::initialize_static_functions();
+ content_repo_->initialize(configure_);
+ }
+
+ bool isInitialized() {
+ std::cout << "are we initialized? " << initialized_ << std::endl;
--- End diff --
will remove.
> Create C++ library for core API
> -------------------------------
>
> Key: MINIFICPP-41
> URL: https://issues.apache.org/jira/browse/MINIFICPP-41
> Project: NiFi MiNiFi C++
> Issue Type: Task
> Reporter: Aldrin Piri
>
> To make it possible for folks to create extensions and build on top of the
> MiNiFi C++ framework, the establishment of a core API library extracted from
> the existing codebase that can be linked should be provided.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)