Skip to content

Commit

Permalink
native -> isolated namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatolyKalin committed Mar 4, 2024
1 parent 1b798fd commit 7a97efe
Show file tree
Hide file tree
Showing 18 changed files with 109 additions and 32 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ set(dxFeedGraalCxxApi_InternalUtilsDebug_Sources
src/internal/utils/debug/Debug.cpp
)

set(dxFeedGraalCxxApi_Native_Sources
src/native/JavaException.cpp)
set(dxFeedGraalCxxApi_Isolated_Sources
src/isolated/exceptions/JavaException.cpp
src/isolated/api/IsolatedDXEndpoint.cpp
)

set(dxFeedGraalCxxApi_Api_Sources
src/api/DXEndpoint.cpp
Expand Down Expand Up @@ -258,7 +260,7 @@ set(dxFeedGraalCxxApi_Sources
${dxFeedGraalCxxApi_Internal_Sources}
${dxFeedGraalCxxApi_InternalUtils_Sources}
${dxFeedGraalCxxApi_InternalUtilsDebug_Sources}
${dxFeedGraalCxxApi_Native_Sources}
${dxFeedGraalCxxApi_Isolated_Sources}
${dxFeedGraalCxxApi_Api_Sources}
${dxFeedGraalCxxApi_ApiOsub_Sources}
${dxFeedGraalCxxApi_Ipf_Sources}
Expand Down
4 changes: 2 additions & 2 deletions include/dxfeed_graal_cpp_api/api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251 4996)

#include "isolated/Isolated.hpp"

#include "native/GraalException.hpp"
#include "native/JavaException.hpp"
#include "isolated/exceptions/JavaException.hpp"
#include "isolated/exceptions/GraalException.hpp"

#include "ondemand/OnDemandService.hpp"

Expand Down
2 changes: 1 addition & 1 deletion include/dxfeed_graal_cpp_api/internal/Isolate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251)

#include "../native/GraalException.hpp"
#include "../isolated/exceptions/GraalException.hpp"
#include "CEntryPointErrors.hpp"
#include "Common.hpp"
#include "utils/StringUtils.hpp"
Expand Down
31 changes: 31 additions & 0 deletions include/dxfeed_graal_cpp_api/isolated/api/IsolatedDXEndpoint.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) 2024 Devexperts LLC.
// SPDX-License-Identifier: MPL-2.0

#pragma once

#include "../../internal/Conf.hpp"

DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251)

#include "../../api/DXEndpoint.hpp"

DXFCPP_BEGIN_NAMESPACE

namespace isolated::api {

namespace IsolatedDXEndpoint {

// Throws:
// std::invalid_argument if endpoint handle is invalid.
// JavaException if something happened with the dxFeed API backend
// GraalException if something happened with the GraalVM
static dxfcpp::DXEndpoint::State
getState(/* dxfg_endpoint_t* */ const JavaObjectHandle<dxfcpp::DXEndpoint> &endpoint);

}

}

DXFCPP_END_NAMESPACE

DXFCXX_DISABLE_MSC_WARNINGS_POP()
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

#pragma once

#include "../internal/Conf.hpp"
#include "../../internal/Conf.hpp"

DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251 4275)

#include "../internal/CEntryPointErrors.hpp"
#include "../../internal/CEntryPointErrors.hpp"

#include <stdexcept>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include "../internal/Conf.hpp"
#include "../../internal/Conf.hpp"

DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251 4275)

Expand Down
4 changes: 2 additions & 2 deletions src/api/osub/TimeSeriesSubscriptionSymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <dxfg_api.h>

#include "dxfeed_graal_c_api/api.h"
#include "dxfeed_graal_cpp_api/api.hpp"
#include <dxfeed_graal_c_api/api.h>
#include <dxfeed_graal_cpp_api/api.hpp>

DXFCPP_BEGIN_NAMESPACE

Expand Down
4 changes: 2 additions & 2 deletions src/api/osub/WildcardSymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <dxfg_api.h>

#include "dxfeed_graal_c_api/api.h"
#include "dxfeed_graal_cpp_api/api.hpp"
#include <dxfeed_graal_c_api/api.h>
#include <dxfeed_graal_cpp_api/api.hpp>

DXFCPP_BEGIN_NAMESPACE

Expand Down
2 changes: 1 addition & 1 deletion src/internal/Isolate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ Tools::parseSymbols(const std::string &symbolList) noexcept {

namespace api {

static dxfcpp::DXEndpoint::State graalStateToState(dxfg_endpoint_state_t state) {
dxfcpp::DXEndpoint::State graalStateToState(dxfg_endpoint_state_t state) noexcept {
switch (state) {
case DXFG_ENDPOINT_STATE_NOT_CONNECTED:
return dxfcpp::DXEndpoint::State::NOT_CONNECTED;
Expand Down
21 changes: 21 additions & 0 deletions src/isolated/api/IsolatedDXEndpoint.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) 2024 Devexperts LLC.
// SPDX-License-Identifier: MPL-2.0

#include <dxfg_api.h>

#include <dxfeed_graal_cpp_api/api.hpp>

#include <fmt/format.h>

DXFCPP_BEGIN_NAMESPACE

namespace isolated::api {

namespace IsolatedDXEndpoint {

}

}


DXFCPP_END_NAMESPACE
File renamed without changes.
8 changes: 5 additions & 3 deletions tests/api/CandleSymbolTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#include "dxfeed_graal_c_api/api.h"
#include "dxfeed_graal_cpp_api/api.hpp"
#include <doctest.h>
#include <string>
#include <thread>
#include <unordered_map>
#include <vector>

#include <dxfeed_graal_c_api/api.h>
#include <dxfeed_graal_cpp_api/api.hpp>

#include <doctest.h>

using namespace dxfcpp;

using stringOpt = std::optional<std::string>;
Expand Down
7 changes: 5 additions & 2 deletions tests/api/DXEndpointTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#include "dxfeed_graal_c_api/api.h"
#include "dxfeed_graal_cpp_api/api.hpp"
#include <string>
#include <thread>
#include <unordered_map>
#include <vector>

#include <dxfeed_graal_c_api/api.h>
#include <dxfeed_graal_cpp_api/api.hpp>

#include <doctest.h>

TEST_CASE("DXEndpoint::Builder") {
Expand Down
9 changes: 6 additions & 3 deletions tests/api/DXPublisherTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#include "dxfeed_graal_c_api/api.h"
#include "dxfeed_graal_cpp_api/api.hpp"
#include <doctest.h>
#include <string>
#include <thread>
#include <unordered_map>
#include <vector>

#include <dxfeed_graal_c_api/api.h>
#include <dxfeed_graal_cpp_api/api.hpp>

#include <doctest.h>

using namespace dxfcpp;
using namespace dxfcpp::literals;
using namespace std::literals;
Expand Down
12 changes: 8 additions & 4 deletions tests/api/EventsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#include "dxfeed_graal_c_api/api.h"
#include "dxfeed_graal_cpp_api/api.hpp"
#include <doctest.h>
#include <fmt/format.h>
#include <string>
#include <thread>
#include <unordered_map>
#include <vector>

#include <dxfeed_graal_c_api/api.h>
#include <dxfeed_graal_cpp_api/api.hpp>

#include <doctest.h>

using namespace dxfcpp;
using namespace dxfcpp::literals;
using namespace std::literals;
Expand Down
8 changes: 5 additions & 3 deletions tests/api/MarketEventSymbolsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#include "dxfeed_graal_c_api/api.h"
#include "dxfeed_graal_cpp_api/api.hpp"
#include <doctest.h>
#include <string>
#include <thread>
#include <unordered_map>
#include <vector>

#include <dxfeed_graal_c_api/api.h>
#include <dxfeed_graal_cpp_api/api.hpp>

#include <doctest.h>

using namespace dxfcpp;

using stringOpt = std::optional<std::string>;
Expand Down
9 changes: 8 additions & 1 deletion tests/api/OrderSourceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#include "dxfeed_graal_cpp_api/api.hpp"
#include <string>
#include <thread>
#include <unordered_map>
#include <vector>

#include <dxfeed_graal_c_api/api.h>
#include <dxfeed_graal_cpp_api/api.hpp>

#include <doctest.h>

using namespace dxfcpp;
Expand Down
6 changes: 4 additions & 2 deletions tests/system/SystemTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#include "dxfeed_graal_c_api/api.h"
#include "dxfeed_graal_cpp_api/api.hpp"
#include <string>
#include <thread>
#include <unordered_map>
#include <vector>

#include <dxfeed_graal_c_api/api.h>
#include <dxfeed_graal_cpp_api/api.hpp>

#include <doctest.h>

TEST_CASE("System properties can be set, as well as get their values") {
Expand Down

0 comments on commit 7a97efe

Please sign in to comment.