Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ ovms_cc_library(
"libovms_execution_context",
"libovmslogging",
"libovmsmetrics",
"//src/port:rapidjson_document",
],
visibility = ["//visibility:public",],
)
Expand All @@ -361,6 +362,7 @@ ovms_cc_library(
srcs = ["modelinstanceunloadguard.cpp",],
deps = [
"modelinstance_h",
"//src/port:rapidjson_document",
],
visibility = ["//visibility:public",],
)
Expand Down Expand Up @@ -1156,6 +1158,7 @@ ovms_cc_library(
"@com_github_tencent_rapidjson//:rapidjson",
"//src/port:rapidjson_stringbuffer",
"//src/port:rapidjson_writer",
"//src/port:rapidjson_document",
"cpp_headers",
"libovms_module",
"libovmslogging",
Expand Down Expand Up @@ -2239,9 +2242,9 @@ ovms_cc_library(
],
srcs = ["json_parser.cpp"],
deps = ["cpp_headers",
"@com_github_tencent_rapidjson//:rapidjson",
"//third_party:openvino",
"libovmslogging"],
"libovmslogging",
"//src/port:rapidjson_document"],
visibility = ["//visibility:public"],
)

Expand Down
5 changes: 1 addition & 4 deletions src/capi_frontend/capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@
#include <iterator>
#include <memory>
#include <string>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#include "src/port/rapidjson_document.hpp"
#include <rapidjson/pointer.h>
#include <rapidjson/rapidjson.h>
#include "src/port/rapidjson_stringbuffer.hpp"
#include "src/port/rapidjson_writer.hpp"
#pragma warning(pop)

#include "../dags/pipeline.hpp"
#include "../dags/pipelinedefinition.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/config_export_module/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ ovms_cc_library(
"//src:libovmslocalfilesystem",
"//src:libovmslogging",
"//src:libovmsschema",
"//src/port:rapidjson_document",
"//src/port:rapidjson_prettywriter",
],
visibility = ["//visibility:public",],
)
7 changes: 2 additions & 5 deletions src/config_export_module/config_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@
//*****************************************************************************
#include "config_export.hpp"

#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#include "src/port/rapidjson_prettywriter.hpp"
#include <rapidjson/error/en.h>
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/prettywriter.h>
#pragma warning(pop)
#include "src/port/rapidjson_document.hpp"

#include "../capi_frontend/server_settings.hpp"
#include "src/filesystem.hpp"
Expand Down
5 changes: 1 addition & 4 deletions src/customloaderconfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
#pragma once

#include <string>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#include "src/port/rapidjson_document.hpp"
#include <rapidjson/istreamwrapper.h>
#include "src/port/rapidjson_stringbuffer.hpp"
#include "src/port/rapidjson_writer.hpp"
#pragma warning(pop)
#include <spdlog/spdlog.h>

#include "filesystem.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/graph_export/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ ovms_cc_library(
"@ovms//src:libovms_version",
"//src/port:rapidjson_stringbuffer",
"//src/port:rapidjson_writer",
"//src/port:rapidjson_document",
"//src/port:rapidjson_prettywriter",
] + select({
"//:not_disable_mediapipe": [
"@mediapipe//mediapipe/framework/port:parse_text_proto",
Expand Down
7 changes: 2 additions & 5 deletions src/graph_export/graph_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@
#include <string>
#include <utility>

#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#include "src/port/rapidjson_document.hpp"
#include "src/port/rapidjson_stringbuffer.hpp"
#include "src/port/rapidjson_writer.hpp"
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/prettywriter.h>
#pragma warning(pop)
#include "src/port/rapidjson_prettywriter.hpp"

#include "../capi_frontend/server_settings.hpp"
#include "../config.hpp"
Expand Down
5 changes: 1 addition & 4 deletions src/http_frontend/http_graph_executor_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
#include <map>
#include <memory>
#include <string>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#pragma warning(pop)
#include "src/port/rapidjson_document.hpp"

#include "../http_payload.hpp"
#include "../mediapipe_internal/packettypes.hpp"
Expand Down
5 changes: 1 addition & 4 deletions src/json_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
#include <string>

#include <openvino/openvino.hpp>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#pragma warning(pop)
#include "src/port/rapidjson_document.hpp"

#include "logging.hpp"
#include "status.hpp"
Expand Down
5 changes: 1 addition & 4 deletions src/json_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
#include <string>

#include <openvino/openvino.hpp>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#pragma warning(pop)
#include "src/port/rapidjson_document.hpp"

using plugin_config_t = std::map<std::string, ov::Any>;

Expand Down
1 change: 1 addition & 0 deletions src/llm/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ ovms_cc_library(
"//third_party:openvino",
"@mediapipe//mediapipe/framework:calculator_framework",
"@com_github_tencent_rapidjson//:rapidjson",
"//src/port:rapidjson_prettywriter",
"//src:libmodelconfigjsonparser",
"//src:libovmslogging",
"//src:libovmsstatus",
Expand Down
5 changes: 3 additions & 2 deletions src/llm/servable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include "mediapipe/framework/calculator_graph.h"
#include <rapidjson/document.h>
#include <rapidjson/prettywriter.h>
#pragma GCC diagnostic pop
#pragma warning(pop)

#include "src/port/rapidjson_document.hpp"
#include "src/port/rapidjson_prettywriter.hpp"

#include "../config.hpp"
#include "../http_payload.hpp"
#include "../logging.hpp"
Expand Down
5 changes: 1 addition & 4 deletions src/mediapipe_internal/mediapipegraphconfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
#pragma once

#include <string>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#pragma warning(pop)
#include "src/port/rapidjson_document.hpp"

namespace ovms {

Expand Down
5 changes: 1 addition & 4 deletions src/metric_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@
#include <regex>
#include <sstream>
#include <string>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#include "src/port/rapidjson_document.hpp"
#include <rapidjson/istreamwrapper.h>
#include "src/port/rapidjson_stringbuffer.hpp"
#include "src/port/rapidjson_writer.hpp"
#pragma warning(pop)
#include <spdlog/spdlog.h>

#include "logging.hpp"
Expand Down
5 changes: 1 addition & 4 deletions src/metric_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
#include <string>
#include <unordered_map>
#include <unordered_set>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#pragma warning(pop)
#include "src/port/rapidjson_document.hpp"

namespace ovms {

Expand Down
5 changes: 1 addition & 4 deletions src/modelconfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
#include <tuple>
#include <unordered_map>
#include <vector>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#pragma warning(pop)
#include "src/port/rapidjson_document.hpp"

#include "anonymous_input_name.hpp"
#include "layout_configuration.hpp"
Expand Down
7 changes: 2 additions & 5 deletions src/modelmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@
#endif

#include <errno.h>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#include "src/port/rapidjson_document.hpp"
#include <rapidjson/error/en.h>
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/prettywriter.h>
#pragma warning(pop)
#include "src/port/rapidjson_prettywriter.hpp"
#include <sys/stat.h>

#include "cleaner_utils.hpp"
Expand Down
5 changes: 1 addition & 4 deletions src/modelmanager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
#include <vector>

#include <openvino/openvino.hpp>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#pragma warning(pop)
#include "src/port/rapidjson_document.hpp"
#include <spdlog/spdlog.h>
#include <sys/stat.h>

Expand Down
7 changes: 7 additions & 0 deletions src/port/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ ovms_cc_library(
visibility = ["//visibility:public",],
)

ovms_cc_library(
name = "rapidjson_prettywriter",
hdrs = ["rapidjson_prettywriter.hpp"],
deps = ["@com_github_tencent_rapidjson//:rapidjson"],
visibility = ["//visibility:public",],
)

ovms_cc_library(
name = "dr_audio",
hdrs = ["dr_audio.hpp"],
Expand Down
21 changes: 21 additions & 0 deletions src/port/rapidjson_prettywriter.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once
//*****************************************************************************
// Copyright 2025 Intel Corporation
//
// Licensed 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.
//*****************************************************************************

#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/prettywriter.h>
#pragma warning(pop)
5 changes: 1 addition & 4 deletions src/rest_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
#include <set>
#include <string>
#include <unordered_map>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#pragma warning(pop)
#include "src/port/rapidjson_document.hpp"
#include <spdlog/spdlog.h>

#pragma GCC diagnostic push
Expand Down
7 changes: 2 additions & 5 deletions src/rest_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@
#include <optional>
#include <set>
#include <sstream>
#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#include "src/port/rapidjson_document.hpp"
#include <rapidjson/error/en.h>
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/prettywriter.h>
#pragma warning(pop)
#include "src/port/rapidjson_prettywriter.hpp"
#include <spdlog/spdlog.h>

#pragma warning(push)
Expand Down
2 changes: 1 addition & 1 deletion src/test/get_mediapipe_graph_metadata_response_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <rapidjson/document.h>
#include "../port/rapidjson_document.hpp"

#if (MEDIAPIPE_DISABLE == 0)
#include "../mediapipe_internal/mediapipegraphdefinition.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/test/get_model_metadata_response_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <rapidjson/document.h>
#include "../port/rapidjson_document.hpp"

#include "../get_model_metadata_impl.hpp"
#include "../modelmanager.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/test/get_pipeline_metadata_response_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <rapidjson/document.h>
#include "../port/rapidjson_document.hpp"

#include "../dags/pipelinedefinition.hpp"
#include "../get_model_metadata_impl.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/test/kfs_rest_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <string>

#include <gtest/gtest.h>
#include <rapidjson/document.h>
#include "../port/rapidjson_document.hpp"
#include <stdint.h>

#include "../config.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/test/llm/max_model_length_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//*****************************************************************************
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <rapidjson/document.h>
#include "../../port/rapidjson_document.hpp"

#include <openvino/genai/tokenizer.hpp>

Expand Down
5 changes: 1 addition & 4 deletions src/utils/rapidjson_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@

#include <string>

#pragma warning(push)
#pragma warning(disable : 6313)
#include <rapidjson/document.h>
#include "../port/rapidjson_document.hpp"
#include "src/port/rapidjson_stringbuffer.hpp"
#include "src/port/rapidjson_writer.hpp"
#pragma warning(pop)

namespace ovms {
std::string documentToString(const rapidjson::Document& doc) {
Expand Down